The CScript scripting language provides a library of functions that enable you to interact with the operating system and includes utility functions to make developing scripts for the TinyTERM emulator easier. This document describes the commands available and how to use these built in functions.
The CScript Builtin Function Reference describes commands using the following format:
Category Name | Implementation | Code |
Time | 32-bit integer | t |
Integer | 32-bit | i |
String | 64k max length | s |
Floating point | IEEE 64-bit | f |
Boolean | 0/non-zero True/false | b |
Handle (Win32) | 32-bit | h |
Object | 32-bit | o |
Void | No parameter or return value | |
Variable Name | String | v |
Back to Top |
Back to Top |
Object CreateObject
CreateObject( sObjName, sObjClass, iExStyle, iStyle, iX, iY, iW, iH, sTitle, iID, oParentObject )
Creates an object based on a Win32 window class
Void DestroyObject
DestroyObject(oObj)
Deletes and deallocates an object
Integer RegisterFile
RegisterFile(sFile)
Registers an in-process COM server in DLL sFile. Returns 0 for success or -1 for failure
Void Dprintln
Dprintln(sArg0[[[,sArg1],sArg2],sArg3]...)
Prints to debug screen in debug mode
Back to Top |
Integer Copy
Copy(sSrcFile, sDestFile)
Copies one file to another. Returns 0 on success.
Integer Erase
Erase(sFile)
Erases file. Returns 0 on success.
Boolean Exists
Exists(sFileName)
Returns true if passed file exists
Void Fclose
Fclose(iFileID)
Closes a file opened with Fcreate or Fopen
String Fconcat
Fconcat(sPath,sFile,sExt)
Returns a full pathname from path, file and extension. Note: this function will automatically concatenate a "\" character to the end of sPath unless sPath ends with a "\" or contains a drive designation, such as "c:".
Boolean Fcreate
Fcreate(iFileID, sFile)
Creates a new file. Overwrites an existing file
Boolean Feof
Feof(iFileID)
Returns true if at end of file
String Fext
Fext(sPathFile)
Returns extension from passed file string
Integer Fflush
Fflush(iFilenum)
Flushes the data for the file associated with iFilenum. If the file is open for output, this will write the contents of the buffer for the file to disk. If the stream is open for input, this will clear the contents of the buffer. Returns 0 for completion, 1306 if the file number is not in the range of 1 through 20, and 1303 if an I/O error occurred during the flush operation.
String Fhead
Fhead(sNamePath)
Gets file head
Time Value FileDate
FileDate(sFileName)
Gets file date of filename as a time value
Integer FileMode
FileMode(sFileName)
Returns the mode settings for file sFileName. This is a 16-bit value returned from a stat call to the file. Possible values include:
Regular file | 0x8000 | (32768) |
Directory | 0x4000 | (16384) |
Character special | 0x2000 | (8192) |
Pipe | 0x1000 | (4096) |
Read permission | 0x0100 | (256) |
Write permission | 0x0080 | (128) |
Execute permission | 0x0040 | (64) |
Integer FileSize
FileSize(sFileName)
Gets the size in bytes of a file. If the file does not exist, a 0 will be returned.
Integer Fopen Fopen( iFileID, sFile, sMode ) Opens a file sFile, sets the file ID for that file to iFileID, and opens the file read/write mode according to sMode.
iMode | |
RA | Read only, ASCII mode |
RB | Read only, Binary mode |
WA | Write to new file, ASCII mode (overwrites an existing file) |
WB | Write to new file, Binary mode (overwrites an existing file) |
UA | Append to an existing file, ASCII mode |
UB | Append to an existing file, Binary mode |
Note that opening a text file with Unix-style line breaks in ASCII mode can lead to some unexpected behavior, including ftell() returning negative values and fseek() not moving the file pointer predictably. Use Binary mode for files with Unix-style line breaks.
String Fname
Fname(sNamePath)
Returns stripped filename only from passed full pathname
String Fpath
String Fread
String Freadln
Integer Fseek
Fseek(iFileID, iOffset, iOrigin)
Moves file pointer for file iFileID to location iOffset from the location set by iOrigin.
iOrigin | |
0 | Beginning of file |
1 | Current position |
2 | End of file |
Integer Ftell
Ftell(iFileID )
Gets the current position of the file pointer in the file refered to by iFileID.
Integer Fwrite
Fwrite( iFileID, sText, iByte )
Writes sText to file associated with iFileID, with iBytes maximum number of bytes written. If iBytes is negative, Fwrite writes the all of sText. Returns 0 for success, 1 if the file is not open, and 1300 for an I/O error writing to the file.
Integer Fwriteln
Fwriteln( iFileID, sText, iByte )
As Fwrite, but adds a carriage return/line feed pair to the end sText when writing.
String GetCommandLine
GetCommandLine( )
Gets the command line, including all parameters, used to launch this session of the TinyTERM emulator.
String GetPath
GetPath(sFile,sType)
Gets the path of a file. sType can be "U" (user), "S" (system) or both. The first listed has precedence
VoidM IniDeleteSection
IniDeleteSection( sFile, sSection )
Deletes a section from an .ini file
Void IniDelStr
IniDelStr(sSection,sKeyName)
Deletes a key from an ini-format file
String IniEnumSections
IniEnumSections(sFile1,sMatch )
Returns a "|" delimited list of all sections in the .ini file that match the pattern. (Note that the returned strings in the list have the matched suffixes removed.)
String IniGetStr
IniGetStr(sSection,sKeyName,sDefault)
Gets data from an ini-format file. Returns default if key does not exist
String IniListKeys
IniListKeys(sFile,sSection)
List keys defined in an ini-format file
Void IniMerge
IniMerge(sSect,sFile,sSect2,sFile2)
Merges sSect from file sFile into sSect2 in sFile2.
Void IniReplaceKeys
IniReplaceKeys(sFile,sSection,sList)
Replaces keys in an ini-format file
Void IniSetFile
IniSetFile(sFile)
Sets default filename for most IniXXX functions
Void IniSetStr
IniSetStr(sSec,sName,sStr)
Writes sName with sStr in section sSec
Void IniSync
IniSync(sFile,iSize)
Flushes file buffer. The iSize argument sets the size of the RAM buffer.
iSize | |
-1 | Standard buffer size (8k) |
0 | Normal sync |
0 | New buffer size in kilobytes. (Maximum value 63.) |
Boolean IsDir
IsDir(sPath)
Returns true if path specified is a directory.
Integer LogFile
LogFile(sFile)
Opens a log file. Returns 0 on success or 1 on failure. Only one log file may be open at a time.
IntegerLogFile_Close
LogFile_Close()
Closes the current log file. Returns 0 on success or 1304 on failure.
Integer Mkdir
Mkdir(sDirName)
Creates new directory sDirName in the current directory. Returns 0 on success and an error code on failure.
String MkTempNam
MkTempNam(iFhead,iFext)
Returns a name for a temporary file
filename = mktempname("temp","tpx"); | // creates file name similar to // "temp037e9085412.tmp" |
Void Spawn
Spawn( iWait, sCmdString, sArguments )
Passes sCmdString to the operating system to be run with the arguments sArguments. Note that the command name, without an extension, must always be the first argument in sArguments. Note that you cannot use quotes as part of sCmdString or sArguments, so if you must launch an application with a space in its Windows filename, you must use DOS 8.3 filenames to refer to that application with the spawn command.
iWait | |
0 | Wait until spawned process ends before running next command |
1 | No wait |
2 | Detach spawned process from the console |
3 | Wait for spawned process to complete its startup procedures before continuing with the next command |
String StdDirectory
StdDirectory(sStartDir,sCaption)
Shows standard file open dialog for directories. Returns the full path to the directory chosen.
String StdFont
StdFont()
Shows a standard font selection dialog. Returns a comma-delimited string of the font chosen, a zero, and the selected point size.
String StdOpenButton
StdOpenButton( sDir, sMask, sExten, sCaption, sButton, iType)
Opens a Windows standard file browser with an additional button titled sButton. The browser dialog box will show an Open or Save button based on the iType.
iType | |
0 | Open dialog box |
1 | Save dialog box |
String StdPreview
StdPreview( sDir, sTitle )
Runs StdOpen and also displays previews of graphics files
Handle StdPrint
StdPrint()
Shows a print setup dialog. The return value is a display context handle.
String StdSave
StdSave( sPath, sDesc, sExt, sTitle )
Opens a Windows save browser. Returns the path and filename the user selected, or an empty string if the user chooses Cancel.
String Uniq
Uniq(sFile)
Tests whether a file can be created. Returns the file name if the file can be created, or a zero-length string if it cannot.
Void WriteLog
WriteLog(sMsg)
Writes text to the log file
Back to Top |
Boolean AddResFile
AddResFile(sFileName)
Adds a resource file to the internal list of files searched for resource data
Handle CreateForm
CreateForm( iFormNum, oParentObject, iDefPage )
Finds DIALOG or CENTABDLG resource from resource list and creates a modeless dialog whose parent is oParentObject. If the form is a tabbed dialog and iDefPage is nonzero, that page is selected. Returns zero on error.
Void EnableToolTips
EnableToolTips(bBool)
Enables or disables tooltips
Object GetObject
GetObject(sObjectName)
Gets the object of string
Object GetObjectFromHWND
GetObjectFromHWND(hWnd)
Returns an object from window handle
Handle GetObjectHWND
GetObjectHWND(oObject)
Gets hwnd from an object
Integer GetObjectID
GetObjectID(oObject)
Gets object ID for oObject
String GetObjectName
GetObjectName(oObject)
Gets the name of object oObject
Integer LoadFile
LoadFile(sFile,iFlag)
Loads a *.int file. Returns 0 if the file cannot be found. If iFlag is set to 2, the outer block of the loaded file will be executed.
String LoadString
LoadString(iID,iLanguage)
Gets a string resource from resource list.
Integer ModalForm
ModalForm(iFormNum,oParentObj,iDefPage)
Reads DIALOG or CENTABDLG resource and runs modal dialog.
Void ObjRegisterFormTooltips
ObjRegisterFormTooltips(hWnd)
Re-registers a form's tooltips. Normally this occurs automatically
Object ResLoadMenu
ResLoadMenu(sStr)
Finds menu resource from resource list and creates a Win32 menu handle.
Void sl_FormExit
sl_FormExit( sObjName, iExitCode )
Causes a return from ModalForm with iExitCode as the return value.
Back to Top |
Void _Abort
_abort()
Abort script language execution
Integer _Asc
_Asc(sStr)
Returns ASCII value of the first character of sStr
String _Chr
_Chr(iAsciiVal)
Converts integer ASCII value to single character string
String _HexStr
_HexStr(iInteger)
Converts integer value to hexadecimal string
Boolean _IsIn
_IsIn(sString, iAsciiValue)
Returns true if the character identified by iAsciiValue is in sString
Boolean _IsSpace
_IsSpace(iAsciiValue)
Returns true if the character identified by iAsciiValue is a space, tab, carriage return or newline
Integer _SizeOf
_SizeOf(sStr)
Returns length of string
String _Str
_Str(iVal)
Returns string from numeric value iVal
Integer _StrnCmp
_StrnCmp(sString1,iOffset1,sString2,iOffset2,iLen)
Compares sString1, starting at iOffset1, with sString2, beginning at iOffset2, for iLen characters. Returns -1 if sString1 is lesser, 1 if it’s greater, or 0 if they’re equal.
Integer _StrnCmpi
_StrnCmpi(sString1,iOffset1,sString2,iOffset2,iLen)
As _StrnCmp, but ignores case.
Void _ToLower
_ToLower(sStr)
Converts sStr to lower case
String _ToLowerC
_ToLowerC(sStr)
Returns string with all lower case
Void _ToUpper
_ToUpper(sStr)
Converts sStr to upper case
String _ToUpperC
_ToUpperC(sStr)
Returns string with all upper case
Integer _Val
_Val(sStr)
Returns integer from a string
Integer _VarType
_VarType(sVarName)
Returns the type for a named variable
Return | |
0 | Undefined variable |
1 | Integer, Boolean or uninitialized variable |
2 | String |
17 | Integer array |
18 | String array |
32 | System variable |
Time Value AtoD
AtoD(sDateTime)
Converts ASCII time string sDateTime to internal time value
String Cdate
Cdate(tTime)
Converts internal time value to ASCII date string
String Chname
Chname(iNum,iType)
Converts ASCII character value to string for display as mnemonic, control or dump
iType | ||
2 | Numeric hex values | 0d |
3 | Mnemonic ASCII values | <CR> |
4 | Control characters | ^M |
5 | Keystroke names | ENTER |
String Ctime
Ctime(tTime)
Returns clock time string from time value
String Decrypt
Decrypt(sString)
Decrypts an encrypted string
String Encrypt
Encrypt(sStr)
Encrypts a passed string
String Field
Field( sList, iPosNum, iSeparator )
Gets a string from a delineated list
String GetEnv
GetEnv(sLABEL)
Gets value of environmental variable
String GetSysDir
GetSysDir()
Returns directory TinyTERM is installed in
String GetUserDir
GetUserDir()
Returns user's TinyTERM local directory, if different from system install directory.
Void Help
Help(sTopic)
Runs Windows help system on topic sTopic. If sTopic is not found or is zero length, the main help window will open.
String Left
Left(sStr,iLen)
Returns leftmost iLen characters of string sStr.
Integer Main_Exit
Main_Exit(iRetVal)
Exit TinyTERM and return iRetVal. Must be followed by a Return statement.
String MidStr
MidStr(sStr,iPos,iLen)
Returns string starting at iPos of length iLen.
Integer Opsys2
Opsys2()
Returns an integer that identifies the operating system
Integer Pos
Pos(sStr1,sStr2,iStart)
Returns position of string 1 within string 2, beginning at character number iStart. You must set iStart to 1 or higher; values less than 1 will always return 0.
Integer Quit
Quit(iExitCode)
Exits TinyTERM application. Note that in this version of CScript, you must follow quit commands with a return command.
String Right
Right(sStr,iLen)
Returns the rightmost iLen characters of sStr
Integer RmDir
RmDir(sPath)
Removes directory sPath. Returns 0 for success, 1 if sPath contains wildcard characters, or 1279 for failure.
Void SetUserDir
SetUserDir(sPath)
Sets user search directory
VoidSleep
Sleep(nMilliseconds)
Pauses for nMilliseconds.
String StrConv
StrConv( sStr, iType )
Converts raw ASCII strings to strings with caret-prefixed control characters and hexidecimal character codes for doublequotes ("\x22"), quotes("\x27"), and dollar signs ("\x24"). Will also convert converted string back to raw ASCII.
iType | |
0 | Convert strings with converted characters to ASCII |
1 | Convert control characters to caret-prefixed characters |
2 | Convert control characters to caret-prefixed characters and convert double quotes, quotes, and dollar signs to hexidecimal sequences |
String StrHex
StrHex(iInt,iLen)
Gets hex number of length iLen from integer iInt
Integer Sum
Sum( sString, iType, iStartVal )
Calculates integer checksum of string starting with iStartValu as the beginning checksum value.
iType | |
0 | Adds all characters together |
1 | Xors all characters together |
2 | Returns the CRC checksum of the string |
Integer Time
Time()
Returns current time as an internal time value. This is the number of seconds since 01/01/1970.00:00:00 GMT.
String Trim
Trim(sStr)
Returns string without trailing spaces
Back to Top |
Void CheckMenuItem
CheckMenuItem( hMenu, iItemID, iFlag )
Calls Win32 CheckMenuItem to check or uncheck a menu item.
iFlag | |
0 | Uncheck menu item iItemID |
8 | Check menu item iItemID |
1024 | Uncheck the menu item at the zero-based relative position iItemID |
1032 | Check the menu item at the zero-based relative position iItemID |
Void ContextHelp
ContextHelp(hWnd)
Sends an SC_CONTEXTHELP message to the window associated with the object. This will change the mouse cursor to a question mark with a pointer. Clicking on a control after this should open a contextual help window.
Void DeleteMenuBarItem
DeleteMenuBarItem(hMenu,iItem,iFlag)
Deletes item number iItem from menu hMenu. If iFlag is set to 0, then iItem is the actual menu item number. If iFlag is non-zero, iItem is the zero-based position of the item in the menu.
Void DestroyMenu
DestroyMenu(hMenu)
Calls Win32 DestroyMenu function. Used to destroy menu loaded with ResLoadMenu
Void DrawMenuBar
DrawMenuBar(hWnd)
Draws the Menu Bar
Void EnableMenuItem
EnableMenuItem(hMenu,iItem,iTag)
Calls Win32 EnableMenuItem function
Void EnableWindow
EnableWindow(hWnd,iInt)
Calls Win32 EnableWindow function
Handle FindWindow
FindWindow( sClassName, sWindowName )
Retrieves a handle to the top-level window that matches the class name and window name specified.
String GetDeviceConfig
GetDeviceConfig(sDevice)
Gets configuration information for device sDevice
Object GetDlgItem
GetDlgItem(hWnd,iSessID)
Calls Win32 GetDlgItem function
Object GetFrameMenu
GetFrameMenu(hWnd)
Returns the frame object's menu handle.
Object GetSubMenu
GetSubMenu(hWnd,iInt)
Calls Win32 GetSubMenu function
Object GetSystemMenu
GetSystemMenu(hWnd,bBool)
Calls Win32 GetSystemMenu function
Integer GetSystemMetrics
GetSystemMetrics(iHW)
Calls Win32 GetSystemMetrics function.
String GetTapiNames
GetTapiNames()
Returns names of installed modems
Void InsertMenuItem
InsertMenuItem(hMenu,iInt1,iItemPos,iMenuItemNum,sLabel)
Calls Win32 InsertMenuItem function to add a single item to an existing menu
Void InsertMenuParent
InsertMenuParent(hMenu,iInt1,iMenuPos,iMenuNum,sLabel)
Calls Win32 InsertMenu function to add a menu to an existing menu bar
Void MoveWindow
MoveWindow( hWnd, iX, iY, iW, iH bRepaint )
Calls Win32 MoveWindow function.
iStatus | |
0 | Unchecks the menu item |
1 | Checks the menu item |
2 | Enables the menu item |
3 | Disables the menu item |
4 | Grays the menu item |
iType | |
0 | OK button |
1 | OK and Cancel buttons |
2 | Yes and No buttons |
3 | Yes, No and Cancel buttons |
Integer OpSys2
OpSys2()
Return operating system type
7 | Windows 95, Windows 98 or Windows Me |
15 | Windows 2000 or Windows XP |
71 | Windows NT 4.0 |
Void RemoveMenuItem
RemoveMenuItem(hMenu,iMenuItem,iInt)
Calls Win32 RemoveMenu to remove a menu item
Void SetDragMode
SetDragMode(hWnd)
Capture move and release
Integer SetErrorMethod
SetErrorMethod(iMethod)
Sets the method used to display error messages. Returns the previous setting.
iMethod | |
0 | Use message boxes |
1 | Write to Stderr |
2 | Do not display errors |
3 | Write to the debug monitor |
Boolean SetFocus
SetFocus(hWnd)
Calls Win32 SetFocus to set window focus to hWnd
Boolean SetForegroundWindow
SetForegroundWindow( hWnd )
Calls Win32 SetForegroundWindow to bring the window specified in hWnd to the foreground and made the active window.
Integer SetFrameHMENU
SetFrameHMENU(hWnd,iMenuID)
Attach a menu to a frame window. Returns the handle of the menu previously attached to the window.
Void SetFrameMenu
SetFrameMenu(hWnd,iMenuResourceID)
Attach a menu to a frame window. Returns the handle of the menu previously attached to the window.
Boolean SetHelpFile
SetHelpFile(sFileName)
Sets name of default help file.
Boolean SetHelpID
SetHelpID(hWnd,iHelpID)
Associates a context help ID with a window
Void ShowWindow
ShowWindow(hWnd,iCmdShow)
Calls Win32 ShowWindow function
Void TrackPopupMenu
TrackPopupMenu(hMenu,bBool,iHPos,iVPos,hWnd)
Calls Win32 TrackPopupMenu function
Back to Top |
Void AppRedraw
AppRedraw()
Redraws application user interface.
Boolean CompileFile
CompileFile(sFilename)
Loads and executes a CScript file. Returns true if the file ran successfully.
Integer CompileString
CompileString(sCommand)
Executes a CScript command string. Returns 1 if the command had no errors or -1 if there were errors.
String ConfigureDevice
ConfigureDevice(iIndex,sDeviceName,hWnd)
Gets modem configuration.
String CSLdebug
CSLdebug(sArg)
Returns CScript debugging information based on argument sArg.
sArg | |
? | List all other arguments |
q | Quit and exit |
g | Go |
t [n] | Trace n steps |
l fname | Load file fname |
d | Dump symbol dictionary |
d sym | Dump symbol sym. Can be wildcarded. |
d n cnt | Dump stack value n |
bp | List break points |
bp sym | Set break point on symbol sym |
bd sym | Delete break point on symbol sym |
bd * | Delete all break points |
st | Stack trace |
r | Register dump |
u sym | Unassemble code for symbol sym |
. | Display current instruction (not enabled) |
String GenerateURL
GenerateURL( sSystem, sUsername, sPassword, sStr, iInt, iInt2, iInt3 )
Generates URL using operator entries.
String GetCountryList
GetCountryList()
Gets countries supported by modem location list
String GetDefaultBrowser
GetDefaultBrowser()
Gets default browser name and path
String GetDefaultBrowserAppName
GetDefaultBrowserAppName()
Gets only default browser filename
String GetLocationList
GetLocationList()
Gets locations supported by modem
Integer GetPropInt
GetPropInt(oObject,sPropertyName)
Returns the integer value of property sPropertyName associated with object oObject. Returns 0 if the object or property cannot be found.
String GetPropStr
GetPropStr(oObject,sPropertyName)
Returns the string value of property sPropertyName associated with object oObject. Returns a zero-length string if the object or property is not found.
Boolean IsDebugMode
IsDebugMode()
Returns true if "-debug" is set in command line.
Integer IsSess
IsSess(oSession)
Returns session number for object oSession
Void KeyLoad
Keyload(sKeyFile,sSection,iFlag)
Loads keyboard definition sSection from keyboard file sKeyFile. iFlag is not used.
Integer KeySave
KeySave(sKeyFile,sSection)
Saves the current keyboard mappings to sSection of sKeyFile. Returns 0 on success or -1 on failure.
Void Menu_Draw
MenuDraw()
Redraws the Menu Bar if enabled
Integer PerformLicenseCheck
PerformLicenseCheck(sProdCode,iBitmask,iVersion,bErrMsg)
Tests whether a Century product is licensed. The version is always 1024 for TinyTERM version 4. If bErrMsg is set, a message window will pop up if there are any errors. The valid product codes for TinyTERM 4.20 and 4.21 are:
sProdCode | |
EV3 | TinyTERM Emulator |
PL3 | TinyTERM Plus Edition |
TC3 | TinyTERM Thin Client Edition |
WS3 | TinyTERM Web Server Edition |
iRetVal | |
0 | Invalid license |
1 | Valid license |
2 | Expiration reminder needed |
4 | Expired evaluation license |
8 | No license found |
Void Script_Login
Script_Login()
Callback function called after login completes. Note: when using any of the Script_ commands, you should avoid using dialog boxes if you will be running from within a browser.
Void Script_Logout
Script_Logout()
Callback function called before logout begins
Void Script_SessConnect
Script_SessConnect()
Callback function called after connecting to the host
Void Script_SessDiscon
Script_SessDiscon()
Callback function called before disconnecting from the host
Void Script_SessDown
Script_SessDown()
Callback function called before the session is closed
Void Script_SessUp
Script_SessUp()
Callback function called after the session is opened
Void Script_ShutDown
Script_ShutDown()
Callback function called before shutdown
Void Script_StartUp
Script_StartUp()
Callback function called after startup
Void SessDel
SessDel( oSession )
Deletes session with object oSession.
Void SessionNew
SessionNew(sTpxFile);
Starts a new session
Void Setkey_Reset
Setkey_Reset(iFlag)
Resets all keyboard macros. If iFlag is set to 0, all emulator keys will be reset as well.
Void StatusBar_Draw
StatusBar_Draw()
Redraws Status Bar if enabled
Void SwitchSess
SwitchSess(nSessNum,iSave)
Switches to session nSessNum. iSave is currently non-functional
Back to Top |
Void Break
Break;
Exit current command loop and continue script past its end.
Void Continue
Continue;
Restarts loop processing from the first command.
Void Do … While
Do { commands } While ( condition );
Execute commands until condition is met. The commands will always be executed at least once.
Void For
For (iVar; condition; operation) { commands }
Execute commands until condition is met.
Void Function
Function fname( variables ) { commands }
Creates a function named fname. If variables are named, they must be passed to the function.
Void If … Else
Void Var Var vName Initialize variable vName. Multiple variables may be initialized with one command.
Back to Top |
Void Goto
Goto LABEL
Continue script execution at LABEL. The label must be followed by a colon.
Void Switch … Case … Default
Switch (iValue) { Case … Default }
Executes one set of commands based on iValue.
Switch (time()%2) {
Case 0 :
te.DisplayNL(“Time is even.”);
break;
Case 1 :
te.DisplayNL(“Time is odd.”);
break;
Default :
te.DisplayNL(“Error in modulo operation.”);
}
Back to Top |
Void DDE_Enable
DDE_Enable(bOnOff)
Enables or disables the DDE server.
Void DDE_Name
DDE_Name(sName)
Sets the DDE server name.
Void DDE_TimeOut
DDE_TimeOut(iInterval)
Sets the DDE client/server timeout in milliseconds.
Back to Top |
Integer DDE_Advise
DDE_Advise(iChannel,sItem,sVar)
Requests an advise link on sItem from the DDE server application and stores the result in sVar. Returns 0 on success, 1 on failure, or 420 if iChannel is not open.
Void DDE_Close
DDE_Close(iChannel)
Closes a DDE channel.
Void DDE_CloseAll
DDE_CloseAll()
Closes all DDE channels.
Integer DDE_Execute
DDE_Execute(iChannel,sTransaction)
Executes a DDE transaction. Returns 0 for success, 1 for failure, or 420 if iChannel is not open.
Integer DDE_Init
DDE_Init(iChannel,sService,sTopic)
Opens a DDE channel. Returns 0 on success or 1 on failure.
Integer DDE_Poke
DDE_Poke(iChannel,sItem,sData)
Sends data to the DDE server. Returns 0 on success, 1 on failure or 420 if iChannel is not open.
Integer DDE_Request
DDE_Request(iChannel,sItem,sVar)
Requests data from the DDE server and stores it in sVar. Returns 0 on success, 1 on failure or 420 if iChannel is not open.
Integer DDE_Unadvise
DDE_Unadvise(iChannel,sItem)
Closes the advise link on sItem in a DDE conversation. Returns 0 for success, 1 for failure, or 420 if iChannel is not open.
Back to Top |