PocketC 3 [3.61] SYSTEM sleep(int ms) sleeps for ms milliseconds. --- resetaot() resets the auto off timer. --- getsysval(int index) gets a system value. Currently supported values: [0] Username. --- launch(string creatorID) closes PocketC and launches the application with the given creator ID. Returns 0 on failure, does not return on success. Ex: launch("memo"); // Opens memo pad. Ex: launch("lnch"); // Opens the application launcher if running OS 3.0 --- exit() exits PocketC and launches the current app launcher (by simulating a press of the App silkscreen button). --- clipget() returns the current clipboard contents (if text). --- clipset(string text) sets the text clipboard contents. --- atexit(pointer func) The function whose address is passed to this function is called immediately when the user attempts to switch apps (but not when the user presses the Done button or the Applet|Stop menu item) --- version() returns the installed PocketC version. For version 3.8, this returns 380 MEMORY MANAGEMENT malloc(int size) allocates a block of size values of type int, but of undefined value. Returns a pointer to the block or 0 on failure. --- free(pointer ptr) releases the memory of the block pointed to by ptr which was previously allocated by malloc(). When an applet exits, all blocks that are still allocated will automatically be freed to prevent memory leaks. settype(pointer ptr, int size, char type) - sets the type of the size contiguous values starting at ptr to the type specified by type ('i' for int, 'f' for float, 'c' for char, 's' for string). Use this function only on memory allocated by malloc(). Returns 0 on error. --- settype(pointer ptr, int size, char type) sets the type of the size contiguous values starting at ptr to the type specified by type ('i' for int or pointer, 'f' for float, 'c' for char, 's' for string). Use this function only on memory allocated by malloc(). Returns 0 on error --- typeof(pointer ptr) returns the type of the value pointed to by ptr, ('i' for int, 'c' for char, 'f' for float, 's' for string, 'o' for other). --- memcpy(pointer dest, pointer src, int size) copies the data from the block of size size pointed to by src to the block pointed to by dest. The types of the destination values is not preserved. (i.e. if dest points to a string, and src points to an int, the memory pointed to by dest will be changed to an int).. SERIAL I/O seropen(int baud, string settings, int timeout) open the serial port. Tested baud rates are 300-57600, higher rates are theoretically possible. settings is a 4-char string in the form "8N1C" [bits/char (6,7,8) parity (N,E,O) stop bits (1,2) flow control (X-software,C-CTS,R-RTS)]. timeout is the number of clock ticks (1/100 sec) to wait for data. Returns 0 for success. --- serclose() close serial port. --- sersend(char byte) send a byte, return 0 on success. --- serrecv() receive a byte, returns an integer 0-255 on success, > 255 on failure. --- serdata() return 1 if data is waiting, 0 otherwise. --- serbuffsize(int size) allocates a serial buffer of the given size (+32 bytes for PalmOS overhead). This function should only be called if you seem to be having serial overrun problems. Returns 1 on success, 0 on failure.