Download NQC Programmer`s Guide

Transcript
NQC Programmer's Guide
CreateDatalog(size)
Function - RCX
Create a datalog of the specified size (which must be a constant). A size of 0 clears
the existing datalog without creating a new one.
CreateDatalog(100); // datalog for 100 points
AddToDatalog(value)
Function - RCX
Add the value, which may be an expression, to the datalog. If the datalog is full the
call has no effect.
AddToDatalog(x);
UploadDatalog(start, count)
Function - RCX
Initiate and upload of count data points beginning at start. This is of relatively little
use since the host computer usually initiates the upload.
UploadDatalog(0, 100);
// upload entire 100 point log
3.11 General Features
Wait(time)
Function - All
Make a task sleep for specified amount of time (in 100ths of a second). The time
argument may be an expression or a constant:
Wait(100); // wait 1 second
Wait(Random(100)); // wait random time up to 1 second
StopAllTasks()
Function - All
Stop all currently running tasks. This will halt the program completely, so any code
following this command will be ignored.
StopAllTasks();
// stop the program
Random(n)
Value - All
Return a random number between 0 and n. N must be a constant.
x = Random(10);
Page 52