Merge pull request #117 from breakin/fix/documentation-bugs

Fix some small bugs in the documentation examples
This commit is contained in:
Alberto Demichelis 2017-11-21 02:38:40 +08:00 committed by GitHub
commit 249a26e829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 5 deletions

View File

@ -164,7 +164,7 @@ pops a key from the stack and delete the slot indexed by it from the table at po
:param HSQUIRRELVM v: the target VM
:param SQInteger idx: index of the target object in the stack
:returns: a SQRESULT
:remarks: this call will invokes the delegation system like a normal dereference it only works on tables, arrays and userdata; if the function fails, nothing will be pushed in the stack.
:remarks: this call will invokes the delegation system like a normal dereference it only works on tables, arrays, classes, instances and userdata; if the function fails, nothing will be pushed in the stack.
pops a key from the stack and performs a get operation on the object at the position idx in the stack; and pushes the result in the stack.

View File

@ -16,7 +16,7 @@ parameter is > 0. ::
sq_pushinteger(v,1);
sq_pushfloat(v,2.0);
sq_pushstring(v,"three",-1);
sq_call(v,4,SQFalse);
sq_call(v,4,SQFalse,SQFalse);
sq_pop(v,2); //pops the roottable and the function
this is equivalent to the following Squirrel code::

View File

@ -8,7 +8,7 @@ You can compile a Squirrel script with the function *sq_compile*.::
typedef SQInteger (*SQLEXREADFUNC)(SQUserPointer userdata);
SQRESULT sq_compile(HSQUIRRELVM v,SQREADFUNC read,SQUserPointer p,
SQRESULT sq_compile(HSQUIRRELVM v,SQLEXREADFUNC read,SQUserPointer p,
const SQChar *sourcename,SQBool raiseerror);
In order to compile a script is necessary for the host application to implement a reader

View File

@ -99,7 +99,8 @@ Here an example of how to register a function::
{
sq_pushroottable(v);
sq_pushstring(v,fname,-1);
sq_newclosure(v,f,0,0); //create a new function
sq_newclosure(v,f,0); //create a new function
sq_newslot(v,-3,SQFalse);
sq_pop(v,1); //pops the root table
return 0;
}

View File

@ -11,7 +11,7 @@ The object can be also re-pushed in the VM stack using sq_pushobject().::
HSQOBJECT obj;
sq_resetobject(&obj) //initialize the handle
sq_resetobject(&obj); //initialize the handle
sq_getstackobj(v,-2,&obj); //retrieve an object handle from the pos -2
sq_addref(v,&obj); //adds a reference to the object