home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / suite.zip / pct.zip / pctempl.ext < prev    next >
Text File  |  1999-12-20  |  18KB  |  695 lines

  1. @Prefab VpConstructs
  2. %Open & center window
  3. $parse value VpWindow(window,"GETSCREENSIZE") with x y
  4. parse value VpWindow(window,"GETSIZE") with xsize ysize
  5. x=(x-xsize)/2
  6. y=(y-ysize)/2
  7. CALL VpWindow window,"SETPOS", x, y, xsize, ysize
  8. @Work with files
  9. %File open
  10. $filename = VpFileDialog(window,'OPEN','*.*','Open File')
  11. IF LENGTH(filename) > 0 THEN
  12.    DO
  13.       DO WHILE LINES(filename)
  14.          value=LINEIN(filename)
  15.          /* insert here to use value */
  16.       END
  17.       rc=stream(filename,'c','close')
  18.    END
  19. %File save
  20. $filename = VpFileDialog(window,'SAVE','*.*','Save As')
  21. IF LENGTH(filename) > 0 THEN
  22.    DO
  23.       DO index = 1 to 10 by 1
  24.          /* insert here to load value */
  25.          rc=LINEOUT(filename,value)
  26.       END
  27.       rc=LINEOUT(filename) /*close*/
  28.    END
  29. %Picture open
  30. $filename = VpFileDialog(window,'OPEN','*.*','Open Picture')
  31. IF LENGTH(filename) > 0 THEN
  32.    DO
  33.      value = VpLoadPicture('FILE',filename)
  34.      /* insert here to use value */
  35.    END
  36. %Load picture
  37. $value = VpLoadPicture('FILE',filename)
  38. %Load bitmap from BLOB
  39. $value = VpLoadPicture('BLOB',value)
  40. %Load file icon
  41. $value = VpLoadPicture('FILEICON',filename)
  42. %Load system icon
  43. $/* valid index 1 - 22 */
  44. value = VpLoadPicture('SYSICON',index)
  45. %Load system bitmap
  46. $/* valid index 1 - 48 */
  47. value = VpLoadPicture('SYSBITMAP',index)
  48. %Release graphic
  49. $CALL VpFreePicture value
  50. %Load resource icon
  51. $value = VpLoadPicture('RESICON',index)
  52. %Load resource bitmap
  53. $value = VpLoadPicture('RESBMP',index)
  54.  
  55. @Message boxes
  56. %Plain
  57. $response=VpMessageBox(window,'title','message')
  58. %OK/Cancel
  59. $response=VpMessageBox(window,'title','message')
  60. %Yes/No
  61. $response=VpMessageBox(window,'title','message','YESNO')
  62. %Yes/No/Cancel
  63. $response=VpMessageBox(window,'title','message','YESNOCNCL')
  64. %Retry/Cancel
  65. $response=VpMessageBox(window,'title','message','RETRY')
  66. %Ignore/Cancel
  67. $response=VpMessageBox(window,'title','message','IGNORE')
  68.  
  69. @Rexx Constructs
  70. %If-THEN-else
  71. $IF value = 0 THEN
  72.    DO
  73.    END
  74. ELSE
  75.    DO
  76.    END
  77. %Iterative loop
  78. $DO index = 1 to 100 by 1
  79. END
  80. %Do while loop
  81. $DO WHILE value > 0
  82. END
  83. %Do until loop
  84. $DO UNTIL value > 0
  85. END
  86. %Select when
  87. $SELECT
  88.    WHEN value > 0
  89.       THEN
  90.    WHEN value = 0
  91.       THEN
  92.    WHEN value < 0
  93.       THEN
  94.    OTHERWISE
  95. END
  96. %Greater than
  97. $>
  98. %Less than
  99. $<
  100. %Equal
  101. $= or ==
  102. %Not equal
  103. $<> or \=
  104. %CrLf
  105. $crlf=d2c(13)||d2c(10)
  106. %And
  107. $&
  108. %Or
  109. $|
  110. %Not
  111. $^ or \
  112. %Procedure
  113. $PROCEDURE EXPOSE Valuename /* Procedure must follow imidiately after the label ! */
  114. %Signal
  115. $SIGNAL labelname
  116. %Signal off
  117. $SIGNAL OFF ERROR
  118. SIGNAL OFF FAILURE
  119. SIGNAL OFF HALT
  120. SIGNAL OFF NOVALUE
  121. SIGNAL OFF SYNTAX
  122. SIGNAL OFF NOTREADY
  123. %Signal on
  124. $SIGNAL ON ERROR NAME labelname
  125. SIGNAL ON FAILURE NAME labelname
  126. SIGNAL ON HALT NAME labelname
  127. SIGNAL ON NOVALUE NAME labelname
  128. SIGNAL ON SYNTAX NAME labelname
  129. SIGNAL ON NOTREADY NAME labelname
  130.  
  131. @Window management
  132. %Size/position window
  133. $CALL VpWindow window,"SETPOS", x, y, xsize, ysize
  134. %Get window size
  135. $parse value VpWindow(window,"GETSIZE") with x y
  136. %Get window position
  137. $parse value VpWindow(window,"GETPOS") with x y
  138. %Set window title
  139. $CALL VpWindow window,"SETTITLE",value
  140. %Close window
  141. $CALL VpWindow window,"CLOSE"
  142. %Show window
  143. $CALL VpWindow window,"SHOW"
  144. %Hide window
  145. $CALL VpWindow window,"HIDE"
  146. %Make window active
  147. $CALL VpWindow window,"ACTIVATE"
  148. %Minimize window
  149. $CALL VpWindow window,"MINIMIZE"
  150. %Maximze window
  151. $CALL VpWindow window,"MAXIMIZE"
  152. %Restore window
  153. $CALL VpWindow window,"RESTORE"
  154. %Get screen size
  155. $parse value VpWindow(window,"GETSCREENSIZE")with x y
  156. %Set window icon
  157. $CALL VpWindow window, "SETICON", value
  158. %Set form parent
  159. $call VpWindow window, 'SETPARENT', parent
  160. %Set form owner
  161. $call VpWindow window, 'SETOWNER', owner
  162. %Load resource string
  163. $value=VpWindow(window, 'LOADSTRING', id)
  164. %Set window icon
  165. $call VpWindow window, 'SETICON', iconhandle
  166. %Set RGB forecolor
  167. $call VpWindow window, 'FORECOLORRGB', rgbvalue
  168. %Set RGB backcolor
  169. $call VpWindow window, 'BACKCOLORRGB', rgbvalue
  170. %Set forecolor
  171. $call VpWindow window, 'FORECOLOR', colorname
  172. %Set backcolor
  173. $call VpWindow window, 'BACKCOLOR', colorname
  174. %Get RGB forecolor
  175. $rc=VpWindow(window, 'GETFORECOLORRGB')
  176. %Get RGB backcolor
  177. $rc=VpWindow(window, 'GETBACKCOLORRGB')
  178. %Set font
  179. $call VpWindow window, 'FONT', '10.Helv'
  180. %Get font
  181. $rc=VpWindow(window, 'GETFONT')
  182. %Set pointer position
  183. $call VpWindow window, 'SETPOINTERPOS', x, y
  184. %Get pointer position
  185. $xy=VpWindow(window, 'GETPOINTERPOS')
  186. %Set information line text
  187. $CALL VpWindow window, "SETINFOLINE", value
  188.  
  189. @Miscellaneous
  190. %Get date
  191. $value = DATE()
  192. %Get time
  193. $value = TIME()
  194. %Beep
  195. $/* 1000 Hz for 200 millisec */
  196. CALL VpBeep 1000,200
  197. %Set form drag info
  198. $/* max num items, type, rendering, moveok, copyok, linkok, default */
  199. CALL VpWindow window,"SETFORMDRAGINFO",1,"Plain Text","<DRM_OS2FILE,DRF_TEXT>",1,1,1,"MOVE"
  200. %Start drag
  201. $draginfo.0=1 /* count */
  202. draginfo.1=1 /* moveable */
  203. draginfo.2=1 /* copyable */
  204. draginfo.3=1 /* linkable */
  205. draginfo.4=0 /* optional icon */
  206. draginfo.1.1="Plain Text" /* type */
  207. draginfo.1.2="<DRM_OS2FILE,DRF_TEXT>" /* rendering */
  208. draginfo.1.3="c:\"    /* source dir */
  209. draginfo.1.4=filename /* source */
  210. draginfo.1.5=filename /* target */
  211. CALL VpWindow window,"DRAGSTART","DRAGINFO."
  212. %Set pointer
  213. $CALL VpWindow window,"SETPOINTER",value
  214. %Start timer
  215. $/* duration in 1/1000 secs */
  216. CALL VpWindow window,"STARTTIMER",duration
  217. %Stop timer
  218. $CALL VpWindow window,"STOPTIMER"
  219. %Set clipboard
  220. $CALL VpWindow window,"SETCLIPBOARD","TEXT",value
  221. %Get clipboard
  222. $value=VpWindow(window,"GETCLIPBOARD","TEXT")
  223.  
  224. @Threads
  225. %Start thread
  226. $tid=VpThread('START',window, filename, arg1, arg2)
  227. %Kill thread
  228. $rc=VpThread('KILL', tid)
  229. %Suspend a thread
  230. $rc=VpThread('SUSPEND', tid)
  231. %Resuming a thread
  232. $rc=VpThread('RESUME', tid)
  233. %Get process identifier
  234. $pid=VpThread('GETPID')
  235. %Get thread identifier
  236. $tid=VpThread('GETTID')
  237. %Change thread priority
  238. $rc=VpThread('SETPRIORITY', priority, tid)
  239. %Get thread list
  240. $rc=VpThread('GETIDLIST', 'threadlst.')
  241. %Pause thread execution
  242. $rc=VpThread('SLEEP', time)
  243.  
  244. @Application variables
  245. %Set variable
  246. $CALL VpAppVariable 'SET', variable, value
  247. %Get variable
  248. $value=VpAppVariable('GET', variable)
  249.  
  250. @Semaphores
  251. %Create MUTEX
  252. $semid=VpSemaphore('MUTEX', 'CREATE', semname, initstate)
  253. %Open MUTEX
  254. $semid=VpSemaphore('MUTEX', 'OPEN', semname)
  255. %Request access MUTEX
  256. $rc=VpSemaphore('MUTEX', 'WAITREQUEST', semid, timeout)
  257. %Release access MUTEX
  258. $rc=VpSemaphore('MUTEX', 'POSTRELEASE', semid)
  259. %Query MUTEX
  260. $value=VpSemaphore('MUTEX', 'QUERY', semid, 'OWNER.')
  261. %Close MUTEX
  262. $rc=VpSemaphore('MUTEX', 'CLOSE', semid)
  263. %Close event
  264. $semid=VpSemaphore('EVENT', 'CREATE', semname, initstate)
  265. %Open event
  266. $semid=VpSemaphore('EVENT', 'OPEN', semname)
  267. %Wat for event
  268. $rc=VpSemaphore('EVENT', 'WAITREQUEST', semid, timeout)
  269. %Post event
  270. $rc=VpSemaphore('EVENT', 'POSTRELEASE', semid)
  271. %Reset event
  272. $rc=VpSemaphore('EVENT', 'RESET', semid)
  273. %Query event
  274. $value=VpSemaphore('EVENT', 'QUERY', semid)
  275. %Close event
  276. $rc=VpSemaphore('EVENT', 'CLOSE', semid)
  277. %Load VpSemaphore
  278. $Call RxFuncAdd 'VpSemaphore','VPUtil','VpSemaphore'
  279. %Drop VpSemaphore
  280. $Call RxFuncDrop 'VpSemaphore'
  281.  
  282. @VpPrint & VpFont
  283. %Print List
  284. $CALL VpPrint window, "title", "subtitle", "Page %d", "LIST","10.Helvetica"
  285. %Print Array
  286. $CALL VpPrint window, "title", "subtitle", "Page %d", "ARRAY","10.Helvetica","DATA."
  287. %Print Form
  288. $CALL VpPrint window, "title", "subtitle", "Page %d", "FORM","10.Helvetica"
  289. %Font Dialog
  290. $value=VpFontDialog(window, "10.Courier")
  291. %Load Print/Font Dialog
  292. $Call RxFuncAdd 'VpPrint','VPUtil','VpPrint'
  293. Call RxFuncAdd 'VpFontDialog','VPUtil','VPFontDialog'
  294. %Drop Print/Font Dialog
  295. $Call RxFuncDrop 'VpPrint'
  296. Call RxFuncDrop 'VpFontDialog'
  297. %Load VpUtil
  298. $Call RxFuncAdd 'VpUtilLoadFuncs','VPUtil','VpUtilLoadFuncs'
  299. Call VpUtilLoadFuncs
  300. %Drop VpUtil
  301. $Call RxFuncDrop 'VpUtilLoadFuncs'
  302.  
  303. @VpSharedMemory
  304. %Access
  305. $memhandle=VpSharedMemory("GETSHARED",name)
  306. %Allocate
  307. $memhandle=VpSharedMemory("ALLOC",name,size)
  308. %Free
  309. $CALL VpSharedMemory "FREE", memhandle
  310. %Get contents
  311. $value=VpSharedMemory("GET", memhandle)
  312. %Set contents
  313. $CALL VpSharedMemory "SET", memhandle, value
  314.  
  315. @Rexxutil
  316. %Query & Load
  317. $IF RxFuncQuery('SysDropFuncs')
  318.   THEN DO;
  319.      call RxFuncAdd  'SysLoadFuncs',  'RexxUtil',  'SysLoadFuncs';
  320.      call SysLoadFuncs;
  321.   END;
  322. %Load RexxUtil
  323. $/* Load RexxUtil.DLL */
  324. CALL RxFuncAdd 'SysLoadFuncs','Rexxutil','SysLoadFuncs'
  325. CALL SysLoadFuncs
  326. %Query RexxUtil
  327. $rc = RxFuncQuery('SysloadFuncs') /* rc is 0 if  SysLoadFuncs is not loaded */
  328. %Drop RexxUtil
  329. $CALL SysDropFuncs
  330. %RxMessageBox
  331. $Action = RxMessageBox(text,title,bottom,symbol)
  332.  
  333. @System Information
  334. %Get Boot drive
  335. $/* Gets boot_drive, letter only */
  336. boot_drive = left(value('runworkplace',,'os2environment'),1)
  337. %Set BeginLibPath
  338. $/* Set BeginLibPath */
  339. set BeginLibPath value
  340.  
  341. @Sys - object functions
  342. %SysCopyObject
  343. $rc = SysCopyObject(source,destination)
  344. %SysCreateObject
  345. $rc = SysCreateObject('WPProgram', 'title', '<WP_DESKTOP>','EXENAME=filename;STARTUPDIR=dir;PROGTYPE=PM;', 'U')
  346. %SysDeregisterObjectClass
  347. $rc = SysDeregisterObjectClass(classname)
  348. %SysDestroyObject
  349. $rc = SysDestroyObject(objectname)
  350. %SysMoveObject
  351. $rc = SysMoveObject(source,destination)
  352. %SysOpenObject
  353. $rc = SysOpenObject(objectname, display, mark)
  354. %SysQueryClassList
  355. $CALL SysQueryClassList 'stem.'
  356. %SysRegisterObjectClass
  357. $rc = SysRegisterObjectClass(name,module)
  358.  
  359. @Sys - file functions
  360. %SysDriveInfo
  361. $Info = SysDriveInfo(drive)
  362. %SysDriveMap
  363. $List = SysDriveMap(drive,options)
  364. %SysFileTree
  365. $CALL SysFileTree filename,'List',option,attribute
  366. %SysFileSearch
  367. $CALL SysFileSearch search value,file,'List',options
  368. %SysGetMessage
  369. $Message = SysGetMessage(number,file)
  370. %SysIni - query value
  371. $value = SysIni(file,app,key)
  372. %SysIni - query all apps
  373. $rc = SysIni(file,'ALL:','List')
  374. %SysMkDir
  375. $CALL SysMkDir directory
  376. %SysPutEA
  377. $CALL SysPutEA file, EAname, value
  378. %SysRmDir
  379. $CALL SysRmDir directory
  380. %SysSetIcon
  381. $rc = SysSetIcon(file,iconfile)
  382. %SysTempFileName
  383. $file = SysTempFileName(template,filter)
  384.  
  385. @Sys - other functions
  386. %SysCls
  387. $CALL SysCls
  388. %SysCurPos
  389. $pos = SysCurPos(row,col)
  390. %SysCurState
  391. $CALL SysCurState 'ON' or 'OFF'
  392. %SysGetKey
  393. $key = SysGetKey('ECHO')
  394. key = SysGetKey('NOECHO')
  395. %SysOS2Ver
  396. $Version = SysOS2Ver()
  397. %SysSleep
  398. $CALL SysSleep seconds
  399. %SysTextScreenRead
  400. $line = SysTextScreenRead(row,col,length)
  401. %SysTextScreenSize
  402. $rc =SysTextScreenSize()
  403.  
  404. @File Info
  405. %Charin file to a variable
  406. $/* Charin file to a variable */
  407. value = CHARIN(filename,1,(CHARS(filename))
  408. rc=STREAM(filename,'c','close')
  409. %Close file
  410. $/* Close file */
  411. CALL STREAM filename, 'C', 'CLOSE'
  412. %Does file exist?
  413. $/* Does file exist? */
  414. value = (STREAM(filename, 'C', 'QUERY EXISTS') <> '')
  415. %Get file date & time stamp
  416. $/* Get file date & time stamp */
  417. Parse Value STREAM(filename, 'C', 'QUERY DATETIME') With fdate ftime
  418. Parse Var fdate mm '-' dd '-' 'yy'
  419. Parse Var ftime hh ':' mm ':' ss
  420. %Get file size in bytes
  421. $/* Get file size in bytes */
  422. value = STREAM(filename, 'C', 'QUERY SIZE')
  423. %Get file status
  424. $/* Get file status */
  425. value = STREAM(filename, 'S')
  426. %Get file status with error code
  427. $/* Get file status with error code */
  428. value = STREAM(filename, 'D')
  429. %More characters in the file?
  430. $/* More characters in the file? */
  431. value = CHARS(file)
  432. %More lines in the file?
  433. $/* More lines in the file? */
  434. value = LINES(file)
  435. %Open file for reading
  436. $/* Open file for reading */
  437. /* rc will hold 'READY' if successful */
  438. rc = STREAM(filename, 'C', 'OPEN READ')
  439. %Open file for reading & writing
  440. $/* Open file for reading & writing */
  441. /* rc will hold 'READY' if successful */
  442. rc = STREAM(filename, 'C', 'OPEN')
  443. %Open file for writing
  444. $/* Open file for writing */
  445. /* rc will hold 'READY' if successful */
  446. rc = STREAM(filename, 'C', 'OPEN WRITE')
  447. %Read a character from the file
  448. $/* Read a character from the file */
  449. value = CHARIN(filename)
  450. %Read a line from the file
  451. $/* Read a line from the file */
  452. value = LINEIN(filename)
  453. %Set read/write position in file backward from current position
  454. $/* Set read/write position in file backward from current position */
  455. Call STREAM filename, 'C', 'SEEK -'value
  456. %Set read/write position in file forward from current position
  457. $/* Set read/write position in file forward from current position */
  458. Call STREAM filename, 'C', 'SEEK +'value
  459. %Set read/write position in file from end of file
  460. $/* Set read/write position in file from end of file */
  461. Call STREAM filename, 'C', 'SEEK <'value
  462. %Set read/write position in file from start of file
  463. $/* Set read/write position in file from start of file */
  464. Call STREAM filename, 'C', 'SEEK ='value
  465. %Write a line to the file
  466. $/* Write a line to the file */
  467. CALL LINEOUT filename, value
  468. %Write a string of characters to the file
  469. $/* Write a string of characters to the file */
  470. CALL CHAROUT filename, value
  471.  
  472. @I/O functions
  473. %Address
  474. $ADDRESS environment
  475. %Charin
  476. $Value = CHARIN(name,start,length)
  477. %Charin file to variable
  478. $value = CHARIN(filename,1,(CHARS(filename))
  479. rc=stream(filename,'c','close')
  480. %Charout
  481. $CALL CHAROUT filename,string
  482. %Chars
  483. $value = CHARS(filename)
  484. %Directroy
  485. $Value = DIRECTORY() /* returns current directory */
  486. CALL DIRECTORY directory /* switch to directory */
  487. %Filespec
  488. $Value = FILESPEC('D',filename) /* returns drive */
  489. Value = FILESPEC('P',filename) /* returns the path */
  490. Value = FILESPEC('N',filename /* returns the filename */
  491. %Linein
  492. $value = LINEIN(filename,line)
  493. %Lineout
  494. $CALL LINEOUT filename,string,line
  495. %Lines
  496. $lines = LINES(filename)
  497.  
  498. @Parse
  499. %Parse Arg
  500. $PARSE ARG string
  501. %Parse Pull
  502. $PARSE PULL string
  503. %Parse Source
  504. $PARSE SOURCE string
  505. %Parse Value
  506. $PARSE VALUE function WITH template /* Parse Value TIME() with Std ':' Min ':' Sec */
  507. %Parse Var
  508. $PARSE VAR string first rest
  509. %Parse Version
  510. $PARSE VERSION REXXVERSION
  511.  
  512. @Stream
  513. %Stream - Open
  514. $CALL STREAM file,'C','OPEN'
  515. %Stream - Open Read
  516. $CAll STREAM file,'C','OPEN READ'
  517. %Stream - Open Write
  518. $CALL STREAM file,'C','OPEN WRITE'
  519. %Stream - Seek
  520. $CALL STREAM file,'C','SEEK number'
  521. %Stream - Close
  522. $CALL STREAM file,'C','CLOSE'
  523. %Stream - filename
  524. $filename = STREAM(file,'C','QUERRY EXIST')
  525. %Stream - size
  526. $size = STREAM(file,'C','QUERRY SIZE')
  527. %Stream - time/Date
  528. $timeinfo = STREAM(file,'C','QUERRY DATETIME')
  529. %Stream - description
  530. $Value = STREAM(file,'D')
  531. %Stream - status
  532. $Value = STREAM(file,'S')
  533.  
  534. @Queue
  535. %RxQueue - GET
  536. $Queue = RxQueue('GET')
  537. %RxQueue - Create
  538. $Name = RxQueue('CREATE',name)
  539. %RxQueue - Set
  540. $rc = RxQueue('SET',name)
  541. %RxQueue - Delete
  542. $rc = RxQueue('DELETE',name)
  543. %Queued
  544. $Zeilen = QUEUED() /* returns the number of lines in queue */
  545. %Queue
  546. $QUEUE value /* append value to the end of the queue */
  547. %Pull
  548. $PULL Zeile /* get 1. line of queue */
  549. %Push
  550. $PUSH value /* insert value at the beginning of the queue */
  551.  
  552. @Strings
  553. %B2X
  554. $value = B2X(char)
  555. %Center
  556. $value = CENTER(string,lenght,fillchar)
  557. %Chars
  558. $value = CHARS(name)
  559. %Compare
  560. $value = COMPARE(string1,string2)
  561. %Copies
  562. $value = COPIES(string,number)
  563. %C2D
  564. $value = C2D(char)
  565. %C2X
  566. $value = C2X(char)
  567. %Delstr
  568. $value = DELSTR(string,start,length)
  569. %Delword
  570. $value = DELWORD(string,start,length)
  571. %D2C
  572. $value = D2C(number)
  573. %D2X
  574. $value = D2X(number)
  575. %Insert
  576. $value = INSERT(new,target,start)
  577. %Lastpos
  578. $value = LASTPOS(needle,haystack,start)
  579. %Left
  580. $value = LEFT(string,length,fillchar)
  581. %Length
  582. $value = LENGTH(string)
  583. %Pos
  584. $value = POS(needle,haystack,start)
  585. %Overlay
  586. $value = OVERLAY(new,target,start,length,fillchar)
  587. %Reverse
  588. $value = REVERSE(string)
  589. %Right
  590. $value = RIGHT(string,length,fillchar)
  591. %Space
  592. $value = SPACE(string,number,fillchar)
  593. %Strip
  594. $value = STRIP(string,option,fillchar)
  595. %Substr
  596. $value = SUBSTR(string,start,length)
  597. %Subword
  598. $value = SUBWORD(string,start,length)
  599. %Translate
  600. $value = TRANSLATE(string) /* convert string to uppercase */
  601. /* replace a character within the string with an other character */
  602. value = TRANSLATE(string,tableo,tablei,pad)
  603. %Verify
  604. $value = VERIFY(string1,string2)
  605. %Word
  606. $value = WORD(string,pos)
  607. %Wordindex
  608. $index = WORDINDEX(string,word)
  609. %Wordlength
  610. $value = WORDLENGTH(string,pos)
  611. %Wordpos
  612. $value = WORDPOS(needle,haystack,start)
  613. %Words
  614. $value = WORDS(string)
  615. %X2B
  616. $value = X2B(hex char)
  617. %X2C
  618. $value = X2C(hex char)
  619. %X2D
  620. $value = X2D(hex char)
  621. %Xrange
  622. $value = XRANGE(start,end)
  623.  
  624. @Math functions
  625. %ABS
  626. $value = ABS(number)
  627. %Digits
  628. $value = DIGITS()
  629. %Format
  630. $value = FORMAT(number,before,after)
  631. %Form
  632. $value = FORM()
  633. %Fuzz
  634. $value = FUZZ()
  635. %Numeric Digits
  636. $NUMERIC DIGITS value
  637. %Numeric Form
  638. $NUMERIC FORM 'SCIENTIFIC' or 'ENGINEERING'
  639. %Numeric Fuzz
  640. $NUMERIC FUZZ value
  641. %Max
  642. $value = MAX(number1,number2,...,number20)
  643. %Min
  644. $value = MIN(number1,number2,....,number20)
  645. %Random
  646. $value = RANDOM(min,max)
  647. %Sign
  648. $value = SIGN(number)
  649. %Trunc
  650. $Value = TRUNC(number,n)
  651.  
  652. @Other functions
  653. %Abbrev
  654. $value = ABBREV(information,info,length)
  655. %Beep
  656. $CALL BEEP frequency,duration
  657. %Condition
  658. $rc = CONDITION('C') /* Condition Name */
  659. rc = CONDITION('I') /* Condition Instruction */
  660. rc = CONDITION('D') /* Condition Description */
  661. rc = CONDITION('S') /* Condition Status */
  662. %Datatype
  663. $Type = DATATYPE(string)
  664. %Date
  665. $value = DATE() /* dd mm yyyy */
  666. value = DATE('B') /* days since January 1, 0001 */
  667. value = DATE('D') /* days since January 1, of the current year */
  668. value = DATE('E') /* dd/mm/yy European format */
  669. value = DATE('L') /* language-dependent format*/
  670. value = DATE('M') /* name of the month */
  671. value = DATE('N') /* dd mon yyyy */
  672. value = DATE('O') /* yy/mm/ddt */
  673. value = DATE('S') /* yyyymmdd */
  674. value = DATE('U') /* mm/dd/yy */
  675. value = DATE('W') /* day of week */
  676. %Drop
  677. $DROP value
  678. %Sourceline
  679. $line = SOURCELINE(line)
  680. %Symbol
  681. $status = SYMBOL(value)
  682. %Time
  683. $value = TIME() /* hh:mm:ss */
  684. value = TIME('C') /* hh:mmxx */
  685. value = TIME('E') /* Elapsed */
  686. value = TIME('H') /* hh */
  687. value = TIME('M') /* mmmm since midnight */
  688. value = TIME('L') /* hh:mm:ss:uu0000 */
  689. value = TIME('N') /* hh:mm:ss */
  690. value = TIME('R') /* Reset elapsed */
  691. %value
  692. $value = VALUE(name,newvalue,environment)
  693. /* example */
  694. path = VALUE('Path',,'OS2ENVIRONMENT')
  695.