This commit is contained in:
nephacks
2025-06-04 03:22:50 +02:00
parent f234f23848
commit f12416cffd
14243 changed files with 6446499 additions and 26 deletions

View File

@@ -0,0 +1,324 @@
-----------------------------------------------------------
GameMonkey Script Change Log
Newer entries are at the bottom.
Dates are dd/mm/yy
Note that very minor changes like a renamed variable or
modified comment may not appear in this list.
-----------------------------------------------------------
22/12/03
o Package 1.0 ready for public release.
02/01/04
o Updated script reference doc with system functions, compiler string concat and other.
08/01/04
o Fixed filename case mismatch between filenames and #includes for Unix and other platform.
o Renamed and modifed gmNetwork to NetClient and NetServer as they are not gm files.
o Modified GMD project to show gmDebugger in gm file set and use Win32 #defs for windows specific parts.
o Removed memory display from snake.gm
o Added sample script descriptions file.
o Removed GM_MAX() and GM_MIN() macros and replaced with template versions in gmUtil
o Added gmLog2ge function as faster version of gmHighestBit, and changed gmArraySimple and gmArrayComplex to suit.
o Fixed buffer overrun bug with gmVariable::AsString function.
o Removed all warning level 4 warnings bar the warnings generated from flex and bison files.
o Added GM_VERSION #define to gmMachine.h. first version @ "1.1". added gmVersion script binding.
o Changed some #ifdef DEBUG to #ifdef GM_DEBUG_BUILD
09/01/04
o Added constant folding for ints and floats
o Added +=, -=, *=, /= etc. Some more optimisation is required on this to avoid reavaluation of complex l-value.
10/01/04
o Added threadKillAll() binding to allow termination of all threads.
o Added threadIds() binding to allow access to all threads.
o Modified BomberRun.gm to allow exit from main menu.
16/01/04
o Added Minimal code to use GM example.
18/01/04
o Fixed bug in string operator not. Incorrectly returned true instead of false.
23/01/04
o Modified copyright message to be 'GameMonkey Script' as that is the full name.
25/01/04
o Added GameObject example code.
07/02/04
o Remove GM_ASSERT from macro GM_CHECK_FLOAT_PARAM. Was probably left in from some previous debugging.
20/02/04
o gmMachine::Get/SetDesiredByteMemoryUsage() removed and replaced with Get/SetDesiredByteMemoryUsageHard() and Get/SetDesiredByteMemoryUsageSoft().
o Changed behaviour of gmMachine::SetDesiredByteMemoryUsage***(). No longer sets auto-memory to false, also does not have auto-memory parameter.
o New incremental garbage collection logic to govern the inc GC system.
o New GC stats functions: TODO
o Set gmConfig.h to use incremental GC by default. Was using atomic GC.
o Renamed machine bound function threadIds() to threadAllIds() to make it more different from threadId() and more consistent with other naming.
21/02/04
o Added paranoid check code to Incremental GC.
o Fixed serious bug in gmTable with IncGC that caused deleted 'values' to go through write barrier.
o Added Sleep(0) to WIN32 build of GME to improve windows performance which otherwise suffers from unyielding threads.
26/02/04
o Changed strtol to strtoul in gmParser.y to convert hex and binary numbers to unsigned ints causing them to not be truncated. They will appear as full signed ints rather than be clipped to 0-2b range.
03/03/04
o Fixed bug in gmCodeGen.cpp The array container could resize causing pointers to become invalid. List is now used to hold function pointers.
06/03/04
o Generate code target to big/little endian regardless of source platform.
09/03/04
o Modified gmMachine::CollectGarbage() AND binding sysCollectGarbage() to take a optional parameter to perform force full collection.
o Improved VM GC logic so garbage collector will always free memory when it has the chance after a collect cycle.
o Added sysSetDesiredMemoryUsageAuto() binding to enable auto adjust of memory limits (used to be flag in old set memory limit functions).
11/03/04
o Fixed excess memory bug in gmCodeGen.cpp as result of previous bug fix.
o Improved VM GC logic so garbage collector auto sizes soft and hard limits better, but realize logic is still poor as long as only soft limit is exceeded.
01/04/04
o Fixed gmRandomFloat to use RAND_MAX instead of 65535. Effects some platforms as these were not equivalent.
21/04/04
o Improved gmThread::Param(), returns reference to gmVariable instead of instance.
18/06/04
o Removed reseting of error log from gmMachine and gmThread. Allowed memory limit on log. Updated examples.
23/08/04
o Fixed gmMachine::Init(). Global table not initialized after ResetAndFreeMemory().
10/10/04
o Fixed bugs in gmCodeGen.cpp. Removed remaining array resize bugs.
24/10/04
o Remove gmArrayComplex and replaced with gmArraySimple to reduce code as it was not necessary.
o Removed 'no effect' variables that had been there to remove warning 'unreferenced parameter'.
o Wrapped new with GM_NEW and GM_PLACEMENT_NEW for simpler replacement eg. debug new.
o Changed multi char constatns 'abcd' to macro version for better compiler compatability.
o Aligned memory for allocator in gmLibHooks.cpp for PS2. Added alignment size #define.
o Moved #include "assert.h" from gm into gm_Configp.h for better compatability.
o Other minor changes for compiler compatability or reduction of compiler warnings.
25/10/04
o Changed behaviour of Block() to yeild if blocked on 'null'.
o Made functions in gmThread const.
o Added memory presizing functions to allocators and gmMachine.
27/10/04
o Changed malloc,free,realloc to new,delete equivalents in bison.simple and flex.skl files.
o Aligned memory addresses in gmCodeTree, gmLog.
o Added ToDoList.txt to the \docs folder. Removed readme.txt from src\gm folder.
02/11/04
o Added new line to end of files to remove warnings on some compilers.
o Fixed some non-commented comments on preprocessor commands to remove warnings on some compilers.
o Changed some includes to later standard: cassert, new, to remove warnings on some compilers.
o Moved non gm header includes into gmConfig.h with comments. External includes now only in gmConfig.h and gmConfig_p.h.
o Renamed platform\win32 to win32msvc. Added platform\win32gcc. Adjusted paths in projects to reflect this change.
11/11/04
o Fixed commented #define in gmParser.y.
o Fixed bug in gmCallScript.h. If C called C bound function via script, thread was not exited correctly.
o Added gmCallScript::BeginFunction() Generic function call, and AddParamTable().
07/12/04
o Removed platform specific #defines and checks from gmConfig.h
10/12/04
o Added #include <errno.h> to flex.skl for Linux compile.
o Fixed bug in GML. Code used obsolete non 32bit byte code.
11/12/04
o Added gmCall. gmCallScript is now deprecated.
27/12/04
o Replaced GC related 'workLeftToDo' variable names with 'workLeftToGo' so a simple 'todo' search won't find these.
o Implemented file.Seek() as it was not implemented.
01/01/05
o gmfrontend.bat strips CR chars from flex and bison script files before generating compiler files. This should help Linux & Unix builds.
24/01/05
o Fixed more compiler warnings.
30/01/05
o Added newline to end of gmDebugger.cpp. Will have to watch for this in future to keep gcc happy.
03/02/05
o Added (experimental) new table creation syntax. eg. t = {1,2,3,}; same as t = table(1,2,3); for simplified config files.
04/02/05
o Added explicit gmVariable() constructors for gmTableObject and gmFunctionObject completing the default set.
10/02/05
o Modified gmCall to improve access to return variables.
21/03/05
o Added ability for gmMachine to handle cpp owned gmObjects and handle GC for them.
o Changed gmMachine::Presize() (and related functions) to take named params instead of int array for clarity and future expansion.
o Modified gmMemFixedSet to have more smaller memory sizes.
09/04/05
o Removed Windows specific hack from gmDebugger.cpp and moved it to the example Windows debugger files.
o Added gmCall::AddParam() for generic gmVariable params.
14/04/05
o Added syntax highlighting to debugger. (Actually added back old files I found, that were meant for an IDE never finished.)
o Added line numbering to debugger. A quick hack, but maybe useful.
16/04/05
o Changed gmObject derived class constructors to be non-public. This forces creation by gmMachine.
o Minor change to gmListDouble to make some compiler happy.
21/04/05
o Minor changes for compatability with MSVS 2005. gmMathLib, gmStringLib, platform header.
04/05/05
o Added GM_FLOAT_OR_INT_PARAM and GM_CHECK_FLOAT_OR_INT_PARAM to gmThread.h to help with numerical parameters.
09/05/05
o Changed some #defines in gmThread.h gmIncGC.cpp/.h prefixed with GM_ to reduce potential conflict with other code.
10/05/05
o Fixed/Changed friend declaration used by gmTableObject and gmFunctionObject non-public constructors, to work with MSVC 6, 2003, 2005. Handling of friend template functions was different and broken.
o Added optional UserBreak callback to allow external code to break thread execution. Eg. to exit endless loop when user pressed CTRL-BREAK.
05/08/05
o Fixed bug in GameObject example, String operator= not always used.
29/09/05
o Fixed bug in gmTableObject. GC WriteBarrier was not being called with setting values to null. Old values, reassigned elsewhere could be lost.
30/10/05
o Changed location of thread create event so 'this' should be available for query.
14/11/05
o Removed gmShutdownVector3Lib() from Vector3 binds example.
11/01/06
o Fixed bug in gmMachine::RemoveCPPOwnedGMObject(). Was not calling WriteBarrier.
o Added gmMachine::IsCPPOwnedGMObject().
o Added gmMachine::GetTypeTable() (as per DrEvil's mod).
o Modified gmMachine::RegisterLib(), Allow append/modify existing table (as per Oli's mod).
o Removed gmCallScript. (Had been depricated for a long time.)
o Added experimental gmGCRoot to \binds. Current implementation uses STL, but allows custom containers.
21/01/06
o Changed gmMachine, all non-public members are now protected instead of private to allow derived access.
o Changed project and workspaces from MSVC 6 to MSVC 8 (2005)
To compile the Windows based examples & utils, you will need at least 'MS Visual C++ 2005 Express' and the 'Platform SDK', both freely downloadable from Microsoft.
To run the Windows examples you will need VC8 compatible runtimes installed, The '.Net Framework 2.0' redistributables or 'Windows Update' will provide these.
(Left VC6 projects and workspaces in for now. Debugger still relies on MFC which is not supported by 2005 Express edition.)
08/03/06
o Changed doString and (system.)DoFile bindings to take optional 'this' as parameter
o Added gmThread Param() with default gmVariable param.
10/03/06
o Removed CrimsonEdit syntax highlighting for binary numbers as it did not behave as expected.
15/03/06
o Changed GC to start in 'off' state.
02/04/06
o Fixed gmMachine anomaly where, when a new thread is created just before yielding, and the yield occured in the last running thread, the new thread was skipped until the next execution cycle.
05/04/06
o Fixed bug where local (shared) strings waiting for finalization were reused. Made them revive properly.
o Removed old write barrier from gmTable, leaving new correct code only.
16/04/06
o Changed AsString() default for reference types to display pointer in hex instead of decimal.
17/04/06
o Added more info on binding functions to GameMonkeyScriptReference.pdf
22/04/06
o Changed gmThread so that final stack frame including 'this' is still valid when MC_THREAD_DESTROY occurs.
20/05/06
o Added config #define GMMACHINE_REMOVECOMPILER to allow compiler to be removed from gmMachine. Saves some KBs as well as disables compilation.
03/06/06
o Added optional divide by zero check in operators to create GM exception rather than OS exception, as per DrEvil's suggestion.
19/06/06
o Changed gmMachine::AddCPPOwnedGMObject() and RemoveCPPOwnedGMObject() to ignore NULL ptrs rather than ASSERT on them, for caller convenience.
24/07/06
o Added two gmMachine function registration wrappers to provide alternate interface.
o Added %u to bound function 'format' to support unsigned ints.
01/08/06
o Added gmVariable::IsNull().
13/09/06
o Added a bunch of accessor functions to gmVariable and gmTable for convenience.
15/09/06
o Added #define-able nullify in gmVariable ctor. Disabled by default.
26/09/06
o Added #define _USE_32BIT_TIME_T so system binding 32 bit time functions work with MSVC 8 runtimes.
18/10/06
o Changed new gmVariable helpers to be const.
26/10/06
o Added user data to function registering. This can be useful when binding C/C++ functions, particularly when registering MANY script functions to ONE C function that redirects to MANY C/C++ member functions.
05/12/06
o Fixed setdot misspelled as getdot in gmOperators.cpp and gmMachineLib.cpp.
04/01/07
o Modified gmKillThread() to behave as its comment describes.
17/01/07
o Fixed bug where GC was not correctly handling persistent strings. Thanks Kaz.
20/01/07
o Improved GC stats to reduce false warnings about bad GC config.
21/01/07
o Added operators implemented from script. Thanks Seth 'Nightmare'.
o Added another GC stats related function.
o Rearranged pragmas and includes in config headers so order could influence subsequent files.
o Added 'typename' to some template declarations in gmGCRootUtil.
21/02/07
o Fixed atan2 binding. Thanks 'blackstormy'.
20/03/07
o Modified GC auto calibrate to allow no shrink.
o Moved GC related settings to gmConfig.h.
o Added gmMachine::GetAutoMemoryUsage().
o Changed GME initial memory setting.
o Added example Vector3 non operator Add for efficiency comparison.
03/05/07
o Added Experimental user type op_bool test for conditions. Thanks Kaz.
o Modified killed threads. Callback from killed state before recycle/delete.
o Added const to more functions in gmThread.
16/06/07
o Fix bug relating to thread stack resize gmThread::Touch(). Thanks DrEvil.
o Build .EXEs with VC2005 SP1, static linked VC runtimes except for Debugger which uses MFC.
Get vcredist_x86.exe from http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en or search for "Microsoft Visual C++ 2005 SP1 Redistributable Package" if needed.
22/10/07
o Added gmMachine::BindLibToFunction() Just a call through to existing gmLibHooks.
o Changed gmGCRoot<>::Set() to handle null.
o Removed a_filename from gmMachine::ExecuteFunction() since it wasn't used and could confuse users.
11/11/07
o Modified all GM_*_PARAM() and added overloads for all gmThread:Param*(), to check if invalid type was present.
o Modified threadKill() to ignore threads with invalid Id instead of killing current thread.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,27 @@
-----------------------------------------------------------
GameMonkey Script TODO list
In no particular order unless otherwise specified. No time
frame for changes or features, so effectively a wish list.
-----------------------------------------------------------
o Fix empty / commented out script from producing parse error. Work around: Add a ';' semicolon to end of source, or ignore known empty scripts.
o Change overide 'this' syntax from this:func() to func<this>() to support member chains eg. a.b.c<t>()
o Put ++, -- operators back, but don't let them be used in conditions for consistency.
o Make string hash table resize for efficiency in string intensive applications.
o Make compiler thread safe. Probably by moving to Lemon parser and Flex++.
o Make user type Ids sharable between gmMachine instances so identical registration order is not required.
o Make 64bit compatible.
o Add exception handling like try / catch blocks.
o Possibly move code from gmThread into gmMachine.
o Possibly optimize byte code by moving to register stack machine.
o Possibly allow extra (eg. variable number of) parameters to be passes as a table to script functions.
o Optimize thread code to efficiently handle enormous numbers of threads.
o Expose more to the debugger.
o Eventually remove classic garbage collector, leaving only incremental collector.
o Option for unicode strings.
o Binding to allow user type creation and operator functions from within script.
o Possibly store the 'color' bit and 'persistent' bit flags for GCObjects in the lower, unused part of the list pointer.
o Possibly change the double linked list to a single XOR encoded link. This CPU for memory trade may not be worthwhile.

View File

@@ -0,0 +1,308 @@
<HTML><HEAD><TITLE>GM Documentation</TITLE></HEAD><BODY><BR><HR>
<H1>gm</H1>
<HR><BR>
<HR>
<a name="gm::array"><H3>array</H3>
</a><B><EM>Brief:</B></EM> array will create a fixed size array object <BR><B><EM>Param:</B></EM> int size optional (0) <BR><B><EM>Return:</B></EM> array <BR><BR><HR>
<H1>array</H1>
<HR><BR>
<HR>
<a name="array::Size"><H3>Size</H3>
</a><B><EM>Brief:</B></EM> Size will return the current size of the fixed array <BR><B><EM>Return:</B></EM> int array size <BR><HR>
<a name="array::Resize"><H3>Resize</H3>
</a><B><EM>Brief:</B></EM> Resize will resize the array to a new size <BR><B><EM>Param:</B></EM> int size optional (0) <BR><B><EM>Return:</B></EM> null <BR><HR>
<a name="array::Shift"><H3>Shift</H3>
</a><B><EM>Brief:</B></EM> Shift will shift slide the array elements by a delta, nulls are shifted in <BR><B><EM>Param:</B></EM> int delta <BR><B><EM>Return:</B></EM> null <BR><HR>
<a name="array::Move"><H3>Move</H3>
</a><B><EM>Brief:</B></EM> Move will perform a non destructive move on the array <BR><B><EM>Param:</B></EM> int dst <BR><B><EM>Param:</B></EM> int src <BR><B><EM>Param:</B></EM> int size <BR><B><EM>Return:</B></EM> null <BR><BR><HR>
<H1>math</H1>
<HR><BR>
<HR>
<a name="math::abs"><H3>abs</H3>
</a><B><EM>Brief:</B></EM> abs will return the absolute value of the passed int \ float <BR><B><EM>Param:</B></EM> int\float <BR><B><EM>Return:</B></EM> int\float abs(param) <BR><HR>
<a name="math::sqrt"><H3>sqrt</H3>
</a><B><EM>Brief:</B></EM> sqrt will return the square root of the passed int \ float <BR><B><EM>Param:</B></EM> int\float <BR><B><EM>Return:</B></EM> int\float sqrt(param) <BR><HR>
<a name="math::sqrt"><H3>sqrt</H3>
</a><B><EM>Brief:</B></EM> sqrt will return the square root of the passed int \ float <BR><B><EM>Param:</B></EM> int\float A <BR><B><EM>Param:</B></EM> int\float B <BR><B><EM>Return:</B></EM> int\float A to the power of B <BR><HR>
<a name="math::floor"><H3>floor</H3>
</a><B><EM>Brief:</B></EM> floor <BR><B><EM>Param:</B></EM> float A <BR><B><EM>Return:</B></EM> float floor(A) <BR><HR>
<a name="math::ceil"><H3>ceil</H3>
</a><B><EM>Brief:</B></EM> ceil <BR><B><EM>Param:</B></EM> float A <BR><B><EM>Return:</B></EM> float ceil(A) <BR><HR>
<a name="math::round"><H3>round</H3>
</a><B><EM>Brief:</B></EM> round <BR><B><EM>Param:</B></EM> float A <BR><B><EM>Return:</B></EM> float round(A) <BR><HR>
<a name="math::degtorad"><H3>degtorad</H3>
</a><B><EM>Brief:</B></EM> degtorad will convert degrees to radians <BR><B><EM>Param:</B></EM> float\int deg <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::radtodeg"><H3>radtodeg</H3>
</a><B><EM>Brief:</B></EM> radtodeg will convert radians to degrees <BR><B><EM>Param:</B></EM> float\int rad <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::cos"><H3>cos</H3>
</a><B><EM>Brief:</B></EM> cos will return the radian cosine <BR><B><EM>Param:</B></EM> float <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::sin"><H3>sin</H3>
</a><B><EM>Brief:</B></EM> sin will return the radian sine <BR><B><EM>Param:</B></EM> float <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::tan"><H3>tan</H3>
</a><B><EM>Brief:</B></EM> tan will return the radian tan (sin/cos) <BR><B><EM>Param:</B></EM> float <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::acos"><H3>acos</H3>
</a><B><EM>Brief:</B></EM> acos will return the radian arc cosine <BR><B><EM>Param:</B></EM> float <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::asin"><H3>asin</H3>
</a><B><EM>Brief:</B></EM> asin will return the radian arc sine <BR><B><EM>Param:</B></EM> float <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::atan"><H3>atan</H3>
</a><B><EM>Brief:</B></EM> atan will return the radian arc tangent <BR><B><EM>Param:</B></EM> float <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::atan"><H3>atan</H3>
</a><B><EM>Brief:</B></EM> atan will return the radian arc tangent of x / y <BR><B><EM>Param:</B></EM> float x <BR><B><EM>Param:</B></EM> float y <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::log"><H3>log</H3>
</a><B><EM>Brief:</B></EM> log will return the natural logarithm of 1 parameter, or (base, value) the logarithm to base <BR><B><EM>Param:</B></EM> float natural \ base <BR><B><EM>Param:</B></EM> float value (optional) <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::min"><H3>min</H3>
</a><B><EM>Brief:</B></EM> min will return the min of the 2 passed values <BR><B><EM>Param:</B></EM> float\int A <BR><B><EM>Param:</B></EM> float\int B <BR><B><EM>Return:</B></EM> float \ int min(A, B) <BR><HR>
<a name="math::max"><H3>max</H3>
</a><B><EM>Brief:</B></EM> max will return the max of the 2 passed values <BR><B><EM>Param:</B></EM> float\int A <BR><B><EM>Param:</B></EM> float\int B <BR><B><EM>Return:</B></EM> float \ int max(A, B) <BR><HR>
<a name="math::clamp"><H3>clamp</H3>
</a><B><EM>Brief:</B></EM> clamp will return the clamed value. clamp(min, val, max) <BR><B><EM>Param:</B></EM> float\int MIN <BR><B><EM>Param:</B></EM> float\int VALUE <BR><B><EM>Param:</B></EM> float\int MAX <BR><B><EM>Return:</B></EM> float\int value clamped to min, max <BR><HR>
<a name="math::randint"><H3>randint</H3>
</a><B><EM>Brief:</B></EM> randint will return a random int from lower inclusive to upper. <BR><B><EM>Param:</B></EM> int lower inclusive <BR><B><EM>Param:</B></EM> int upper <BR><B><EM>Return:</B></EM> int <BR><HR>
<a name="math::randfloat"><H3>randfloat</H3>
</a><B><EM>Brief:</B></EM> randfloat will return a random float from lower inclusive to upper. <BR><B><EM>Param:</B></EM> float lower inclusive <BR><B><EM>Param:</B></EM> float upper <BR><B><EM>Return:</B></EM> float <BR><HR>
<a name="math::randseed"><H3>randseed</H3>
</a><B><EM>Brief:</B></EM> randseed will seed the random number generator <BR><B><EM>Param:</B></EM> int seed <BR><BR><HR>
<H1>string</H1>
<HR><BR>
<B><EM>Brief:</B></EM> string operations often store a copy of the string on the stack, so keep string sizes reasonable <BR><HR>
<a name="string::IsEmpty"><H3>IsEmpty</H3>
</a><B><EM>Brief:</B></EM> IsEmpty will test to see if the string is 0 length <BR><B><EM>Return:</B></EM> non-zero if the string is empty <BR><HR>
<a name="string::Length"><H3>Length</H3>
</a><B><EM>Brief:</B></EM> Length will return the length of the string not including the null terminating character <BR><B><EM>Return:</B></EM> int length <BR><HR>
<a name="string::Left"><H3>Left</H3>
</a><B><EM>Brief:</B></EM> Left will return the left count charaters of the string <BR><B><EM>Param:</B></EM> int count <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::Right"><H3>Right</H3>
</a><B><EM>Brief:</B></EM> Right will return the right count charaters of the string <BR><B><EM>Param:</B></EM> int count <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::RightAt"><H3>RightAt</H3>
</a><B><EM>Brief:</B></EM> RightAt will return the charaters right of and including the given index <BR><B><EM>Param:</B></EM> int index <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::Mid"><H3>Mid</H3>
</a><B><EM>Brief:</B></EM> Mid will return count characters from the start index <BR><B><EM>Param:</B></EM> int startIndex <BR><B><EM>Param:</B></EM> int count <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::Compare"><H3>Compare</H3>
</a><B><EM>Brief:</B></EM> Compare will perform a string compare <BR><B><EM>Param:</B></EM> string to compare <BR><B><EM>Return:</B></EM> -1 if the this < compare string, 0 if the strings are equal, 1 otherwise <BR><HR>
<a name="string::CompareNoCase"><H3>CompareNoCase</H3>
</a><B><EM>Brief:</B></EM> CompareNoCase will perform a string compare (case insensitive) <BR><B><EM>Param:</B></EM> string to compare <BR><B><EM>Return:</B></EM> -1 if the this < compare string, 0 if the strings are equal, 1 otherwise <BR><HR>
<a name="string::Int"><H3>Int</H3>
</a><B><EM>Brief:</B></EM> Int will return the int value of the string <BR><B><EM>Return:</B></EM> int value <BR><HR>
<a name="string::Float"><H3>Float</H3>
</a><B><EM>Brief:</B></EM> Float will return the float value of the string <BR><B><EM>Return:</B></EM> float value <BR><HR>
<a name="string::String"><H3>String</H3>
</a><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::Upper"><H3>Upper</H3>
</a><B><EM>Brief:</B></EM> Upper will return the string as uppercase <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::Lower"><H3>Lower</H3>
</a><B><EM>Brief:</B></EM> Lower will return the string as lowercase <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::SpanIncluding"><H3>SpanIncluding</H3>
</a><B><EM>Brief:</B></EM> SpanIncluding will return this string while characters are within the passed string <BR><B><EM>Param:</B></EM> string charset <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::SpanExcluding"><H3>SpanExcluding</H3>
</a><B><EM>Brief:</B></EM> SpanExcluding will return this string while characters are not within the passed string <BR><B><EM>Param:</B></EM> string charset <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::AppendPath"><H3>AppendPath</H3>
</a><B><EM>Brief:</B></EM> AppendPath will append a path make sure one '\' is maintained <BR><B><EM>Param:</B></EM> string path to append <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::ReplaceCharsInSet"><H3>ReplaceCharsInSet</H3>
</a><B><EM>Brief:</B></EM> ReplaceCharsInSet will replace all chars in this that are within the charset with the given int char <BR><B><EM>Param:</B></EM> int char to replace with <BR><B><EM>Param:</B></EM> string charset of chars to replace <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::Find"><H3>Find</H3>
</a><B><EM>Brief:</B></EM> Find will find the first occurance of the passed string within this string <BR><B><EM>Param:</B></EM> string search string <BR><B><EM>Param:</B></EM> int start index optional (0) <BR><B><EM>Return:</B></EM> int index of first occurance, or -1 if the string was not found <BR><HR>
<a name="string::Reverse"><H3>Reverse</H3>
</a><B><EM>Brief:</B></EM> Reverse characters of a string <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::ReverseFind"><H3>ReverseFind</H3>
</a><B><EM>Brief:</B></EM> ReverseFind will find the first occurance of the passed string within this string starting from the right <BR><B><EM>Param:</B></EM> string search string <BR><B><EM>Return:</B></EM> int index of first occurance, or -1 if the string was not found <BR><HR>
<a name="string::GetAt"><H3>GetAt</H3>
</a><B><EM>Brief:</B></EM> GetAt will return the char at the given index <BR><B><EM>Param:</B></EM> int index <BR><B><EM>Return:</B></EM> int char, or null if index was out of range <BR><HR>
<a name="string::SetAt"><H3>SetAt</H3>
</a><B><EM>Brief:</B></EM> SetAt will return the string with the character set at the given position <BR><B><EM>Param:</B></EM> int index <BR><B><EM>Param:</B></EM> int char <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::TrimLeft"><H3>TrimLeft</H3>
</a><B><EM>Brief:</B></EM> TrimLeft will return the string with the chars from the passed char set trimmed from the left <BR><B><EM>Param:</B></EM> string charset optional (" \r\n\v\t") <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::TrimRight"><H3>TrimRight</H3>
</a><B><EM>Brief:</B></EM> TrimRight will return the string with the chars from the passed char set trimmed from the right <BR><B><EM>Param:</B></EM> string charset optional (" \r\n\v\t") <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::GetFilenameNoExt"><H3>GetFilenameNoExt</H3>
</a><B><EM>Brief:</B></EM> GetFilenameNoExt will return the filename part of a path string <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::GetFilename"><H3>GetFilename</H3>
</a><B><EM>Brief:</B></EM> GetFilename will return the filename part of a path string incl. extension <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::GetExtension"><H3>GetExtension</H3>
</a><B><EM>Brief:</B></EM> GetExtension will return the file extension <BR><B><EM>Param:</B></EM> int inclDot optional (0) 1 will include '.', 0 won't <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::SetExtension"><H3>SetExtension</H3>
</a><B><EM>Brief:</B></EM> SetExtension returns a string with the extension change to the given one. <BR><B><EM>Param:</B></EM> string ext optional (null) the new extension, with or without the dot. null to remove extension. <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="string::GetPath"><H3>GetPath</H3>
</a><B><EM>Brief:</B></EM> GetPath will return the file path from a path string <BR><B><EM>Param:</B></EM> int inclSlash optional (0) will include a '\' on the end of the path <BR><B><EM>Return:</B></EM> string <BR><BR><HR>
<H1>system</H1>
<HR><BR>
<B><EM>Brief:</B></EM> system functions are bound in a "system" table. <BR><HR>
<a name="system::Exec"><H3>Exec</H3>
</a><B><EM>Brief:</B></EM> Exec will execute a system command <BR><B><EM>Param:</B></EM> string params will be concatinated together with a single space to form the final system command string <BR><B><EM>Return:</B></EM> integer value returned from system exec call, -1 on error <BR><HR>
<a name="system::DoFile"><H3>DoFile</H3>
</a><B><EM>Brief:</B></EM> DoFile will execute the gm script in the named file <BR><B><EM>Param:</B></EM> string filename <BR><B><EM>Param:</B></EM> int optional (1) as 1 will execute string before returning, 0 will execute later. <BR><B><EM>Param:</B></EM> ref optional (null) set 'this' <BR><B><EM>Return:</B></EM> thread id of new thread created to execute file <BR><HR>
<a name="system::File"><H3>File</H3>
</a><B><EM>Brief:</B></EM> File will create a file object <BR><B><EM>Return:</B></EM> file object <BR><HR>
<a name="system::FileExists"><H3>FileExists</H3>
</a><B><EM>Brief:</B></EM> FileExists will test to see if a file exists <BR><B><EM>Param:</B></EM> string filename <BR><B><EM>Return:</B></EM> 1 if the file exists, otherwise 0 <BR><HR>
<a name="system::FileFindFirst"><H3>FileFindFirst</H3>
</a><B><EM>Brief:</B></EM> FileFindFirst will start a file search will test to see if a file exists <BR><B><EM>Param:</B></EM> string filesearch (may contain wildcards, eg, `c:\temp\*.txt`) <BR><B><EM>Return:</B></EM> fileFind object. fileFind object has .filename and .size member <BR><B><EM>See Also:</B></EM> fileFind <BR><HR>
<a name="system::FileFindNext"><H3>FileFindNext</H3>
</a><B><EM>Brief:</B></EM> FileFindNext will get the next file matching the file find <BR><B><EM>Param:</B></EM> fileFind object returned by FileFindFirst call or FileFindNext call <BR><B><EM>Return:</B></EM> fileFind object <BR><B><EM>See Also:</B></EM> fileFind <BR><HR>
<a name="system::FileInfo"><H3>FileInfo</H3>
</a><B><EM>Brief:</B></EM> FileInfo will return a file info object that has readonly members for .creationDate <BR><B><EM>Param:</B></EM> string path <BR><B><EM>Return:</B></EM> fileInfo object, fileInfo object has a .creationTime, .accessedTime, .modifiedTime and a .size <BR><HR>
<a name="system::CreateFolder"><H3>CreateFolder</H3>
</a><B><EM>Brief:</B></EM> CreateFolder will create a file path if it does not already exist <BR><B><EM>Param:</B></EM> string path <BR><B><EM>Return:</B></EM> int 0 on failure, 1 on successful create, 2 if folder already exists <BR><HR>
<a name="system::DeleteFolder"><H3>DeleteFolder</H3>
</a><B><EM>Brief:</B></EM> DeleteFolder will remove a file path <BR><B><EM>Param:</B></EM> string path <BR><B><EM>Param:</B></EM> int remove subfiles and folders optional (0) <BR><B><EM>Return:</B></EM> int 1 on success, 0 con failure <BR><HR>
<a name="system::Time"><H3>Time</H3>
</a><B><EM>Brief:</B></EM> Time will return a unix style time_t as an int <BR><B><EM>Return:</B></EM> the current time <BR><HR>
<a name="system::FormatTime"><H3>FormatTime</H3>
</a><B><EM>Brief:</B></EM> FormatTime will take a int (time_t) value and format according to the passed format string. <BR><B><EM>Param:</B></EM> int time (-1) is a (time_t) to be converted to a string, passing -1 gets current time <BR><B><EM>Param:</B></EM> string format ("%A %d %B %Y, %I:%M:%S %p") is the format string to use.<BR> %a : Abbreviated weekday name<BR> %A : Full weekday name<BR> %b : Abbreviated month name<BR> %B : Full month name<BR> %c : Date and time representation appropriate for locale<BR> %d : Day of month as decimal number (01 <20> 31)<BR> %H : Hour in 24-hour format (00 <20> 23)<BR> %I : Hour in 12-hour format (01 <20> 12)<BR> %j : Day of year as decimal number (001 <20> 366)<BR> %m : Month as decimal number (01 <20> 12)<BR> %M : Minute as decimal number (00 <20> 59)<BR> %p : Current locale<6C>s A.M./P.M. indicator for 12-hour clock<BR> %S : Second as decimal number (00 <20> 59)<BR> %U : Week of year as decimal number, with Sunday as first day of week (00 <20> 53)<BR> %w : Weekday as decimal number (0 <20> 6; Sunday is 0)<BR> %W : Week of year as decimal number, with Monday as first day of week (00 <20> 53)<BR> %x : Date representation for current locale<BR> %X : Time representation for current locale<BR> %y : Year without century, as decimal number (00 <20> 99)<BR> %Y : Year with century, as decimal number<BR> %z, %Z : Time-zone name or abbreviation; no characters if time zone is unknown<BR> %% : Percent sign<BR> <BR><B><EM>Return:</B></EM> the time as a string. <BR><BR><HR>
<H1>fileFind</H1>
<HR><BR>
<B><EM>Brief:</B></EM> fileFind object has a "filename" and "size" member <BR><HR>
<a name="fileFind::GetAttribute"><H3>GetAttribute</H3>
</a><B><EM>Brief:</B></EM> GetAttribute will test a file attribute. <BR><B><EM>Param:</B></EM> int char attribute 'r' readonly, 'a' archive, 's' system, 'h' hidden, 'c' compressed, 'd' directory <BR><B><EM>Return:</B></EM> 1 if the attribute is set, 0 otherwise <BR><BR><HR>
<H1>file</H1>
<HR><BR>
<HR>
<a name="file::Open"><H3>Open</H3>
</a><B><EM>Brief:</B></EM> Open will open a file in binary mode <BR><B><EM>Param:</B></EM> string filename <BR><B><EM>Param:</B></EM> int readonly optional (1) <BR><B><EM>Return:</B></EM> 1 if the open was successful, 0 otherwise <BR><HR>
<a name="file::OpenText"><H3>OpenText</H3>
</a><B><EM>Brief:</B></EM> OpenText will open a file in text mode <BR><B><EM>Param:</B></EM> string filename <BR><B><EM>Param:</B></EM> int readonly optional (1) <BR><B><EM>Return:</B></EM> 1 if the open was successful, 0 otherwise <BR><HR>
<a name="file::Close"><H3>Close</H3>
</a><B><EM>Brief:</B></EM> Close will close a file <BR><HR>
<a name="file::IsOpen"><H3>IsOpen</H3>
</a><B><EM>Brief:</B></EM> IsOpen will test to see if a file is open <BR><B><EM>Return:</B></EM> 1 if the file is open, 0 otherwise <BR><HR>
<a name="file::Seek"><H3>Seek</H3>
</a><B><EM>Brief:</B></EM> Move to position within file <BR><B><EM>Param:</B></EM> int offset positional offset relative to origin <BR><B><EM>Param:</B></EM> int origin eg. myFile.SEEK_CUR, myFile.SEEK_END, myFile.SEEK_SET for current, end, start origins. <BR><B><EM>Return:</B></EM> int 1 if operation succeeded, 0 if failed. <BR><HR>
<a name="file::Tell"><H3>Tell</H3>
</a><B><EM>Brief:</B></EM> Tell will return the current cursor position of the file <BR><B><EM>Return:</B></EM> int the current cursor position, -1 on error <BR><HR>
<a name="file::ReadLine"><H3>ReadLine</H3>
</a><B><EM>Brief:</B></EM> ReadLine will read a line of text from the file. <BR><B><EM>Param:</B></EM> int keep optional (0) as 1 will keep the "\n" char on the line, otherwise it is removed <BR><B><EM>Return:</B></EM> string, or null on eof <BR><HR>
<a name="file::ReadChar"><H3>ReadChar</H3>
</a><B><EM>Brief:</B></EM> ReadChar will read a char from the file <BR><B><EM>Return:</B></EM> int char or null on eof <BR><HR>
<a name="file::WriteString"><H3>WriteString</H3>
</a><B><EM>Brief:</B></EM> WriteString will write a string to the file <BR><B><EM>Param:</B></EM> string to write to file <BR><B><EM>Return:</B></EM> 1 on success, null on error <BR><HR>
<a name="file::WriteChar"><H3>WriteChar</H3>
</a><B><EM>Brief:</B></EM> WriteChar will write a char to the file <BR><B><EM>Param:</B></EM> int char to write to file <BR><B><EM>Return:</B></EM> 1 on success, null on error <BR><BR><HR>
<H1>Vector3</H1>
<HR><BR>
<HR>
<a name="Vector3::Vector3"><H3>Vector3</H3>
</a><B><EM>Brief:</B></EM> Create a Vector3 object <BR><B><EM>Param:</B></EM> float x or [0] optional (0) <BR><B><EM>Param:</B></EM> float y or [1] optional (0) <BR><B><EM>Param:</B></EM> float z or [2] optional (0) <BR><BR><HR>
<H1>Vector3</H1>
<HR><BR>
<B><EM>Brief:</B></EM> Vector3 math class <BR><HR>
<a name="Vector3::DominantAxis"><H3>DominantAxis</H3>
</a><B><EM>Brief:</B></EM> Find the index of the largest vector component. <BR><B><EM>This:</B></EM> Vector to evaluate. <BR><B><EM>Return:</B></EM> int Index of largest component. <BR><HR>
<a name="Vector3::Dot"><H3>Dot</H3>
</a><B><EM>Brief:</B></EM> Calculate the Dot (or Inner) Product of two vectors. <BR><B><EM>This:</B></EM> Vector3 First vector. <BR><B><EM>Param:</B></EM> Vector3 Second vector. <BR><B><EM>Return:</B></EM> float result. <BR><HR>
<a name="Vector3::Length"><H3>Length</H3>
</a><B><EM>Brief:</B></EM> Length will return the length of the vector. <BR><B><EM>Return:</B></EM> float Dot product result that is cosine of the angle between the two vectors. <BR><HR>
<a name="Vector3::Cross"><H3>Cross</H3>
</a><B><EM>Brief:</B></EM> Calculate the Cross (or Outer) Product of two vectors. <BR><B><EM>This:</B></EM> Vector3 First vector. <BR><B><EM>Param:</B></EM> Vector3 Second vector. <BR><B><EM>Return:</B></EM> Vector3 Cross product resultant vector that is perpendicular to the two input vectors and length sine of the angle between them. <BR><HR>
<a name="Vector3::Normalize"><H3>Normalize</H3>
</a><B><EM>Brief:</B></EM> Return a unit length copy of this vector. <BR><B><EM>This:</B></EM> Vector to be copied. <BR><B><EM>Return:</B></EM> Vector3 Unit length copy of this vector. <BR><HR>
<a name="Vector3::LengthSquared"><H3>LengthSquared</H3>
</a><B><EM>Brief:</B></EM> Return the squared length of the vector. <BR><B><EM>Return:</B></EM> float Squared length of the vector. <BR><HR>
<a name="Vector3::ProjectFrom"><H3>ProjectFrom</H3>
</a><B><EM>Brief:</B></EM> Project a direction from a point. <BR><B><EM>This:</B></EM> Vector3 Direction. <BR><B><EM>Param:</B></EM> Vector3 Start point; <BR><B><EM>Param:</B></EM> float Distance or time. <BR><B><EM>Return:</B></EM> Vector3 Projected result. <BR><HR>
<a name="Vector3::Clone"><H3>Clone</H3>
</a><B><EM>Brief:</B></EM> Return a copy of this vector. <BR><B><EM>Return:</B></EM> A copy of this vector. <BR><HR>
<a name="Vector3::Set"><H3>Set</H3>
</a><B><EM>Brief:</B></EM> Set vector from other vector or 3 components. <BR><HR>
<a name="Vector3::LerpToPoint"><H3>LerpToPoint</H3>
</a><B><EM>Brief:</B></EM> Linear interpolate between two 'point' vectors. <BR><B><EM>This:</B></EM> Vector3 From vector. <BR><B><EM>Param:</B></EM> Vector3 To vector. <BR><B><EM>Param:</B></EM> float Fraction or time between 0 and 1. <BR><B><EM>Return:</B></EM> Vector3 Resulting inbetween vector. <BR><HR>
<a name="Vector3::SlerpToVector"><H3>SlerpToVector</H3>
</a><B><EM>Brief:</B></EM> Spherical linear interpolate between two vectors. <BR><B><EM>This:</B></EM> Vector3 From vector. <BR><B><EM>Param:</B></EM> Vector3 To vector. <BR><B><EM>Param:</B></EM> float Fraction or time between 0 and 1. <BR><B><EM>Return:</B></EM> Vector3 Resulting inbetween vector. <BR><HR>
<a name="Vector3::RotateAxisAngle"><H3>RotateAxisAngle</H3>
</a><B><EM>Brief:</B></EM> Rotate around Axis by Angle. <BR><B><EM>This:</B></EM> Vector3 Vector to rotate. <BR><B><EM>Param:</B></EM> Vector3 Unit length axis of rotation. <BR><B><EM>Param:</B></EM> float Angle amount to rotate. <BR><B><EM>Return:</B></EM> Vector3 Resulting rotated vector. <BR><HR>
<a name="Vector3::RotateX"><H3>RotateX</H3>
</a><B><EM>Brief:</B></EM> Rotate around X Axis by Angle. <BR><B><EM>This:</B></EM> Vector3 Vector to rotate. <BR><B><EM>Param:</B></EM> float Angle amount to rotate. <BR><B><EM>Return:</B></EM> Vector3 Resulting rotated vector. <BR><HR>
<a name="Vector3::RotateX"><H3>RotateX</H3>
</a><B><EM>Brief:</B></EM> Rotate around Y Axis by Angle. <BR><B><EM>This:</B></EM> Vector3 Vector to rotate. <BR><B><EM>Param:</B></EM> float Angle amount to rotate. <BR><B><EM>Return:</B></EM> Vector3 Resulting rotated vector. <BR><HR>
<a name="Vector3::RotateZ"><H3>RotateZ</H3>
</a><B><EM>Brief:</B></EM> Rotate around Z Axis by Angle. <BR><B><EM>This:</B></EM> Vector3 Vector to rotate. <BR><B><EM>Param:</B></EM> float Angle amount to rotate. <BR><B><EM>Return:</B></EM> Vector3 Resulting rotated vector. <BR><HR>
<a name="Vector3::SetAdd"><H3>SetAdd</H3>
</a><B><EM>Brief:</B></EM> Add two vectors, store result in this. Demonstrate relative efficiency compared to operator version. <BR><B><EM>This:</B></EM> Vector3 Result vector. <BR><B><EM>Param:</B></EM> Vector3 First vector. <BR><B><EM>Param:</B></EM> Vector3 Second vector. <BR><HR>
<a name="Vector3::Add"><H3>Add</H3>
</a><B><EM>Brief:</B></EM> Add vector to this. Demonstrate relative efficiency compared to operator version. <BR><B><EM>This:</B></EM> Vector3 Result vector. <BR><B><EM>Param:</B></EM> Vector3 vector to add. <BR><BR><HR>
<H1>gm</H1>
<HR><BR>
<B><EM>Brief:</B></EM> functions in the gm lib are all global scope <BR><HR>
<a name="gm::debug"><H3>debug</H3>
</a><B><EM>Brief:</B></EM> debug will cause a the debugger to break at this point while running. <BR><BR><HR>
<H1>gm</H1>
<HR><BR>
<B><EM>Brief:</B></EM> functions in the gm lib are all global scope <BR><HR>
<a name="gm::gmVersion"><H3>gmVersion</H3>
</a><B><EM>Brief:</B></EM> gmVersion will return the gmMachine version string. version string is major type . minor type as a string and was added at version 1.1 <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="gm::typeId"><H3>typeId</H3>
</a><B><EM>Brief:</B></EM> typeId will return the type id of the passed var <BR><B><EM>Param:</B></EM> var <BR><B><EM>Return:</B></EM> integer type <BR><HR>
<a name="gm::typeName"><H3>typeName</H3>
</a><B><EM>Brief:</B></EM> typeName will return the type name of the passed var <BR><B><EM>Param:</B></EM> var <BR><B><EM>Return:</B></EM> string <BR><HR>
<a name="gm::typeRegisterOperator"><H3>typeRegisterOperator</H3>
</a><B><EM>Brief:</B></EM> typeRegisterOperator will register an operator for a type <BR><B><EM>Param:</B></EM> int typeid <BR><B><EM>Param:</B></EM> string operator name is one of "getdot", "setdot", "getind", "setind", "add", "sub", "mul", "div", "mod", "inc", "dec", "bitor", "bitxor", "bitand", "shiftleft", "shiftright", "bitinv", "lt", "gt", "lte", "gte", "eq", "neq", "neg", "pos", "not" <BR><B><EM>Param:</B></EM> function <BR><B><EM>Return:</B></EM> 1 on success, otherwise 0 <BR><HR>
<a name="gm::typeRegisterVariable"><H3>typeRegisterVariable</H3>
</a><B><EM>Brief:</B></EM> typeRegisterVariable will register a variable with a type such that (type).varname will return the variable <BR><B><EM>Param:</B></EM> int typeid <BR><B><EM>Param:</B></EM> string var name <BR><B><EM>Param:</B></EM> var <BR><B><EM>Return:</B></EM> 1 on success, otherwise 0 <BR><HR>
<a name="gm::sysCollectGarbage"><H3>sysCollectGarbage</H3>
</a><B><EM>Brief:</B></EM> sysCollectGarbage will run the garbage collector iff the current mem used is over the desired mem used <BR><B><EM>Param:</B></EM> forceFullCollect (false) Optionally perform full garbage collection immediately if garbage collection is not disabled. <BR><B><EM>Return:</B></EM> 1 if the gc was run, 0 otherwise <BR><HR>
<a name="gm::sysGetMemoryUsage"><H3>sysGetMemoryUsage</H3>
</a><B><EM>Brief:</B></EM> sysGetMemoryUsage will return the current memory used in bytes <BR><B><EM>Return:</B></EM> int memory usage <BR><HR>
<a name="gm::sysSetDesiredMemoryUsageHard"><H3>sysSetDesiredMemoryUsageHard</H3>
</a><B><EM>Brief:</B></EM> sysSetDesiredMemoryUsageHard will set the desired memory useage in bytes. when this is exceeded the garbage collector will be run. <BR><B><EM>Param:</B></EM> int desired mem usage in bytes <BR><HR>
<a name="gm::sysSetDesiredMemoryUsageSoft"><H3>sysSetDesiredMemoryUsageSoft</H3>
</a><B><EM>Brief:</B></EM> sysSetDesiredMemoryUsageSoft will set the desired memory useage in bytes. when this is exceeded the garbage collector will be run. <BR><B><EM>Param:</B></EM> int desired mem usage in bytes <BR><HR>
<a name="gm::sysGetDesiredMemoryUsageHard"><H3>sysGetDesiredMemoryUsageHard</H3>
</a><B><EM>Brief:</B></EM> sysGetDesiredMemoryUsageHard will get the desired memory useage in bytes. Note that this value is used to start garbage collection, it is not a strict limit. <BR><B><EM>Return:</B></EM> int Desired memory usage in bytes. <BR><HR>
<a name="gm::sysGetDesiredMemoryUsageSoft"><H3>sysGetDesiredMemoryUsageSoft</H3>
</a><B><EM>Brief:</B></EM> sysGetDesiredMemoryUsageSoft will get the desired memory useage in bytes. Note that this value is used to start garbage collection, it is not a strict limit. <BR><B><EM>Return:</B></EM> int Desired memory usage in bytes. <BR><HR>
<a name="gm::sysSetDesiredMemoryUsageAuto"><H3>sysSetDesiredMemoryUsageAuto</H3>
</a><B><EM>Brief:</B></EM> sysSetDesiredMemoryUsageAuto will enable auto adjustment of the memory limit(s) for subsequent garbage collections. <BR><B><EM>Param:</B></EM> int enable or disable flag <BR><HR>
<a name="gm::sysGetStatsGCNumFullCollects"><H3>sysGetStatsGCNumFullCollects</H3>
</a><B><EM>Brief:</B></EM> sysGetStatsGCNumFullCollects Return the number of times full garbage collection has occured. <BR><B><EM>Return:</B></EM> int Number of times full collect has occured. <BR><HR>
<a name="gm::sysGetStatsGCNumIncCollects"><H3>sysGetStatsGCNumIncCollects</H3>
</a><B><EM>Brief:</B></EM> sysGetStatsGCNumIncCollects Return the number of times incremental garbage collection has occured. This number may increase in twos as the GC has multiple phases which appear as restarts. <BR><B><EM>Return:</B></EM> int Number of times incremental collect has occured. <BR><HR>
<a name="gm::sysGetStatsGCNumWarnings"><H3>sysGetStatsGCNumWarnings</H3>
</a><B><EM>Brief:</B></EM> sysGetStatsGCNumWarnings Return the number of warnings because the GC or VM thought the GC was poorly configured. If this number is large and growing rapidly, the GC soft and hard limits need to be configured better. Do not be concerned if this number grows slowly. <BR><B><EM>Return:</B></EM> int Number of warnings garbage collect has generated. <BR><HR>
<a name="gm::sysIsGCRunning"><H3>sysIsGCRunning</H3>
</a><B><EM>Brief:</B></EM> Returns true if GC is running a cycle. <BR><HR>
<a name="gm::sysTime"><H3>sysTime</H3>
</a><B><EM>Brief:</B></EM> sysTime will return the machine time in milli seconds <BR><B><EM>Return:</B></EM> int <BR><HR>
<a name="gm::doString"><H3>doString</H3>
</a><B><EM>Brief:</B></EM> doString will execute the passed gm script <BR><B><EM>Param:</B></EM> string script <BR><B><EM>Param:</B></EM> int optional (1) set as true and the string will execute before returning to this thread <BR><B><EM>Param:</B></EM> ref optional (null) set 'this' <BR><B><EM>Return:</B></EM> int thread id of thread created for string execution <BR><HR>
<a name="gm::globals"><H3>globals</H3>
</a><B><EM>Brief:</B></EM> globals will return the globals table <BR><B><EM>Return:</B></EM> table containing all global variables <BR><HR>
<a name="gm::threadTime"><H3>threadTime</H3>
</a><B><EM>Brief:</B></EM> threadTime will return the thread execution time in milliseconds <BR><B><EM>Return:</B></EM> int <BR><HR>
<a name="gm::threadId"><H3>threadId</H3>
</a><B><EM>Brief:</B></EM> threadId will return the thread id of the current executing script <BR><B><EM>Return:</B></EM> int <BR><HR>
<a name="gm::threadAllIds"><H3>threadAllIds</H3>
</a><B><EM>Brief:</B></EM> threadIds returns a table of thread Ids <BR><B><EM>Return:</B></EM> table of thread Ids <BR><HR>
<a name="gm::threadKill"><H3>threadKill</H3>
</a><B><EM>Brief:</B></EM> threadKill will kill the thread with the given id <BR><B><EM>Param:</B></EM> int threadId optional (0) will kill this thread <BR><HR>
<a name="gm::threadKillAll"><H3>threadKillAll</H3>
</a><B><EM>Brief:</B></EM> threadKillAll will kill all the threads except the current one <BR><B><EM>Param:</B></EM> bool optional (false) will kill this thread if true <BR><HR>
<a name="gm::thread"><H3>thread</H3>
</a><B><EM>Brief:</B></EM> thread will start a new thread <BR><B><EM>Param:</B></EM> function entry point of the thread <BR><B><EM>Param:</B></EM> ... parameters to pass to the entry function <BR><B><EM>Return:</B></EM> int threadid <BR><HR>
<a name="gm::yield"><H3>yield</H3>
</a><B><EM>Brief:</B></EM> yield will hand execution control to the next thread <BR><HR>
<a name="gm::exit"><H3>exit</H3>
</a><B><EM>Brief:</B></EM> exit will kill this thread <BR><HR>
<a name="gm::assert"><H3>assert</H3>
</a><B><EM>Brief:</B></EM> assert <BR><B><EM>Param:</B></EM> int expression if true, will do nothing, if false, will cause an exception <BR><HR>
<a name="gm::sleep"><H3>sleep</H3>
</a><B><EM>Brief:</B></EM> sleep will sleep this thread for the given number of seconds <BR><B><EM>Param:</B></EM> int\float seconds <BR><HR>
<a name="gm::signal"><H3>signal</H3>
</a><B><EM>Brief:</B></EM> signal will signal the given variable, this will unblock dest threads that are blocked on the same variable. <BR><B><EM>Param:</B></EM> var <BR><B><EM>Param:</B></EM> int destThreadId optional (0) 0 will signal all threads <BR><HR>
<a name="gm::block"><H3>block</H3>
</a><B><EM>Brief:</B></EM> block will block on all passed vars, execution will halt until another thread signals one of the block variables. Will yield on null and return null. <BR><B><EM>Param:</B></EM> ... vars <BR><B><EM>Return:</B></EM> the unblocking var <BR><HR>
<a name="gm::stateSet"><H3>stateSet</H3>
</a><B><EM>Brief:</B></EM> stateSet will collapse the stack to nothing, and push the passed functions. <BR><B><EM>Param:</B></EM> function new state function to execute <BR><B><EM>Param:</B></EM> ... params for new state function <BR><HR>
<a name="gm::stateSetOnThread"><H3>stateSetOnThread</H3>
</a><B><EM>Brief:</B></EM> stateSetOnThread will collapse the stack of the given thread id to nothing, and push the passed functions. <BR><B><EM>Param:</B></EM> int thread id <BR><B><EM>Param:</B></EM> function new state function to execute <BR><B><EM>Param:</B></EM> ... params for new state function <BR><HR>
<a name="gm::stateGet"><H3>stateGet</H3>
</a><B><EM>Brief:</B></EM> stateGet will return the function on the bottom of this threads execution stack iff it was pushed using stateSet <BR><B><EM>Param:</B></EM> a_threadId Optional Id of thread to get state on. \reutrn function \ null <BR><HR>
<a name="gm::stateGetLast"><H3>stateGetLast</H3>
</a><B><EM>Brief:</B></EM> stateGetLast will return the last state function of this thread <BR><B><EM>Param:</B></EM> a_threadId Optional Id of thread to get last state on. \reutrn function \ null <BR><HR>
<a name="gm::stateSetExitFunction"><H3>stateSetExitFunction</H3>
</a><B><EM>Brief:</B></EM> stateSetExitFunction will set an exit function for this state, that will be called with no parameters if this thread switches state <BR><B><EM>Param:</B></EM> function <BR><HR>
<a name="gm::tableCount"><H3>tableCount</H3>
</a><B><EM>Brief:</B></EM> tableCount will return the number of elements in a table object <BR><B><EM>Param:</B></EM> table <BR><B><EM>Return:</B></EM> int <BR><HR>
<a name="gm::tableDuplicate"><H3>tableDuplicate</H3>
</a><B><EM>Brief:</B></EM> tableDuplicate will duplicate the passed table object <BR><B><EM>Param:</B></EM> table <BR><B><EM>Return:</B></EM> table <BR><HR>
<a name="gm::print"><H3>print</H3>
</a><B><EM>Brief:</B></EM> print will print the given vars to the print handler. passed strings are concatinated together with a seperating space. <BR><B><EM>Param:</B></EM> ... strings <BR><HR>
<a name="gm::format"><H3>format</H3>
</a><B><EM>Brief:</B></EM> format (like sprintf, but returns a string) %d, %s, %f, %c, %b, %x, %e <BR><B><EM>Param:</B></EM> string <BR></BODY></HTML>