home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
suite.zip
/
pct.zip
/
addon.ext
next >
Wrap
Text File
|
1999-12-20
|
26KB
|
932 lines
@Prefab VpConstructs
%Open & center window
$parse value VpWindow(window,"GETSCREENSIZE")with x y
parse value VpWindow(window,"GETSIZE") with xsize ysize
x=(x-xsize)/2
y=(y-ysize)/2
CALL VpWindow window,"SETPOS", x, y, xsize, ysize
%Open folder (PSoft directory container)
$/* Place in "When double clicked" event for container */
valindex=VpGetItemValue(window,1101,index)
value=valindex||'\'
Do Forever
index=VpGetIndex(window,1101,'PARENT',index)
If index=0 Then Leave
valindex=VpGetItemValue(window,1101,index)
value=valindex||'\'||value
End
value=Strip(value,'T','\')
If value<>'' Then Do
rc=SysSetObjectData(value,'OPEN=DEFAULT;')
rc=SysSetObjectData(value,'OPEN=DEFAULT;')
End
@Work with files
%File open
$filename = VpFileDialog(window,'OPEN','*.*','Open File')
IF LENGTH(filename) > 0 THEN
DO
DO WHILE LINES(filename)
value=LINEIN(filename)
/* insert here to use value */
END
rc=stream(filename,'c','close')
END
%File save
$filename = VpFileDialog(window,'SAVE','*.*','Save As')
IF LENGTH(filename) > 0 THEN
DO
DO index = 1 to 10 by 1
/* insert here to load value */
rc=LINEOUT(filename,value)
END
rc=LINEOUT(filename) /*close*/
END
%Charin file to variable
$value = CHARIN(filename,1,CHARS(filename))
rc=stream(filename,'c','close')
%Picture open
$filename = VpFileDialog(window,'OPEN','*.*','Open Picture')
IF LENGTH(filename) > 0 THEN
DO
value = VpLoadPicture('FILE',filename)
/* insert here to use value */
END
%Load picture
$value = VpLoadPicture('FILE',filename)
%Load bitmap from BLOB
$value = VpLoadPicture('BLOB',value)
%Load file icon
$value = VpLoadPicture('FILEICON',filename)
%Load system icon
$/* valid index 1 - 22 */
value = VpLoadPicture('SYSICON',index)
%Load system bitmap
$/* valid index 1 - 48 */
value = VpLoadPicture('SYSBITMAP',index)
%Release graphic
$CALL VpFreePicture value
%Load resource icon
$value = VpLoadPicture('RESICON',index)
%Load resource bitmap
$value = VpLoadPicture('RESBMP',index)
@Message boxes
%Plain
$response=VpMessageBox(window,'title','message')
%OK/Cancel
$response=VpMessageBox(window,'title','message')
%Yes/No
$response=VpMessageBox(window,'title','message','YESNO')
%Yes/No/Cancel
$response=VpMessageBox(window,'title','message','YESNOCNCL')
%Retry/Cancel
$response=VpMessageBox(window,'title','message','RETRY')
%Ignore/Cancel
$response=VpMessageBox(window,'title','message','IGNORE')
@Window management
%Size/position window
$CALL VpWindow window,"SETPOS", x, y, xsize, ysize
%Get window size
$parse value VpWindow(window,"GETSIZE") with x y
%Get window position
$parse value VpWindow(window,"GETPOS") with x y
%Set window title
$CALL VpWindow window,"SETTITLE",value
%Close window
$CALL VpWindow window,"CLOSE"
%Show window
$CALL VpWindow window,"SHOW"
%Hide window
$CALL VpWindow window,"HIDE"
%Make window active
$CALL VpWindow window,"ACTIVATE"
%Minimize window
$CALL VpWindow window,"MINIMIZE"
%Maximze window
$CALL VpWindow window,"MAXIMIZE"
%Restore window
$CALL VpWindow window,"RESTORE"
%Get screen size
$parse value VpWindow(window,"GETSCREENSIZE")with x y
%Set window icon
$CALL VpWindow window, "SETICON", value
%Set form parent
$call VpWindow window, 'SETPARENT', parent
%Set form owner
$call VpWindow window, 'SETOWNER', owner
%Load resource string
$value=VpWindow(window, 'LOADSTRING', id)
%Set window icon
$call VpWindow window, 'SETICON', iconhandle
%Set RGB forecolor
$call VpWindow window, 'FORECOLORRGB', rgbvalue
%Set RGB backcolor
$call VpWindow window, 'BACKCOLORRGB', rgbvalue
%Set forecolor
$call VpWindow window, 'FORECOLOR', colorname
%Set backcolor
$call VpWindow window, 'BACKCOLOR', colorname
%Get RGB forecolor
$rc=VpWindow(window, 'GETFORECOLORRGB')
%Get RGB backcolor
$rc=VpWindow(window, 'GETBACKCOLORRGB')
%Set font
$call VpWindow window, 'FONT', '10.Helv'
%Get font
$rc=VpWindow(window, 'GETFONT')
%Set pointer position
$call VpWindow window, 'SETPOINTERPOS', x, y
%Get pointer position
$xy=VpWindow(window, 'GETPOINTERPOS')
%Set information line text
$CALL VpWindow window, "SETINFOLINE", value
@VpControls
%Get PM StyleWord
$value=VpItem(window, 1000, 'GETSTYLEWORD')
%Set PM StyleWord
$CALL VpItem window, 1000, 'SETSTYLEWORD', value
%MLE-Cut selected text to clipboard
$CALL VpItem window,ITEMID,'SENDMSG','0x01d8'
%MLE-Copy selected text to clipboard
$CALL VpItem window,ITEMID,'SENDMSG','0x01d9'
%MLE-Paste text from clipboard
$CALL VpItem window,ITEMID,'SENDMSG','0x01da'
%MLE-Delete selected
$CALL VpItem window,ITEMID,'SENDMSG','0x01db'
%MLE-Set word wrap on
$CALL VpItem window,ITEMID,'SENDMSG','0x01b4','1','0'
%MLE-Set word wrap off
$CALL VpItem window,ITEMID,'SENDMSG','0x01b4','0','0'
%MLE-Set read only on
$CALL VpItem window,ITEMID,'SENDMSG','0x01b8','1','0'
%MLE-Set read only off
$CALL VpItem window,ITEMID,'SENDMSG','0x01b8','0','0'
%CB-Show listbox
$CALL VpItem window,ITEMID,'SENDMSG','0x0170','1','0'
%CB-Hide listbox
$CALL VpItem window,ITEMID,'SENDMSG','0x0170','0','0'
%CB-Is listbox showing
$flag=VpItem(window,ITEMID,'SENDMSG','0x0172','0','0')
%EF-Cut text to clipboard
$CALL VpItem window,ITEMID,'SENDMSG','0x0144'
%EF-Copy text to clipboard
$CALL VpItem window,ITEMID,'SENDMSG','0x0145'
%EF-Delete selected
$CALL VpItem window,ITEMID,'SENDMSG','0x0146'
%EF-Paste from clipboard
$CALL VpItem window,ITEMID,'SENDMSG','0x0147'
%EF-Set insert mode on
$CALL VpItem window,ITEMID,'SENDMSG','0x014c','1','0'
%EF-Set insert mode off
$CALL VpItem window,ITEMID,'SENDMSG','0x014c','0','0'
%EF-Align center
$rc=VpItem(window,ITEMID,'SETSTYLEBIT',0,1)
%EF-Align left
$rc=VpItem(window,ITEMID,'SETSTYLEBIT',0,0)
%EF-Align right
$rc=VpItem(window,ITEMID,'SETSTYLEBIT',1,1)
%EF-Set read only off
$rc=VpItem(window,ITEMID,'SETSTYLEBIT', 5, 0)
%EF-Set read only on
$rc=VpItem(window,ITEMID,'SETSTYLEBIT', 5, 1)
%CHBx-Set 3-state style on
$rc=VpItem(window,ITEMID,'SETSTYLEBIT',2,1)
%CHBx-Set 3-state style off
$rc=VpItem(window,ITEMID,'SETSTYLEBIT',2,0)
%Set clip siblings off
$rc=VpItem(window,ITEMID,'SETSTYLEBIT',28,0)
%Set clip siblings on
$rc=VpItem(window,ITEMID,'SETSTYLEBIT',28,1)
@Miscellaneous
%Get date
$value = DATE()
%Get time
$value = TIME()
%Beep
$/* 1000 Hz for 200 millisec */
CALL VpBeep 1000,200
%Set form drag info
$/* max num items, type, rendering, moveok, copyok, linkok, default */
CALL VpWindow window,"SETFORMDRAGINFO",1,"Plain Text","<DRM_OS2FILE,DRF_TEXT>",1,1,1,"MOVE"
%Start drag
$draginfo.0=1 /* count */
draginfo.1=1 /* moveable */
draginfo.2=1 /* copyable */
draginfo.3=1 /* linkable */
draginfo.4=0 /* optional icon */
draginfo.1.1="Plain Text" /* type */
draginfo.1.2="<DRM_OS2FILE,DRF_TEXT>" /* rendering */
draginfo.1.3="c:\" /* source dir */
draginfo.1.4=filename /* source */
draginfo.1.5=filename /* target */
CALL VpWindow window,"DRAGSTART","DRAGINFO."
%Set pointer
$CALL VpWindow window,"SETPOINTER",value
%Start timer
$/* duration in 1/1000 secs */
CALL VpWindow window,"STARTTIMER",duration
%Stop timer
$CALL VpWindow window,"STOPTIMER"
%Set clipboard
$CALL VpWindow window,"SETCLIPBOARD","TEXT",value
%Get clipboard
$value=VpWindow(window,"GETCLIPBOARD","TEXT")
%Delete range in MLE
$rc=VpItem(window,1000,'SENDMSG','0x01c6',first,last)
%Get mouse position in MLE
$parse value vpitem(window,1000,'MOUSEPOS') with x y
%Mouse button 1 up
$/* Mouse button 1 up */
rc=VpItem(window,1000,'SENDMSG','0x0072',x,y,'0','0')
%Mouse button 1 down
$/* Mouse button 1 down */
rc=VpItem(window,1000,'SENDMSG','0x0071',x, y,'0','0')
@Threads
%Start thread
$tid=VpThread('START',window, filename, arg1, arg2)
%Kill thread
$rc=VpThread('KILL', tid)
%Suspend a thread
$rc=VpThread('SUSPEND', tid)
%Resuming a thread
$rc=VpThread('RESUME', tid)
%Get process identifier
$pid=VpThread('GETPID')
%Get thread identifier
$tid=VpThread('GETTID')
%Change thread priority
$rc=VpThread('SETPRIORITY', priority, tid)
%Get thread list
$rc=VpThread('GETIDLIST', 'threadlst.')
%Pause thread execution
$rc=VpThread('SLEEP', time)
@Application variables
%Set variable
$CALL VpAppVariable 'SET', variable, value
%Get variable
$value=VpAppVariable('GET', variable)
@Semaphores
%Create MUTEX
$semid=VpSemaphore('MUTEX', 'CREATE', semname, initstate)
%Open MUTEX
$semid=VpSemaphore('MUTEX', 'OPEN', semname)
%Request access MUTEX
$rc=VpSemaphore('MUTEX', 'WAITREQUEST', semid, timeout)
%Release access MUTEX
$rc=VpSemaphore('MUTEX', 'POSTRELEASE', semid)
%Query MUTEX
$value=VpSemaphore('MUTEX', 'QUERY', semid, 'OWNER.')
%Close MUTEX
$rc=VpSemaphore('MUTEX', 'CLOSE', semid)
%Create event
$semid=VpSemaphore('EVENT', 'CREATE', semname, initstate)
%Open event
$semid=VpSemaphore('EVENT', 'OPEN', semname)
%Wat for event
$rc=VpSemaphore('EVENT', 'WAITREQUEST', semid, timeout)
%Post event
$rc=VpSemaphore('EVENT', 'POSTRELEASE', semid)
%Reset event
$rc=VpSemaphore('EVENT', 'RESET', semid)
%Query event
$value=VpSemaphore('EVENT', 'QUERY', semid)
%Close event
$rc=VpSemaphore('EVENT', 'CLOSE', semid)
%Load VpSemaphore
$Call RxFuncAdd 'VpSemaphore','VPUtil','VpSemaphore'
%Drop VpSemaphore
$Call RxFuncDrop 'VpSemaphore'
@VpPrint & VpFont
%Print List
$CALL VpPrint window, "title", "subtitle", "Page %d", "LIST","10.Helvetica"
%Print Array
$/*****************************
data.index.1 = '1st row of data'
data.index.2 = '2nd row of data'
data.index.3 = '3rd row of data'
data.0=index /* # of rows of data */
data.1 = 3 /* columns */
data.0.1 = '' /* Column 1 title */
data.0.2 = '' /* Column 2 title */
data.0.3 = '' /* Column 3 title */
data.colwidth.1 = 1 /* Column 1 width */
data.colwidth.2 = 4 /* Column 2 width */
data.colwidth.3 = 1 /* Column 3 width */
data.colalign.1 = 'LEFT' /* Column 1 alignment */
data.colalign.2 = 'LEFT' /* Column 2 alignment */
data.colalign.3 = 'RIGHT' /* Column 3 alignment */
CALL VpPrint window, "title", "subtitle", "Page %d", "ARRAY","10.Helvetica","data."
******************************/
%Print Form
$CALL VpPrint window, "title", "subtitle", "Page %d", "FORM","10.Helvetica"
%Font Dialog
$value=VpFontDialog(window, "10.Courier")
%Load Print/Font Dialog
$Call RxFuncAdd 'VpPrint','VPUtil','VpPrint'
Call RxFuncAdd 'VpFontDialog','VPUtil','VPFontDialog'
%Drop Print/Font Dialog
$Call RxFuncDrop 'VpPrint'
Call RxFuncDrop 'VpFontDialog'
%Load VpUtil
$Call RxFuncAdd 'VpUtilLoadFuncs','VPUtil','VpUtilLoadFuncs'
Call VpUtilLoadFuncs
%Drop VpUtil
$Call RxFuncDrop 'VpUtilLoadFuncs'
@VpSharedMemory
%Access
$memhandle=VpSharedMemory("GETSHARED",name)
%Allocate
$memhandle=VpSharedMemory("ALLOC",name,size)
%Free
$CALL VpSharedMemory "FREE", memhandle
%Get contents
$value=VpSharedMemory("GET", memhandle)
%Set contents
$CALL VpSharedMemory "SET", memhandle, value
@WPS
%Open color pallette
$rc=SysSetObjectData('<WP_HIRESCLRPAL>','OPEN=DEFAULT;')
@Rexxutil
%Query & Load RexxUtil
$IF RxFuncQuery('SysDropFuncs')
THEN DO
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
END
%Load RexxUtil
$/* Load RexxUtil.DLL */
CALL RxFuncAdd 'SysLoadFuncs','Rexxutil','SysLoadFuncs'
CALL SysLoadFuncs
%Query RexxUtil
$rc = RxFuncQuery('SysloadFuncs') /* rc is 0 if SysLoadFuncs is not loaded */
%Drop RexxUtil
$CALL SysDropFuncs
%RxMessageBox
$value = RxMessageBox(text,title,bottom,symbol)
@System Information
%Get Boot drive
$/* Gets boot_drive, letter only */
boot_drive = left(value('runworkplace',,'os2environment'),1)
%Get Boot drive(2nd version)
$/* Gets boot_drive, letter and colon */
parse upper value VALUE( 'PATH',, 'OS2ENVIRONMENT' ) with ':\OS2\SYSTEM' -1 boot_drive +2
%Get Boot drive(3rd version)
$/* Gets boot_drive, letter and colon */
os2bootPath = SysSearchPath('PATH', 'os2boot')
if os2bootpath \= ''
then boot_Drive = filespec('drive', os2bootPath)
%Set BeginLibPath
$/* Set BeginLibPath */
set BeginLibPath value
%Set BeginLibPath (in VisPro)
$/* Set BeginLibPath */
'SET BEGINLIBPATH='strip(directory(),'T','\')||';'
%Environment variables
$/*================================
Possibilities - path dpath classpath prompt runworkplace temp tmp rxqueue beginlibpath endlibpath
comspec help bookshelf autostart autorefreshfolders DELDIR
Examples:
path=value('path', ,'OS2ENVIRONMENT')
dpath=value('dpath', ,'OS2ENVIRONMENT')
classpath=value('classpath', ,'OS2ENVIRONMENT')
=================================*/
%Get system and command processor
$parse source ThisSystem CommandProcessor ThisProgram
%Get Drive FreeSpace
$parse value SysDriveInfo(drive) with . FreeSpace . .
%Get Drive Type
$/* From Bernd Schemmers Tips and Tricks */
curFileSystem = "UNKNOWN"
"@chkdsk " testDrive || ": /dfdad 2>nul | rxqueue 2>NUL 1>&2"
do while queued() <> 0
curLine = lineIN( "QUEUE:" )
if abbrev(curLine, "Dateisystemtyp für den Datenträger ist:") | abbrev(curLine, "The type of file system for the disk is") then do
curFileSystem = word( curLine, words( curLine ) )
if right( curFileSystem,1 ) == "." then curFileSystem = dbrright(curFileSystem,1)
end
end
RETURN curFileSystem
@Rexx Constructs
%If-then-else
$IF value = 0 THEN
DO
END
ELSE
DO
END
%Iterative loop
$DO index = 1 to 100 by 1
END
%Do
$DO index = 1 to 100 by 1
END
%Do while loop
$DO WHILE value > 0
END
%Do until loop
$DO UNTIL value > 0
END
%Select when
$SELECT
WHEN value > 0
THEN
WHEN value = 0
THEN
WHEN value < 0
THEN
OTHERWISE
END
%Count
$do numeric_value
%Greater than
$>
%Less than
$<
%Equal
$= or ==
%Not equal
$<> or \=
%CrLf
$crlf=d2c(13)||d2c(10)
%And
$&
%Or
$|
%Not
$^ or \
%Procedure
$PROCEDURE EXPOSE Valuename /* Procedure must follow immediately after the label! */
%Signal
$SIGNAL labelname
%Signal off
$SIGNAL OFF ERROR
SIGNAL OFF FAILURE
SIGNAL OFF HALT
SIGNAL OFF NOVALUE
SIGNAL OFF SYNTAX
SIGNAL OFF NOTREADY
%Signal on
$SIGNAL ON ERROR NAME labelname
SIGNAL ON FAILURE NAME labelname
SIGNAL ON HALT NAME labelname
SIGNAL ON NOVALUE NAME labelname
SIGNAL ON SYNTAX NAME labelname
SIGNAL ON NOTREADY NAME labelname
@Sys - object functions
%SysCopyObject
$rc = SysCopyObject(source,destination)
%SysCreateObject
$rc = SysCreateObject('WPProgram', 'title', '<WP_DESKTOP>','EXENAME=filename;STARTUPDIR=dir;PROGTYPE=PM;', 'U')
%SysCreateShadow
$SysCreateShadow(Object, target)
%SysDeregisterObjectClass
$rc = SysDeregisterObjectClass(classname)
%SysDestroyObject
$rc = SysDestroyObject(objectname)
%SysMoveObject
$rc = SysMoveObject(source,destination)
%SysOpenObject
$rc = SysOpenObject(objectname, display, mark)
%SysQueryClassList
$CALL SysQueryClassList 'stem.'
%SysRegisterObjectClass
$rc = SysRegisterObjectClass(name,module)
%SysSaveObject
$SysSaveObject(name, dAsync)
%SysSetObjectData
$SysSetObjectData(name, config)
@Sys - file functions
%SysDriveInfo
$Info = SysDriveInfo(drive)
%SysDriveMap
$List = SysDriveMap(drive,options)
%SysFileDelete
$rc = SysFileDelete(filename)
%SysFileTree
$CALL SysFileTree filename,'List',option,attribute
%SysFileSearch
$CALL SysFileSearch search value,filename,'List',options
%SysGetMessage
$Message = SysGetMessage(number,filename)
%SysIni - query value
$value = SysIni('USER',app,key) /* 'USER' 'SYSTEM' or 'BOTH' */
%SysIni - query all apps
$rc = SysIni('USER','ALL:','List') /* 'USER' 'SYSTEM' or 'BOTH' */
%SysMkDir
$CALL SysMkDir directory
%SysRmDir
$CALL SysRmDir directory
%SysGetEA
$CALL SysGetEA filename, EAname, value
%SysPutEA
$CALL SysPutEA filename, EAname, value
%SysSearchPath
$rc = SysSearchPath(path, filename)
%SysSetIcon
$rc = SysSetIcon(filename,iconfile)
%SysTempFileName
$filename = SysTempFileName(template,filter)
@Sys - other functions
%SysCls
$CALL SysCls
%SysCurPos
$pos = SysCurPos(row,col)
%SysCurState
$CALL SysCurState 'ON' or 'OFF'
%SysGetKey
$key = SysGetKey('ECHO')
key = SysGetKey('NOECHO')
%SysOS2Ver
$Version = SysOS2Ver()
%SysSleep
$CALL SysSleep seconds
%SysTextScreenRead
$line = SysTextScreenRead(row,col,length)
%SysTextScreenSize
$rc = SysTextScreenSize()
%SysWaitNamedPipe
$SysWaitNamedPipe(name, [time_limit])
@File Info
%Charin file to variable
$/* Charin file to a variable */
value = CHARIN(filename,1,CHARS(filename))
rc=STREAM(filename,'c','close')
%Close file
$/* Close file */
CALL STREAM filename, 'C', 'CLOSE'
%Does file exist?
$/* Does file exist? */
value = (STREAM(filename, 'C', 'QUERY EXISTS') <> '')
%Get file extension
$/* Get extension even with multiple dots */
parse value Reverse(filename) with Extension '.' .
Extension = Reverse(Extension)
%Get file Name spec
$Value = FILESPEC('N',filename /* returns the filename */
%Get file Path spec
$Value = FILESPEC('P',filename) /* returns the path */
%Get file Drive spec
$Value = FILESPEC('D',filename) /* returns drive */
%Get file size
$/* Get file size in bytes */
value = STREAM(filename, 'C', 'QUERY SIZE')
%Get file date & time stamp
$/* Get file date & time stamp */
Parse Value STREAM(filename, 'C', 'QUERY DATETIME') With fdate ftime
Parse Var fdate mm '-' dd '-' 'yy'
Parse Var ftime hh ':' mm ':' ss
%Get file status
$/* Get file status */
value = STREAM(filename, 'S')
%Get file status with error code
$/* Get file status with error code */
value = STREAM(filename, 'D')
%More chars in the file?
$/* More characters in the file? */
value = CHARS(filename)
%More lines in the file?
$/* More lines in the file? */
value = LINES(filename)
%Open file for reading
$/* Open file for reading */
/* rc will hold 'READY' if successful */
rc = STREAM(filename, 'C', 'OPEN READ')
%Open file for reading & writing
$/* Open file for reading & writing */
/* rc will hold 'READY' if successful */
rc = STREAM(filename, 'C', 'OPEN')
%Open file for writing
$/* Open file for writing */
/* rc will hold 'READY' if successful */
rc = STREAM(filename, 'C', 'OPEN WRITE')
%Read a char from a file
$/* Read a character from the file */
value = CHARIN(filename)
%Read a line from a file
$/* Read a line from the file */
value = LINEIN(filename)
%Set read/write position in file backward from current position
$/* Set read/write position in file backward from current position */
Call STREAM filename, 'C', 'SEEK -'value
%Set read/write position in file forward from current position
$/* Set read/write position in file forward from current position */
Call STREAM filename, 'C', 'SEEK +'value
%Set read/write position in file from end of file
$/* Set read/write position in file from end of file */
Call STREAM filename, 'C', 'SEEK <'value
%Set read/write position in file from start of file
$/* Set read/write position in file from start of file */
Call STREAM filename, 'C', 'SEEK ='value
%Write a line to a file
$/* Write a line to the file */
CALL LINEOUT filename, value
%Write a string of chars to a file
$/* Write a string of characters to the file */
CALL CHAROUT filename, value
%Change file extension
$/* Change file extension to "txt" */
TextFile = left(filename,lastpos('.',filename))||'txt'
@I/O functions
%Address
$ADDRESS environment
%Charin
$Value = CHARIN(name,start,length)
%Charin file to variable
$/* Charin file to a variable */
value = CHARIN(filename,1,CHARS(filename))
rc=STREAM(filename,'c','close')
%Charout
$CALL CHAROUT filename,string
%Chars
$value = CHARS(filename)
%Directory
$Value = DIRECTORY() /* returns current directory */
CALL DIRECTORY directory /* switch to directory */
%Filespec
$Value = FILESPEC('D',filename) /* returns drive */
Value = FILESPEC('P',filename) /* returns the path */
Value = FILESPEC('N',filename /* returns the filename */
%Linein
$value = LINEIN(filename,line)
%Lineout
$CALL LINEOUT filename, string, line
%Lines
$value = LINES(filename)
@Parse
%Parse Arg
$PARSE ARG string
%Parse Linein
$parse [Upper] linein [template]
%Parse Pull
$PARSE PULL string
%Parse Source
$PARSE SOURCE string
%Parse Value
$PARSE VALUE function WITH template /* Parse Value TIME() with Std ':' Min ':' Sec */
%Parse Var
$PARSE VAR string first rest
%Parse Version
$PARSE VERSION REXXVERSION
@Stream
%Stream - Open
$CALL STREAM filename,'C','OPEN'
%Stream - Open Read
$CAll STREAM filename,'C','OPEN READ'
%Stream - Open Write
$CALL STREAM filename,'C','OPEN WRITE'
%Stream - Seek
$CALL STREAM filename,'C','SEEK number'
%Stream - Close
$CALL STREAM filename,'C','CLOSE'
%Stream - filename
$filename = STREAM(filename,'C','QUERY EXIST')
%Stream - size
$size = STREAM(filename,'C','QUERY SIZE')
%Stream - time/Date
$timeinfo = STREAM(filename,'C','QUERY DATETIME')
%Stream - description
$Value = STREAM(filename,'D')
%Stream - status
$Value = STREAM(filename,'S')
@Queue
%RxQueue - GET
$Queue = RxQueue('GET')
%RxQueue - Create
$Name = RxQueue('CREATE',name)
%RxQueue - Set
$rc = RxQueue('SET',name)
%RxQueue - Delete
$rc = RxQueue('DELETE',name)
%Queued
$value = QUEUED() /* returns the number of lines in queue */
%Queue
$QUEUE value /* append value to the end of the queue */
%Pull
$PULL value /* get 1. line of queue */
%Push
$PUSH value /* insert value at the beginning of the queue */
%Pipe output to RxQueue
$'@dir *.* 2>&1 | rxqueue'
"@chkdsk " testDrive || ": /dfdad 2>nul | rxqueue 2>NUL 1>&2"
@Strings
%B2X
$value = B2X(char)
%Center
$value = CENTER(string,length,fillchar)
%Chars
$value = CHARS(name)
%Compare
$value = COMPARE(string1,string2)
%Copies
$value = COPIES(string,number)
%C2D
$value = C2D(char)
%C2X
$value = C2X(char)
%Delstr
$value = DELSTR(string,start,length)
%Delword
$value = DELWORD(string,start,length)
%D2C
$value = D2C(number)
%D2X
$value = D2X(number)
%Insert
$value = INSERT(new,target,start)
%Lastpos
$value = LASTPOS(needle,haystack,start)
%Left
$value = LEFT(string,length,fillchar)
%Length
$value = LENGTH(string)
%Pos
$value = POS(needle,haystack,start)
%Overlay
$value = OVERLAY(new,target,start,length,fillchar)
%Reverse
$value = REVERSE(string)
%Right
$value = RIGHT(string,length,fillchar)
%Space
$value = SPACE(string,number,fillchar)
%Strip
$value = STRIP(string,option,fillchar)
%Substr
$value = SUBSTR(string,start,length)
%Subword
$value = SUBWORD(string,start,length)
%Translate
$value = TRANSLATE(string) /* convert string to uppercase */
/* replace a character within the string with an other character */
value = TRANSLATE(string,tableout,tablein,pad)
%Verify
$value = VERIFY(string1,string2)
%Word
$value = WORD(string,pos)
%Wordindex
$index = WORDINDEX(string,word)
%Wordlength
$value = WORDLENGTH(string,pos)
%Wordpos
$value = WORDPOS(needle,haystack,start)
%Words
$value = WORDS(string)
%X2B
$value = X2B(hex char)
%X2C
$value = X2C(hex char)
%X2D
$value = X2D(hex char)
%Xrange
$value = XRANGE(start,end)
@Math functions
%ABS
$value = ABS(number)
%Digits
$value = DIGITS()
%Format
$value = FORMAT(number,before,after)
%Form
$value = FORM()
%Fuzz
$value = FUZZ()
%Numeric Digits
$NUMERIC DIGITS value
%Numeric Form
$NUMERIC FORM 'SCIENTIFIC' /* or 'ENGINEERING' */
%Numeric Fuzz
$NUMERIC FUZZ value
%Max
$value = MAX(number1,number2,...,number20)
%Min
$value = MIN(number1,number2,....,number20)
%Random
$value = RANDOM(min,max)
%Sign
$value = SIGN(number)
%Trunc
$Value = TRUNC(number,n)
@Other functions
%Abbrev
$value = ABBREV(information,info,length)
%Beep
$CALL BEEP frequency,duration
%BitAnd
$bitand(string1, string2, fill)
%BitOr
$bitor(string1, string2, fill)
%BitXOr
$bitxor(string1, string2, fill)
%Condition
$rc = CONDITION('C') /* Condition Name */
rc = CONDITION('I') /* Condition Instruction */
rc = CONDITION('D') /* Condition Description */
rc = CONDITION('S') /* Condition Status */
%Datatype
$Type = DATATYPE(string)
%Date
$value = DATE() /* dd mm yyyy */
value = DATE('B') /* days since January 1, 0001 */
value = DATE('D') /* days since January 1, of the current year */
value = DATE('E') /* dd/mm/yy European format */
value = DATE('L') /* language-dependent format*/
value = DATE('M') /* name of the month */
value = DATE('N') /* dd mon yyyy */
value = DATE('O') /* yy/mm/ddt */
value = DATE('S') /* yyyymmdd */
value = DATE('U') /* mm/dd/yy */
value = DATE('W') /* day of week */
%Drop
$DROP value
%Errortext
$errortext(n)
%Endlocal
$endlocal()
%Setlocal
$setlocal()
%Sourceline
$line = SOURCELINE(line)
%Symbol
$status = SYMBOL(value)
%Time
$value = TIME() /* hh:mm:ss */
value = TIME('C') /* hh:mmxx */
value = TIME('E') /* Elapsed */
value = TIME('H') /* hh */
value = TIME('M') /* mmmm since midnight */
value = TIME('L') /* hh:mm:ss:uu0000 */
value = TIME('N') /* hh:mm:ss */
value = TIME('R') /* Reset elapsed */
%Trace
$trace(definition)
%value
$value = VALUE(name,newvalue,environment)
/* example */
path = VALUE('Path',,'OS2ENVIRONMENT')
@Screen colors (ANSI-Sequences)
%Standard
$CALL CHAROUT 'CON:',''
%Bright - foreground
$CALL CHAROUT 'CON:','
'
%Invers
$CALL CHAROUT 'CON:',''
%Invisible
$CALL CHAROUT 'CON:','
'
%Foreground black
$CALL CHAROUT 'CON:','
'
%Foreground red
$CALL CHAROUT 'CON:','
'
%Foreground white
$CALL CHAROUT 'CON:','
'
%Background black
$CALL CHAROUT 'CON:','
'
%Background red
$CALL CHAROUT 'CON:','
'
%Background white
$CALL CHAROUT 'CON:','
'
%Clear screen
$CALL CHAROUT 'CON:',''
%Delete line
$CALL CHAROUT 'CON:',''
%Coursor position
$CALL CHAROUT 'CON:','x;yH'
%Coursor up
$CALL CHAROUT 'CON:','yA'
%Coursor down
$CALL CHAROUT 'CON:','yB'
%Coursor to right
$CALL CHAROUT 'CON:','xC'
%Coursor to left
$CALL CHAROUT 'CON:','xD'
%Cursor position restore
$CALL CHAROUT 'CON:','u'
%ANSI on
$ADDRESS CMD 'ANSI ON'
%ANSI off
$ADDRESS CMD 'ANSI OFF'