Function Help

Total Function Count: 226
Generated by PerlScript -- Last Modified Tue Dec 14 09:39:59 1999
Author: Kevin Cao
*email me if you noticed any incorrect information

Console


clear() : clears the console window
Return: None

puts(string text) : print a string to the output form, Does not append a newline,
Return: None

putsl(string text) : print a string to the output form, Automatically append a newline,
Return: None

gets(string prompt) : presents an input dialog with the given string as a prompt,
Return: Returns a string if the user pressed OK, or zero if the user presses Cancel,

Draw

settextdefault() : to set the text style back to the default state,
Return: None

getbkmode() : This function returns the current background mix mode for a specified device context. The background mix mode of a device context affects text and dashed pens.
Return: Either OPAQUE or TRANSPARENT, which specifies the current background mix mode, indicates success. Zero indicates failure.

setbkmode(int iBkMode) : This function sets the background mix mode of the specified device context. The background mix mode is used with text, hatched brushes, and with non-solid pen styles.
Return: If the function succeeds, the return value specifies the previous background mode.

setfontattr(string fontname, int italic, int underline,int strikeout, int weight,int width, int height) : set the current text drawing attributes, Italic,Underline, and Strikeout can be either 0 or 1, width and height are the font size,
Return: None

polyline(int * array, int nCount) : polyline function draws points on the screen, and connect them with lines. It is similar to polygon but it doesnot connect the end point to the beginning point. It could be very useful for drawing curves.
Return: None

polygon(int * array, int nCount) : polygon function draws a polygon on the screen. A ploygon is made up by a list of x and y values on a 2D space. The points are connected by a line. This function draws a polygon consisting of two or more vertices connected by straight lines. The current pen outlines the polygon, and the current brush fills it using the specified polygon fill mode.
Return: None

textw(string text) : precalculate the width of the text on screen without drawing it
Return: return the width

keepscreen_on() : keep the screen graphics even if you switch to another appication, Default is ON.
Return: None

keepscreen_off() : turn off the screen keeper
Return: None

screenx() : return screen width
Return: an integer value for screen width

screeny() : return screen height, height value is offset by the menu height,
Return: an integer value for screen height

texth[string text) : precalculate the heigth of the text on screen without drawing it
Return: return the height

clearg() : clear the graphics form,
Return: None

text(int x, int y, string str) : display a string str at locations (x,y),
Return: None

line(int x1, int y1, int x2, int y2) : draws a line from (x1, y1) to (x2, y2),
Return: None

rect(int x1, int y1, int x2, int y2) : draws a rectangle from (x1, y1) to (x2, y2)
Return: None

roundrect(int x1, int y1, int x2, int y2,int cx,int cy) : draws a round rectangle from (x1, y1) to (x2, y2) with round corner (cx,cy),
Return: None

circle(int x, int y, int r) : draws a circle center at (x,y) with radius r
Return: None

ellipse(int x1, int y1, int x2, int y2) : draws an ellipse from (x1, y1) to (x2, y2)
Return: None

drawbitmap(string filename,int x,int y) : Draws a bitmap on screen at location x and y.
Return: None

drawbitblt (string filename,int x,int y,int flag) : draw a bitmap on screen at x and y location with special flags AND,OR,XOR,COPY, *Note: with this function, you can draw bitmap on screen with different effects,
Return: None

setbrushattr(int R, int G, int B) : set the brush color, it is used for rect,circle,ellipse's filling color,
Return: None

setpenattr(int style, int width, int R, int G, int B) : set the pen attribute,
Return: None

setbkcolor(int R, int G, int B) : set the background color
Return: None

settextcolor(int R, int G, int B) : set the text color
Return: None

setpixelattr(int R, int G, int B) : set the pixel color attribute
Return: None

setpixel(int x,int y) : set the pixel at location x and y
Return: None

getpixelR(int x,int y) : obtain color of a pixel
Return: None

getpixelG(int x,int y) : obtain color of a pixel
Return: None

getpixelB(int x,int y) : obtain color of a pixel
Return: None

settextangle(int x) : to set the angle at 10th degree accuracy of your text, For example, if you want to make your string looks like standing up, just passing value 900 = 90 Degree * 10,
Return: None

Event

getc() : wait for a key is released, and return the previous key value
Return: Char value

keyevent(char vkey,char cScan, int flag, int extra); : synthesizes a keystroke. The system can use such a synthesized keystroke to generate a WM_KEYUP or WM_KEYDOWN message
Return: none

getnotify() : When an event PM_COMMAND occurs, it contains a notification message. Window controls like ListBox, Button, ComboBox have its own set of notification messages. When a PM_COMMAND event occurs, you can call two functions to find out which windows control sends this message, and why. First call guiid() to find out the window control's ID, second call getnotify() to find out the control's notification message.
Return: return the notification message.

flushevent() : flush all events in the current event queue
Return: return none

event(int blocking) : Check for events in the event queue. [Warning] add sleep(0) statement into your tight loop. You need to allow other processes to have time slice when you are in a tight event. If you don't put sleep(0) in a tight loop, you won't be able to switch tasks and battery power will be drained quickly.
Return: Events are as follows: PM_NONE [0], PM_CHAR[1] , PM_MOUSEMOVE [2], PM_MEMORYSHORT[3], PM_BUTTONDOWN[4], PM_BUTTONUP[5], PM_DBCLICK[6], PM_PAINT[7], PM_COMMAND[8],PM_KEYUP[10],PM_KEYDOWN[9],PM_TIMER[11]

postevent(int nEvent) : post your own event to the event queue, make sure they don't have the same value as the standard PocketC event values,
Return: None

penx() mousex() : retrieve the x value of the previous pen event, *Note: Any MouseMove, Button related messages, Mouse position can be tracked with mousex() and mousey() function
Return: integer value for x position

peny() or mousey() : retrieve the y value of the previous pen event, *Note: Any MouseMove, Button related messages, Mouse position can be tracked with mousex() and mousey() function
Return: integer value for y position

cursorwait(int nState) : show/hide sandbox waiting box on screen
Return: None

menu() : retrieve the ID value of the previous menu event, *Note: When user select a menu item,PM_ COMMAND event will be passed back as the return value of event(int) function, You should use menu() to get the menu id which was selected by the user,
Return: integer value for menu identifier

guiid() : retrieve the ID value of the previous graphic user interface,
Return: integer value for GUI identifier

key() : retrieve the character written during the last event()
Return: key value

timerid() : retrieve the timer id for the last PM_TIMER message
Return: integer value for Timer identifier

settimer(int timerid,int timeElapse) : set a timer, You can set up multiple timer, Each timer has its own ID, and its time length, When you set a timer, remember to specifies the time out value, in milliseconds, When time out, in your event queue, you will receive a PM_TIMER (11) message,
Return: If the function succeeds, the return value is an integer identifying the new timer, An application can pass this value, or the string identifier, if it exists, to the killtimer function to destroy the timer, If the function fails to create a timer, the re

killtimer(int timerid) : kill the timer ID, otherwise, you will receive a PM_TIMER every timeElapse milliseconds,
Return: Return 1 or 0 indicating TRUE or FALSE

waitp() : wait for a pen event PM_BUTTONUP
Return: None

File

writebyte(int handle, int v) : Writes to the output stream the eight low- order bits of the argument v.
Return: None

readbyte(int handle) : Reads and returns one input byte.
Return: the 8-bit value read.

fileenum(int first, string filename) : the function enumerates through all files in one directory.
Return: returns file name. If returns an empty string, that indicates no more files have been found.

filecopy(string ExistingFilePath,string NewFilePath,int bFailIfExists); : copies an existing file to a new file. Make sure set the last parameter bFailIfExistes . It specifies how this operation is to proceed if a file of the same name as that specified by NewFilePath already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.
Return: Return 1 or 0, 1 means True, 0 means False

filemove(string ExistingFilePath,string NewFilePath,int bFailIfExists); : moves an existing file to a new file.
Return: Return 1 or 0, 1 means True, 0 means False

fileopen(string filepath, int type, int flag) : open a file in unicode/ascii. You can create a new file or simply open one. Please use the flag correctly.
Return: Returns an integer as the File Handle if successful,otherwise -1, Remember to keep this handle value somewhere, Because you have to use this handle for the rest of file operations,

filemodeget(int filehandle) : obtain file mode,
Return: Return file mode, ASCII or Unicode

filemodeset(int filehandle, int filetype) : Set file mode ASCII or Unicode, Use with caution, Don't try to write unicode and ascii code into one file,
Return: None

fileclose(int filehandle) : close a file, Note: you have to keep the return value from fileopen() for closing that file,
Return: None

fileread(int filehandle,int counter) : Reads (unbuffered) data from a file at the current file position,
Return: The number of bytes transferred to the buffer, Note , the return value may be less than nCount if the end of file was reached,

filewrite(int filehandle,string data,int counter) : Writes (unbuffered) data in a file to the current file position,
Return: If failed, return -1. If successful, it returns number of written bytes.

filegetlen(int filehandle) : Retrieves the length of the file, Note: Obtains the current logical length of the file in bytes, not the amount,
Return: The length of the file,

filesetlen(int filehandle, int newlen) : Set the length of the file. Newlen value can be larger or smaller than the current length of the file, The file will be extended or truncated according to the newlen
Return: None

fileseek(int filehandle,int offset,int from) : Positions the current file pointer, Repositions the pointer in a previously opened file, The Seek function permits random access to a file's contents by moving the pointer a specified amount, absolutely or relatively, No data is actually read during the seek, When a file is opened, the file pointer is positioned at offset 0, the beginning of the file.
Return: If the requested position is legal, Seek returns the new byte offset from the beginning of the file,

fileseekend(int filehandle) : Sets the value of the file pointer to the logical end of the file, fileseekend() is equivalent to fileseek( filehandle,0, FILE_END),
Return: Return: The length of the file in bytes,

fileflush(int filehandle) : Flushes any data yet to be written, Forces any data remaining in the file buffer to be written to the file,
Return:

filepos(int filehandle) : Obtains the current value of the file pointer, which can be used in subsequent calls to Seek,
Return: current value of the file pointer

[OBSOLETE] CopyFile(string NewFilePath,string ExistingFilePath,int bFailIfExists); : CopyFile function copies an existing file to a new file. Make sure set the last parameter bFailIfExistes . It specifies how this operation is to proceed if a file of the same name as that specified by NewFilePath already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.
Return: Return 1 or 0, 1 means True, 0 means False

MoveFile(string ExistingFileName,string NewFileName); : The MoveFile function renames an existing file or a directory( including all its children),
Return: Return 1 or 0, 1 means True, 0 means False

CreateDirectory(string Dirname), : The CreateDirectory function creates a new directory,
Return: Return 1 or 0, 1 means True, 0 means False

RemoveDirectory(string Dirname), : The RemoveDirectory function deletes an existing empty directory,
Return: Return 1 or 0, 1 means True, 0 means False

DeleteFile(string FileName); , : The DeleteFile function deletes an existing file
Return: Return 1 or 0 or -1, 1 means True, 0 means False, -1 means files not dot exist

GetFileAttr(string filepath), : Get the file's attribute
Return: File attribute.

OpenFileDlg(string FileFilter); : use to initialize an Open or Save As common dialog box, After the user closes the dialog box, the system returns information about the user’s selection, In our case, the selected file path, If user hits cancel, the return string has string len = 0, if you don't want to add any fill filter, just call OpenFileDlg("")
Return: return filepath user just selected

SaveFileDlg(string FileFilter) : use to initialize an Open or Save As common dialog box, After the user closes the dialog box, the system returns information about the user’s selection, In our case, the selected file path, If user hits cancel, the return string has string len = 0, if you don't want to add any fill filter, just call SaveFileDlg("")
Return: return filepath user just selected

writebytes(int handle, string s) : Writes a string to the output stream. For every character in the string s, taken in order, one byte is written to the output stream
Return: None

writechar(int handle, int v) : Writes a char value, wich is comprised of two bytes.
Return: None

writechars(int handle, string s) : Writes every character in the string s, to the output stream, in order, two bytes per character
Return: None

writeint(int handle, int v) : Writes an int value, which is comprised of four bytes, to the output stream
Return: None

readint(int handle) : Reads four input bytes and returns an int value
Return: an integer

readchar(int handle) : Reads an input char and returns the char value
Return: an Unicode char read

GUI

wndmove(int handle, int x, int y, int width, int height) : move a control or window to a new position/size. Units is in pixel.
Return: If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.

wndshow(int handle, int flag) : show/hide a control on screen. Remark* the flag value can be many other values. In most cases, SW_SHOW and SW_HIDE would be enough. If you care to investigate all possible values, Microsoft documentation on Win32 API programming would be the only way to go.
Return: If the window was previously visible, the return value is nonzero. If the window was previously hidden, the return value is zero.

menudel(int handle, int flag, int id) : Delete a menu item from the menu bar. You can delete a menu by its position or its id.
Return: none

menuins(int handle, int id_after, int flag, int id_new, string name); : Insert a menu into current existing menu bar. Right now you can only insert menu under Program menu.
Return: none

lbrstcnt(int nID) : reset the contents of a list box
Return: None

lbdelstr(int nID, int nIndex) : delete a string from the list box
Return: A count of the strings remaining in the list, The return value is LB_ERR -1 if nIndex specifies an index greater than the number of items in the list,

lbgetcnt(int nID) : Returns the number of strings in a list box,
Return: number of strings in a listbox

lbgetcur(int nID) : Get current selection in a listbox
Return: return current selection string's zero-based index value, LB_ERR -1 if none is selected,

lbsetcur(int nID, int nIndex) : Set current selection in a listbox
Return: return LB_ERR -1 is an error occurred,

lbgettxt(int nID, int nIndex) : get a string from a list box
Return: return the string is at zero-based index location,

lbfndstr(int nID, string str) : find a string from a list box
Return: return the founded string's zero-based index location, LB_ERR -1 if none is founded,

sendmsg(int nID, int nMsg, anytype wparam, anytype lparam) : sendmsg sends a specific message to a window control, and it will not return until the message has been processed.
Return: return value is depend on the specific message is sent

createctrl(string strCtrl, string strName, int nStyle, int nExStyle, int xpos, int ypos, int width, int height, int nID) : create a window control. All of that work, you just created one control. If you want to create user interface quickly, Visual Form Buddy or PCForms would be make UI design much easier.
Return: -1 indicates failed. Otherwise, it returns the windows ID.

cbaddstr(int nID, string str) : add a string to the combobox
Return: zero based index value of the added string in the combobox

cbinsstr(int nID, int nIndex, string str) : insert a string to the combobox at a specific position
Return: zero based index value of the inserted string in the combobox

cbrstcnt(int nID) : reset the contents of a combobox
Return: None

cbdelstr(int nID, int nIndex) : delete a string from the combobox
Return: A count of the strings remaining in the list, The return value is LB_ERR -1 if nIndex specifies an index greater than the number of items in the list,

cbgetcnt(int nID) : Returns the number of strings in a combobox,
Return: number of strings in a combobox

cbgetcur(int nID) : Get current selection in a combobox
Return: return current selection string's zero-based index value, LB_ERR -1 if none is selected,

cbsetcur(int nID, int nIndex) : Set current selection in a combobox
Return: return LB_ERR -1 is an error occurred,

cbgettxt(int nID, int nIndex) : get a string from a combobox
Return: return the string is at zero-based index location,

cbfndstr(int nID, int findindex string str) : find a string from a combobox.
Return: return the founded string's zero-based index location, LB_ERR -1 if none is founded,

cbselstr(int nID, int nStart, string str) : select a string if the string is found in the combobox
Return: return the founded string's zero-based index location, LB_ERR -1 if none is founded.

guisetfocus(int guiid) : set input focus to that GUI control.
Return: Returns the previous window control's ID. We reserved 0 for the main window, 1 for console window

guigetfocus() : check which GUI control has the input focus right now,
Return: returns GUI identifier

delgui(int id) : delete User Interface control from the window
Return: None

delallgui(int from, int to) : delete gui control from the window with ID in range less than TO and greater than FROM
Return: None

cbxset(int id, int state) : set check box's state,
Return: None

cbxget(int id) : get check box's current state
Return: return check box's state, 1 means checked, 0 means unchecked

editget(int id) : get current editbox's string
Return: return edit box's string value

editset(int id,string str) : set edit box's value by giving the gui's id and the string value
Return: None

lbaddstr(int nID, string str) : add a string to the listbox
Return: zero based index value of the added string in the listbox

lbinsstr(int nID, int nIndex, string str) : insert a string to the listbox at a specific position
Return: zero based index value of the inserted string in the listbox

menupop(string strmenu) : create a popup menu on screen where the pen tabs. The input is a very simple string that presents the entire menu item list.
Return: return user's selection, 0 if none

menu_off() : hide menu bar
Return: None

menu_on() : show menu bar
Return: None

menupopex(string strmenu, int x, int y) : create a popup menu on screen where the pen tabs. The input is a very simple string that presents the entire menu item list.
Return: return user's selection, 0 if none

Math

rand() : returns a random float between 0 and 1,
Return: a float value

random(int n) : returns a random int between 0 and n-1
Return: a integer value

floor(float x) : returns a floating point value representing the largest integer that is less than or equal to x,There is no error return,
Return: a integer value

ceil(float x) : returns a floating point value representing the smallest integer that is greater than or equal to x, There is no error return,
Return: a integer value

abs(floag x) : returns an absolute value
Return: a integer value

cos(float x) : returns the expected trigonometric value, using radians,
Return: a float value

sin(float x) : returns the expected trigonometric value, using radians,
Return: a float value

tan(float x) : returns the expected trigonometric value, using radians,
Return: a float value

acos(float x) : returns the expected trigonometric value, using radians,
Return: a float value

asin(float x) : returns the expected trigonometric value, using radians,
Return: a float value

atan(float x) : returns the expected trigonometric value, using radians,
Return: a float value

cosh(float x) : returns the expected trigonometric value, using radians,
Return: a float value

sinh(float x) : returns the expected trigonometric value, using radians,
Return: a float value

tanh(float x) : returns the expected trigonometric value, using radians,
Return: a float value

pow(float x, float y) : returns x
Return: y,

sqrt(float x) : returns square root of x,
Return: a float value

log(float x) : returns natural log of x,
Return: a float value

log10(float x) : returns log base 10 of x,
Return: a float value

exp(float x) : returns e
Return: x,

Registry

regwstr(int root,string keypath,string keyname, string sval) : write string to registry database,
Return: return 0 for success, Otherwise fail,

regwint(int root,string keypath,string keyname, int ival) : write integer to registry database,
Return: return 0 for success, Otherwise fail,

regrstr(int root,string keypath,string keyname) : read string from registry database
Return: string

regrint(int root,string keypath,string keyname) : read integer from registry database
Return: integer

regdelkey(int root, string keypath) : function deletes a subkey
Return: return 0 if it succeed, otherwise fail.

regdelval(int root, string keypath) : removes a named value from the specified registry key.
Return: return 0 if it succeed, otherwise fail.

Serial

commsetmask(int handle,int mask) : specifies a set of events to monitor for a communications device
Return: Nonzero indicates success. Zero indicates failure

commwait(int handle, int nblock) : waits for the data. If nblock is 0, it returns immediately. When the data is in the buffer, the main event will receive an event message PM_COMM (12). If nblock is 1, the function will not return until there is data in the buffer.
Return: None

rawiropen(int baud,string settings,int timeout) : open a serial port for infraRed. It searchs through user's registry, and use correct port for infraRed transfer.
Return: 1 means for success, 0 means fail

seropen(int baud, string settings, int timeout) : open a serial port, *Note: Port number is default to "COM:1:" for simplicity, Due to user requests, an addition function has been added for other port accesses, Please use seropenex if you have multiple ports
Return: 1 means for success, 0 means fail

OBSOLETE serdata() : check if there is data available in the buffer
Return: return 1 if data is waiting, 0 otherwise,

OBSOLETE serrecv() : receive a byte, right now the data type is a character,
Return: return a character value

OBSOLETE sersend(char byte) : send a byte,
Return: None

OBSOLETE serclose() : close serial port,
Return: None

seropenex(string comport, int baud, string settings, int timeout) : open the serial port, *Note: for Infrared Port: please obtain the port number from the registry key \\HKEY_LOCAL_MACHINE\\COMM\\IrDA\\Port, The Port number may not be the same on all devices.
Return: 1 means for success, 0 means fail

commclrerr(int handle, void v) : This function retrieves information about a communications error and reports the current status of a communications device. The function is called when a communications error occurs, and it clears the error flag of the device to enable additional input and output (I/O) operations.
Return: A 32-bit variable to be filled with a mask indicating the type of error. This parameter can be one or more of the following error codes:

commsetbrk(int handle) : This function suspends character transmission for a specified communications device and places the transmission line in a break state until the commclrbrk function is called.
Return: Nonzero indicates success. Zero indicates failure

commclrbrk(int handle) : This function restores character transmission for a specified communications device and places the transmission line in a nonbreak state
Return: Nonzero indicates success. Zero indicates failure

commesc(int handle, int ext) : This function directs a specified communications device to perform an extended function.
Return: Nonzero indicates success. Zero indicates failure. To get extended error information

commgetmask(int handle) : This function retrieves the value of the event mask for a specified communications device. The commgetmast function uses a 32-bit mask variable to indicate the set of events that can be monitored for a particular communications resource. A handle to the communications resource can be specified in a call to the commwait function, which waits for one of the events to occur. To modify the event mask of a communications resource, use the commsetmask function.
Return: The return value can be a combination of the following values:

System

recentdoc(string path) : add document to recent document menu, Parameter path, pathname for the document, For example: recentdoc("\\windows\\alarm2,wav");
Return: None

shortcut(string lnkpath,string filepath) : add a shortcut to executable or file, For example: shortcut("\\windows\\Programs\\PocketC,lnk", "\\pocketc\\pceditor,exe"); shortcut("\\windows\\Desktop\\PocketC,lnk", "\\pocketc\\pceditor,exe");
Return: None

debugout(string debugstring) : send a string through OutputDebugString (win32 function) for debug purpose only, you can catch these strings by using HPC trace or other debug utility that monitor OutputDebugString,
Return: None

getcurpath() : obtain current PocketC applet's file location
Return: return a string

quit() : exit your applet gracefully,
Return: None

showabout() : popup about window.
Return: None

graph_off() : popup console window, the appearance of the graphics is not preserved if keepscreen_off() is called,
Return: None

graph_on() : switches to the graphics window
Return: None

MessageBox(string text,string caption,int icon,int buttons) : buttons style can be 1= OKCANCLE, 2=YESNO,  3=YESNOCANCEL.
Return: Return value -1 means Cancel, 0 means NO, 1 means Yes,

about(string text) : set about box's contents,  example string: "MyAppName\r\nMyName"
Return: None

confirm(string text) : pops up an alert dialog with the given text and Yes/No buttons,
Return: Returns 1 for Yes, 0 for No,

alert(string text) : pops up an alert dialog with the given text,
Return: None

title(string text) : give your applet a name! So it will appear on the taskbar on the bottom. It will also keep your application single instance. When a new PocketC application launchs, it will check if any existing same application running. If it is, it will terminate itself, and switch to the running application. It is important feature to have for PPC users.
Return: None

runapptime(string path, int month, int day, int hour, int min) : run application at specific time in the future, Parameter path is the application location, For example:"\\pocketc\\pceditor,exe" or "/pocketc/pceditor,exe" *Note: current implementation is just a simple translation of the actual Win32 shell function,
Return: None

sleep(int len) : A thread can relinquish the remainder of its time slice by calling this function with a sleep time of zero milliseconds
Return: None.

exec(string action, string path, string parameter) : execute a file or an application from PocketC applets
Return: None

loadres(int resourceid) : First, define resource by using preprocessor #resource. The format is #resource id "valid file path". During runtime use function loadres(int resourceid) to obtain the resource file path. The resource file is compiled with the application
Return: valid file path to the resource file

showhelp(string filepath) : Launch help file
Return: 1 for success, 0 for fail.

Sound

beep(int soundtype) : generates a system sound,
Return: None

wave(string wavfile,int flag) : play a wave file, SND_ASYNC The sound is played asynchronously and sndPlaySound returns immediately after beginning the sound, To terminate an asynchronously played sound, call wave with flag set to -1, SND_LOOP The sound plays repeatedly until wave is called again with the flag parameter set to -1, SND_NOSTOP If a sound is currently playing, wave immediately returns FALSE, without playing the requested sound, SND_SYNC The sound is played synchronously and wave does not return until the sound end
Return: None

String

strgetc(string str, int index) : get a character at index position from a string, index starts at 0, For example: strgetc("Hello", 4); it will return character 'o';
Return: Returns a character,

string strsetc(string str,int index, char ch) : returns a string value with modified character at index position, For example: string retstr; retstr = strsetc("Hello",4,'e'); retstr will have string value "Helle",
Return: Returns a modified string

strlen(string str) : returns the length of a string,
Return: return string length

strmid(string str, int first, int len) : returns a string which consists of len characters from the original string starting at first character, (e,g, strmid(“Hello”, 1, 3) returns “ell”)
Return: return a substring

strleft(string str, int len) : returns the len leftmost characters from the string,
Return: return a substring

strright(string str, int len) : returns the len rightmost characters from the string,
Return: return a substring

strupr(string str) : returns the original string in all uppercase,
Return: return an uppercased string

strlwr(string str) : returns the original string in all lowercase,
Return: return an lowercased string

strrchr(string str,char ch) : Scan a string for the last occurrence of a character,
Return: return -1 if not found, otherwise char index value in the string

strchr(string,char) : Scan a string for the first occurrence of a character,
Return: return -1 if not found, otherwise char index value in the string

strspn(string src,string charset) : Find a substring in a string, Returns an integer value specifying the length of the initial segment of string that consists entirely of characters not in strCharSet,
Return: If string begins with a character that is in strCharSet, the function returns 0, No return value is reserved to indicate an error,

strrvrs(string) : reverse string order
Return: retuns the input string in reverse order

isalphanum(char ch) : routines returns true if c is a particular representation of an alphabetic or numeric character
Return: return nonzero means it is a alphabetic or numeric character, 0 means it is not,

isalpha(char ch) : routines returns true if c is a particular representation of an alphabetic character
Return: return nonzero means it is a alphabetic character, 0 means it is not,

strncmp(string1,string2,int count) : Compare characters of two strings at first count characters, string1, string2 Strings to compare, count Number of characters to compare,
Return: return 0 means equal, -1 means str1 less than str2, 1 means str1 greater than str2

hex(int ival) : convert an integer to a hex representations string
Return: return value in hex string

format(float fval, int precision) : format a float value to a string
Return: return a string

islower(char ch) : routines returns true if c is lower case
Return: return 0 means false, 1 means true

isupper(char ch) : routines returns true if c is upper case
Return: return 0 means false, 1 means true

Time

getmonth() : return current month number
Return: return current month number

getyear() : return current year number, ex: 1998
Return: return current year number, ex: 1998

ticks() : the number of clock ticks since last reset
Return: return the number of clock ticks since last reset

getsec() : return current second
Return: return current second

getmin() : return current minute
Return: return current minute

gethour() : return current hour
Return: return current hour

getday() : return current day
Return: return current day

Database

dbenum(int bFirst, int dbtype) : Enumerate all the databases.
Return: dbenum returns one database object id each time it is called. Once all of the databases are enumerated, dbenum returns 0. You will need the object id to find out more about the database.

dbname(int oid) : Find out database name base on its OID
Return: database name as a string

dbsize(int oid) : Find out database physical storage size in bytes.
Return: returns database physical storage size in bytes. If failed, returns 0

dbnrecs(int oid) : Find out database records count.
Return: return total records in the database. If failed, return 0

dbrecpropcnt() : Find out the number of properties in the current record.
Return: returns number of properties in the current record. If failed, return -1.

dbrecproptype(int index) : Each property has a type. CEVT_I2 A 16-bit signed integer. CEVT_I4 A 32-bit signed integer. CEVT_LPWSTR A null-terminated string. CEVT_UI2 A 16-bit unsigned integer. CEVT_UI4 A 32-bit unsigned integer.
Return: returns the property type by using its index

dbrecpropval(int index) : Find out property value by using its index
Return: possible return type is int and string for the property value

dbseek(int seektype, int dwValue) : seek the record depends on the seek type and seek value
Return: Returns record object id. If failed, return 0.

dbrecwrite(int rec_oid, int prop_type, int prop_id, void prop_value) : You can obtain the rec_oid by using dbrecnow(). If rec_oid is 0, a new record will be written.
Return: an integer which is record object id for the record you just wrote in.

dbrecread(int proptype, int propid) : Read one specific property from the database
Return: return the value for the property. You can cast the return valuet into the type of value you wanted.

dbrecdelprop(int recoid, int proptype, int propid) : Delete one property from the record.
Return: returns record id if successful. If function failed, return 0.

dbrecdel(int recoid) : Delete one record
Return: 1 indicates success. 0 indicates failure. The function could fail when you pass into a wrong or invalid record object id

dbrecnow() : Get current record object id. When you are iterating through the database, you can obtain the current record object id by call dbrecnow.
Return: 0 indicates failure. The function should return the record object id for the current reading/writing record

dbdelete(int dboid) : delete one database
Return: 1 indicates success. 0 indicates failure. The function could fail when you pass into a wrong or invalid database object id or another program is using the database at this moment.

dbcreate(string name, int dbtype) : Create a new database. For detail information check out detailed database documentation online
Return: if dbcreate is successful, it returns an integer. This integer is the object identifier for your database. It can be used to open the database you just created. see dbopen for detail.

dbopen(int oid, string name) : You can specify either object id or name to open the database. If you know the function name only, just use 0 for the object ID. If you know the function object ID only, just use an empty string "" for the database name parameter.
Return: If the database is opened, the return value is the object id of this database. Otherwise, the return value is 0.

dbclose() : Close database
Return: 1 means the database is closed. 0 means the function failed to close the database

Memory

free(pointer ptr) : releases the memory of the block pointed to by ptr which was previously allocated by malloc(). When the program exits, all blocks that are still allocated will automatically be freed to prevent memory leaks.
Return: None.

settype(pointer ptr, int size, char type) : set the memory block variable type. Use this function only on memory allocated by malloc().
Return: Returns 0 if an error occurred

typeof(pointer ptr) : find out the type of dynamic allocated variable's type
Return: 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)..
Return: None

malloc(int size) : Allocates a block of size values of type [int], but of undefined value.
Return: Returns a pointer to the block or 0 on failure.