home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / WINDOWS / UTILS / CP_72B.ZIP / CP_HELP.CR$ (.txt) < prev    next >
Cardfile Document  |  1991-03-02  |  40KB  |  1,562 lines

  1. ----------------------------------------
  2.   @  Command Post Language Summary  @
  3. ........................................
  4. Copyright 1988-1991, Morrie Wilson
  5. All rights reserved.
  6.  
  7. This cardfile contains a quick summary of all the Command Post Menu Language functions -- and some other useful info  
  8.  
  9. Wilson WindowWare
  10. 2701 California Ave SW #212
  11. Seattle Wa, 98116
  12. (206) 937-9335    FAX (206) 935-7129
  13. ----------------------------------------
  14. ----------------------------------------
  15.   @@ Added Functions --  IF --THEN
  16. ........................................
  17. Command Post now has IF-THEN statements.  As in
  18.  
  19. IF condition THEN statement
  20.  
  21. Example:
  22.  
  23. IF a>5 then Message("Hello","A GT 5")
  24.  
  25.  
  26. ----------------------------------------
  27. ----------------------------------------
  28.   @@ Added Functions -- GOTO
  29. ........................................
  30. Command Post now has GOTO statements ...and labels.    As follows:
  31. Note labels begin with :
  32.     A=0
  33. :LOOP
  34.     IF A>5 then goto NEXT
  35.      Message("A is now",A)
  36.      A=A+1
  37.      goto LOOP
  38. :NEXT
  39.      Message("DONE","Loop Exited")
  40. ----------------------------------------
  41. ----------------------------------------
  42.   @@ Added Functions -- HOTKEYS
  43. ........................................
  44. Hotkeys can how be added to any menu item.  Hotkeys are keys which immediately activate a menu item.  Most any keystroke combination except ALT-char (which is used by Windows) may be put on a menu item.  See the section on Menu Structure.
  45. ----------------------------------------
  46. ----------------------------------------
  47.   @@ Added Functions -- WALLPAPER
  48. ........................................
  49. Added a new function that allows immediate change of the Windows Wallpaper.
  50.  
  51. WallPaper(BMPFILE,TILE)
  52.  
  53. examples
  54.  
  55. Wallpaper("weave.bmp",@TRUE)
  56. WallPaper("Bambi.bmp",@FALSE)
  57.  
  58. ----------------------------------------
  59. ----------------------------------------
  60.  @@ Added Functions --  DirRename
  61. ........................................
  62. A DirRename function, inexplicably missing from the original versions, has been added.
  63. ----------------------------------------
  64. ----------------------------------------
  65.  @@ Added Functions --  File Hiliting
  66. ........................................
  67. The following functions are not in the 7.0 manual:
  68.  
  69. FileHilite   ...Hilites/unhilites files
  70. ----------------------------------------
  71. ----------------------------------------
  72.  @@ Added Functions --  File IO
  73. ........................................
  74. FileOpen, FileRead, FileWrite, and FileClose functions have been added to Command Post.  See examples in main reference section...
  75. ----------------------------------------
  76. ----------------------------------------
  77.  @@ Added Functions --  FileAppend
  78. ........................................
  79. A FileAppend function has been added, which allows you to append data to the end of files.  Kind of getting the DOS
  80.  
  81. COPY a.xxx+b.xxx+c.xxx all.xxx
  82.  
  83. ability into CmdPost
  84. ----------------------------------------
  85. ----------------------------------------
  86.  @@ Added Functions --  Info retrival
  87. ........................................
  88. The following functions are not in the 7.0 manual:
  89.  
  90. IsLicensed  ...Tells if CP licensed
  91. IsKeyDown   ...Tells about keys/mouse
  92. DOSVersion  ...Returns DOS/OS2 version
  93. WinConfig   ...Returns WIN3 mode flags
  94. WinPosition ...Returns Window position
  95. WinExist    ...Tells is Window exists
  96. ----------------------------------------
  97. ----------------------------------------
  98.  @@ Added Functions --  Items and Lists
  99. ........................................
  100. In addition to the already existing
  101. FileItemize, DirItemize, WinItemize and
  102. the ItemSelect function, two new functions have been added for "list" processing.  They are:
  103.  
  104. ItemCount(list,delim) and
  105. ItemExtract(number,list,delim)
  106. ----------------------------------------
  107. ----------------------------------------
  108.  @@ Added Functions --  Private INIs
  109. ........................................
  110. Two new functions for reading and writing private ini files.  They are
  111.  
  112. IniReadPvt and IniWritePvt
  113. ----------------------------------------
  114. ----------------------------------------
  115.  @@ Added Functions -- Filename Parsing
  116. ........................................
  117. The following functions are not in the 7.0 manual:
  118.  
  119. FileRoot       ...returns root of file
  120. FileExtension  ...returns ext of file
  121. FilePath       ...returns path of file 
  122. ----------------------------------------
  123. ----------------------------------------
  124.  @@ Added Functions -- Network Support
  125. ........................................
  126. The following functions are not in the 7.0 manual:
  127.  
  128. DiskReset ...re-examines available disks
  129. DiskHide  ...Hides disks from display
  130. ----------------------------------------
  131. ----------------------------------------
  132.  @@ Added Functions -- String Handling
  133. ........................................
  134. The following functions are not in the 7.0 manual:
  135.  
  136. StrReplace  ...Replaces all occurances
  137.                of a substring with                      another
  138. ----------------------------------------
  139. ----------------------------------------
  140.  @@ Mouse  - A Quickie Overview
  141. ........................................
  142. The following few cards discuss some of the mouse control of the CmdPost window.  Some shorthand notation used is:
  143.  
  144. LC   - Left Click
  145. RC   - Right Click
  146. LDBL - Left Double Click
  147. RDBL - Right Double Click
  148. ----------------------------------------
  149. ----------------------------------------
  150.  @@ Mouse - Disk switching
  151. ........................................
  152. LC the desired drive to switch the Command Post window to that drive.
  153.  
  154.  
  155. Keyboard equivalent is 
  156. CTRL-(whatever driveletter you need)
  157. ----------------------------------------
  158. ----------------------------------------
  159.  @@ Mouse - Navigating the Tree - DOWN
  160. ........................................
  161. Subdirectories are shown in BOLD type at the top of the file listing.
  162.  
  163. LC to select a subdir - clears all                               other selections
  164. RC to select a subdir - keeps other                              selections
  165. LDBL switch to selected subdir
  166. ----------------------------------------
  167. ----------------------------------------
  168.  @@ Mouse - Navigating the Tree - UP
  169. ........................................
  170. At the top of the file window, next to the disk drive icons is the current pathname. 
  171.  
  172. LC on the desired directory in the pathname to see that directory
  173.  
  174. Keyboard equivalent is using the BACKSPACE key to move up one level at a time.
  175. ----------------------------------------
  176. ----------------------------------------
  177.  @@ Mouse - On a file name
  178. ........................................
  179. LC   selects a file - clears all 
  180.      other selections
  181. RC   selects a file - keeps other 
  182.      selections.  Can DRAG the mouse.
  183.  
  184. LDBL runs selected file.  If not an 
  185.      EXE, COM, BAT, or PIF file, the          [extensions] of WIN.INI is used.
  186.  
  187. RDBL will select/unselect all files 
  188.      with the same extension.
  189. ----------------------------------------
  190. ----------------------------------------
  191.  @@ Mouse - Quickie Menu Items
  192. ........................................
  193. Several items in the CMDPOST.CPM menus have been programmed to bypass the "confirm" box ->IF THE RIGHT MOUSE BUTTON IS HELD DOWN WHILE THE MENUITEM IS SELECTED AS USUAL WITH THE LEFT BUTTON<-
  194. Some of these menuitems are:
  195. File.Browse         File.Copy
  196. File.NotepadEdit    File.Move
  197. File.Copy
  198. File.Move/Rename
  199. ----------------------------------------
  200. ----------------------------------------
  201.  @@ WIN.INI Variables
  202. ........................................
  203. Documentation on WIN.INI settings may be found in the #WININI.TXT file in the scratch directory used during installation (usually C:\CP-NOTES.TMP\)  
  204. The only item intended for user modification is AutoUpdate.  If you set it to zero, you will disable the automatic updating the CmdPost directory window undergoes. e.g.
  205. [CmdPost]
  206. AutoUpdate=0
  207. ----------------------------------------
  208. ----------------------------------------
  209.  Menu Structure #1  --  Intro
  210. ........................................
  211. Command Post is controlled by CPM (Command Post Menu) files.  The Command Post menu files control the menus of the Command Post window and what happens when one of the menu items is selected.
  212. The CPM files are used to define the main menu items, the drop down menu items and the statements that are executed when a drop down item is selected.
  213. ----------------------------------------
  214. ----------------------------------------
  215.  Menu Structure #2  --  Statements
  216. ........................................
  217. There are three type of statements in a CPM file.  They are:
  218.  
  219. 1) Main Menu Title Lines      (Col. 1)
  220. 2) Dropdown Menu Title Lines  (Col. 2)
  221. 3) Executable Statement lines (Col. 8)
  222.  
  223. The column a line starts in is used to determine what kind of line it is.  Main menu lines start in column 1, dropdown in column2 and statements in 8.
  224. ----------------------------------------
  225. ----------------------------------------
  226.  Menu Structure #3  --  Structure
  227. ........................................
  228. Main Menu Name A
  229.  DropDown Menu Name A-1
  230.     <statements>
  231.  DropDown menu Name A-2
  232.     <statements>
  233. Main Menu Name B
  234.  DropDown menu name B-1
  235.     <statements>
  236. ; Comment.
  237. ; Next line declares a 2nd .cpm file:
  238. #NextFile SECOND.CPM
  239. ----------------------------------------
  240. ----------------------------------------
  241.  Menu Structure #4  --  Sample
  242. ........................................
  243. Stuff
  244.  Start Clock
  245.         Run("CLOCK.EXE","")
  246.  Get Phonebook
  247.         DirChange("C:\NOTES")
  248.         Run("CARDFILE.EXE","PHONES.CRD")
  249. Games
  250.  Solitaire
  251.     Run("SOL.EXE","")
  252.  Reversi
  253.     Run("REVERSI.EXE","")
  254. ----------------------------------------
  255. ----------------------------------------
  256.  Menu Structure #5  --  HotKeys
  257. ........................................
  258. HotKeys may be assigned to drop down menu items.  HotKeys are single keystrokes that cause a menu item to be executed.  Almost any key on the keyboard may be used as a hotkey, with the exception of ALT and ALT-SHIFT keys which are used by Windows (You can use ALT-CTRL keys.
  259.  
  260.  
  261. ----------------------------------------
  262. ----------------------------------------
  263.  Menu Structure #6  --  HotKeys
  264. ........................................
  265. Hoykeys are attached to menu items by defining them in the CPM file.  The hotkey definition is placed after a dropdown menu title.  E.G.
  266.  
  267. Stuff
  268.  Run Clock \ {F1}
  269.            |   |--Use the F1 Key
  270.            |------Required Backslash
  271. The backslash is used to separate the dropdown title from the hotkey.
  272. ----------------------------------------
  273. ----------------------------------------
  274.  Menu Structure #7  --  HotKeys
  275. ........................................
  276. Hoykeys can be almost any key on the keyboard.  A-Z, F1-F16 and others.  Combinations of CTRL, SHIFT and ALT also work.  A hotkey definition consists of a prefix (if any) and the hotkey itself.  First a few samples...
  277.  
  278. ^Z       - CTRL-Z       A - The letter A
  279. ^{F1}    - CTRL-F1     +A - SHIFT-A
  280. {DELETE} - DELETE      ^A - CTRL-A
  281. {INSERT} - INSERT     ^!A - CTRL-ALT-A
  282. ----------------------------------------
  283. ----------------------------------------
  284.  Menu Structure #8  --  HotKeys
  285. ........................................
  286. Prefixes tell Command Post if the SHIFT, CTRL, and/or ALT key should be down for the key to take effect.  Prefixes are NOT required.
  287. Valid prefixes are:
  288.    ^  -- CTRL
  289.    ^+ -- CTRL-SHIFT
  290.    ^! -- CTRL-ALT
  291.    ^+!-- CTRL-SHIFT-ALT
  292.    +  -- SHIFT
  293. Note: ALT and SHIFT-ALT alone is not OK
  294. ----------------------------------------
  295. ----------------------------------------
  296.  Menu Structure #9  --  HotKeys
  297. ........................................
  298. You may use the keys A thru Z, 1 thru 9,
  299. assorted punctuation, and the other keys, which are defined with keycodes.  The valid keycodes are:
  300.  
  301. {F1} thru {F16}  <<<< BUT NOT {F10} >>>>
  302. {DELETE} {INSERT} {SPACE} {ENTER}
  303. {BACKSPACE} {TAB} {ESC}
  304. {UP} {DOWN} {LEFT} {RIGHT}
  305. {HOME} {END} {PGUP} {PGDN}
  306. ----------------------------------------
  307. ----------------------------------------
  308.  Menu Structure #9A  -- Hotkeys
  309. ........................................
  310. Note that you can override some of Command Post's built in capability with the keycodes.  For Example, if you use ^C for a menu item, you lose the capability to select your C drive with the ^C keystroke.
  311.  
  312. Also note that you cannot use {F10} as a hot key because Windows treats the F10 key just like another ALT key.
  313. ----------------------------------------
  314. ----------------------------------------
  315.  Menu Structure #9B  --  Sample
  316. ........................................
  317. Stuff
  318.  Start Clock   \ ^+C
  319.         Run("CLOCK.EXE","")
  320.  Get Phonebook \ ^+P
  321.         DirChange("C:\NOTES")
  322.         Run("CARDFILE.EXE","PHONES.CRD")
  323. Games
  324.  Solitaire \ {F2}
  325.     Run("SOL.EXE","")
  326.  Reversi \   {F3}
  327.     Run("REVERSI.EXE","")
  328. ----------------------------------------
  329. ----------------------------------------
  330.  Variables
  331. ........................................
  332. Variable names start with a letter.
  333.  
  334. The rest of the name consists of letters and numbers, up to 30 characters total.
  335.  
  336. Variable names are NOT case sensitive, i.e. "Cat" and "cAT" are the same variable.
  337. ----------------------------------------
  338. ----------------------------------------
  339. !
  340. ........................................
  341. The logical NOT operator.
  342.  
  343. Produces @TRUE if the operand = zero, @FALSE if it's nonzero.
  344. ----------------------------------------
  345. ----------------------------------------
  346. &      |      ^
  347. ........................................
  348. The bitwise AND, OR, and XOR operators.
  349.  
  350. The operator will arithmetically AND, OR, or exclusive-OR two integers together.  
  351.  
  352. a=5;        = 101
  353. b=4        = 100
  354. c=a & b  ; c=4    = 100
  355. d=a | b  ; d=5  = 101
  356. e=a ^ b  ; e=1  = 001
  357. ----------------------------------------
  358. ----------------------------------------
  359. &&    ||
  360. ........................................
  361. The logical AND and OR operators.
  362.  
  363. These operators will logically AND or OR two numbers together.  
  364.  
  365. a=0    ;0 means FALSE
  366. b=4    ;nonzero means TRUE
  367. c=a && b  ; c is @FALSE ( 0 )
  368. d=a || b  ; d is @TRUE  ( 1 )
  369.  
  370. See also & | and ^
  371. ----------------------------------------
  372. ----------------------------------------
  373. (   )
  374. ........................................
  375. Parentheses.
  376.  
  377. Parentheses are used to control the order an expression is evaluated.
  378.  
  379. a = (4+5) * 2    ; a is 18
  380. a = 4 + (5 * 2)  ; a is 14
  381. ----------------------------------------
  382. ----------------------------------------
  383. *   /   +   -    mod (binary)
  384. ........................................
  385. Simple arithmetic operators.
  386.  
  387. *   Multiplication
  388. /   Division
  389. +   Addition
  390. -   Subtraction
  391. mod Modulo  (divide, return remainder)
  392.  
  393. See also abs, min, max
  394. ----------------------------------------
  395. ----------------------------------------
  396. ~
  397. ........................................
  398. Bitwise NOT operator.
  399.  
  400. Sets all 0 bits of the integer operand to 1, and vice-versa.
  401.  
  402. a=26    ;=00110100
  403. b=~a    ;=11001011, or -27
  404. ----------------------------------------
  405. ----------------------------------------
  406. +   -   (unary)
  407. ........................................
  408. Unary arithmetic operators.
  409.  
  410. +  Identity
  411. -  Negation
  412. ----------------------------------------
  413. ----------------------------------------
  414. <<    >>
  415. ........................................
  416. Bitwise shift operators.
  417.  
  418. <<  Left Shift
  419. >>  Right Shift
  420.  
  421. c= 16 >> 2    ; c is 4
  422. d= 16 << 2    ; c is 64
  423. ----------------------------------------
  424. ----------------------------------------
  425. =
  426. ........................................
  427. The assigment operator.
  428.  
  429. Assigns the value or string evaluated on the right side of the = sign to the variable on the left side.
  430. ----------------------------------------
  431. ----------------------------------------
  432. ==   !=   <>   <=   >=   >   <
  433. ........................................
  434. Relational operators. 
  435.  
  436. ==      Equality
  437. !=  <>  Inequality
  438. <=      Less than or equal to
  439. >=      Greater than or equal to
  440. <       Less than
  441. >       Greater than
  442. These produce 0 (@FALSE) or 1 (@TRUE).
  443.  
  444. See also StrCmp, StrICmp
  445. ----------------------------------------
  446. ----------------------------------------
  447. Abs (number)
  448. ........................................
  449. Returns the absolute (positive) value of an integer number.
  450.  
  451.  
  452. Fred=Abs(-4)  ;Fred becomes 4
  453. ----------------------------------------
  454. ----------------------------------------
  455. AskLine (title, prompt, default)
  456. ........................................
  457. Gets a line of info from the user.
  458.  
  459. title  = title of the dialog box.
  460. prompt = question shown above edit box.
  461. default= default entry in edit box.
  462.  
  463. Returns string the user enters into the edit box.
  464. ----------------------------------------
  465. ----------------------------------------
  466. AskYesNo (title, prompt)
  467. ........................................
  468. Asks the user a yes or no question.
  469.  
  470. title    = title of the dialog box.
  471. prompt    = string shown above edit box.
  472.  
  473. Returns @YES or @NO depending on which button they press.
  474. ----------------------------------------
  475. ----------------------------------------
  476. Average (num [,num]...)
  477. ........................................
  478. Finds the average of a list of integers.
  479.  
  480. Returns average of the numbers, to the closest integer.
  481.  
  482.  
  483. ----------------------------------------
  484. ----------------------------------------
  485. Beep
  486. ........................................
  487. Sounds a short beep at the user.
  488.  
  489.  
  490.  
  491.  
  492. Beep
  493. Message("Be Alert","We need more lerts")
  494. ----------------------------------------
  495. ----------------------------------------
  496. Char2Num (string)
  497. ........................................
  498. Converts the first character of a string to its ANSI code.
  499.  
  500.  
  501.  
  502. a=Char2Num("Z")
  503. Message("Z's ANSI Code is",a)
  504. ----------------------------------------
  505. ----------------------------------------
  506. ClipAppend (string)
  507. ........................................
  508. Appends a string to the clipboard.  
  509. Clipboard must contain text, or be empty.
  510.  
  511. a="First"
  512. b="Second"
  513. ClipPut(a)
  514. ;clipboard = "First"
  515. ClipAppend(b)
  516. ;clipboard = "FirstSecond"
  517. ----------------------------------------
  518. ----------------------------------------
  519. ClipGet ()
  520. ........................................
  521. Retrieves the contents of the Clipboard into a string variable.  
  522. Clipboard must contain only text.
  523.  
  524. a=ClipGet()
  525. Message("Clipboard",a)
  526. ----------------------------------------
  527. ----------------------------------------
  528. ClipPut (string)
  529. ........................................
  530. Clears the clipboard and inserts a "string" into it.  Clipboard will be marked as containing text.
  531.  
  532.  
  533. a="First"
  534. b="Second"
  535. ClipPut(a)
  536. ;clipboard = "First"
  537. ClipAppend(b)
  538. ;clipboard = "FirstSecond"
  539. ----------------------------------------
  540. ----------------------------------------
  541. CurrentFile()
  542. ........................................
  543. Returns the currently selected filename. 
  544.  
  545. The currently selected file name is the one with the dashed box around it.
  546.  
  547. If could be a directory if that is what the dashed box is around.
  548. ----------------------------------------
  549. ----------------------------------------
  550. DateTime ()
  551. ........................................
  552. Returns the current system date and time using the format declared in the International section of the WIN.INI file.
  553.  
  554.  
  555. Message("Date and Time is",DateTime())
  556. ----------------------------------------
  557. ----------------------------------------
  558. Debug (@ON | @OFF)
  559. ........................................
  560. Turns the statement debugging dialog box on or off.
  561. ----------------------------------------
  562. ----------------------------------------
  563. Delay (seconds)
  564. ........................................
  565. Delays "seconds" seconds.  While the delay is in progress other windows will receive processing time.
  566.  
  567. message("TEST","See you later")
  568. delay(10)
  569. message("TEST","I'm BAAAAAACK!")
  570. ----------------------------------------
  571. ----------------------------------------
  572. DirChange ([d:] path)
  573. ........................................
  574. Changes the current directory.
  575.  
  576. If the pathname includes a different drive than the current one, it will log onto the new drive.
  577.  
  578.  
  579. DirChange ("d:\winword")
  580. DirChange ("mysubdir")
  581.  
  582. ----------------------------------------
  583. ----------------------------------------
  584. DirGet ()
  585. ........................................
  586. Returns the current directory.
  587. ----------------------------------------
  588. ----------------------------------------
  589. DirHome ()
  590. ........................................
  591. Returns the path to the Command Post executable files.
  592. ----------------------------------------
  593. ----------------------------------------
  594. DirItemize (dir-spec)
  595. ........................................
  596. Returns either all the highlighted directories (if dir-spec = "") or the list of directories matching a set of wildcards.  Usually "*.*" is used.
  597.  
  598. The directory names are separated by spaces.
  599.  
  600. DirItemize("")    ;returns hilited dirs
  601. DirItemize("*.*") ;returns all dirs
  602. ----------------------------------------
  603. ----------------------------------------
  604. DirMake ([d:] path)
  605. ........................................
  606. Creates a new directory.
  607.  
  608.  
  609. DirMake ("Child")
  610. DirMake ("..\..\Uncle")
  611. DirMake ("..\..\Uncle\Cousin")
  612. ----------------------------------------
  613. ----------------------------------------
  614. DirRemove ([d:] path)
  615. ........................................
  616. Deletes a directory.
  617.  
  618.  
  619. DirRemove ("..\..\Uncle\Cousin")
  620.  
  621. ----------------------------------------
  622. ----------------------------------------
  623. DirRename ([d:] oldpath, [d;] newpath )
  624. ........................................
  625. Renames a directory.
  626.  
  627. DirRename("C:\TEMP","C:\WORK")
  628.  
  629. ----------------------------------------
  630. ----------------------------------------
  631. DiskFree (drive-list)
  632. ........................................
  633. Returns the total available free space of all drives in the list.
  634.  
  635. a=DiskFree("C D")  ;get free space
  636. a=a/1024           ;convert to "K"
  637. Message ("Free space on C&D","%a%K")
  638. ----------------------------------------
  639. ----------------------------------------
  640. DiskHide (Drive-Letter-List)
  641. ........................................
  642. Instructs Command Post to suppress the disk drive icon display for all drives in the Drive-Letter-List.
  643.  
  644. E.G. If you are on a network, and NEVER care what drives S,T,U,V and W have on them, you may issue the command:
  645.  
  646. DiskHide("STUVW")  
  647. ----------------------------------------
  648. ----------------------------------------
  649. DiskReset ()
  650. ........................................
  651. DiskReset causes Command Post to re-examine all attached drives.  This command is used after attaching or detaching network drives to re-sync the display to the state of the network.
  652. ----------------------------------------
  653. ----------------------------------------
  654. Display (seconds, title, text)
  655. ........................................
  656. Displays a message for the indicated number of seconds.
  657.  
  658. You can stop the display by clicking on the message box with the mouse or pressing a key.
  659.  
  660. Display(5,"!!!","Bye bye in 5 seconds")
  661. ----------------------------------------
  662. ----------------------------------------
  663. DOSVersion (@MAJOR | @MINOR)
  664. ........................................
  665. Returns the version numbers of the current version of DOS.
  666. "level" = @MAJOR returns the integer part and @MINOR returns the decimal part (to the right of the decimal).
  667.  
  668. r=DOSVersion(@MAJOR)
  669. v=DOSVersion(@MINOR)
  670. Message("DOS Version","%r%.%v%")
  671. ----------------------------------------
  672. ----------------------------------------
  673. Drop (var [,var]...)
  674. ........................................
  675. Deletes variables from the varaible list, thus conserving memory.
  676.  
  677. This is a recommended practice for local variables.
  678. ----------------------------------------
  679. ----------------------------------------
  680. EndSession ()
  681. ........................................
  682. Ends the current Windows session.
  683.  
  684. Has the same effect as choosing File/Exit in Win 2.x, or closing the Program Manager in Win 3.0
  685. ----------------------------------------
  686. ----------------------------------------
  687. Environment (env-variable)
  688. ........................................
  689. Returns the contents of a DOS environ- ment variable.
  690.  
  691. a=Environment("PATH")
  692. Message("Your PATH is",a)
  693. ----------------------------------------
  694. ----------------------------------------
  695. ErrorMode(@OFF | @NOTIFY | @CANCEL)
  696. ........................................
  697. Controls the error handling mode.  @CANCEL (the default):  Cancels the menu item at any error.
  698. @NOTIFY:  Informs the user and allows her to continue if the error is recoverable.
  699. @OFF: Same as @NOTIFY, but suppresses any recoverable errors.
  700.  
  701.  
  702. ERRORMODE(@OFF)
  703. ----------------------------------------
  704. ----------------------------------------
  705. Execute statement
  706. ........................................
  707. Executes a statement in an "error protected" environment.  Any error will be recoverable.  Often used to interactively execute user-typed statements.
  708.  
  709. A=AskLine("DO","Enter Stmt","")
  710. Execute %A%
  711. ----------------------------------------
  712. ----------------------------------------
  713. Exit
  714. ........................................
  715. Used to end processing a menu item.
  716.  
  717. Exit is assumed at the end of all menu items.
  718.  
  719.  
  720. b=0
  721. Exit
  722. ----------------------------------------
  723. ----------------------------------------
  724. FileAppend (from-list, to-name)
  725. ........................................
  726. Appends one or more filenames to the destination "to-name".  Wildcards may be used in the from-list.  The to-name may not be wildcarded.
  727.  
  728.  
  729.  
  730. FilAppend( "*.txt", "all.txt")
  731. FileAppend( "a.txt b.txt", "ab.txt")
  732.  
  733. ----------------------------------------
  734. ----------------------------------------
  735. FileClose (filehandle)
  736. ........................................
  737. Closes a file. 
  738. THE HARD WAY TO COPY AN ASCII FILE:
  739.  
  740.      Old=FileOpen("config.sys","READ")
  741.      New=FileOpen("sample.txt","WRITE")
  742. :TOP X=FileRead(Old)
  743.      if X!="*EOF*" then FileWrite(New,X)
  744.      if X!="*EOF*" then goto TOP
  745.      FileClose(New)
  746.      FileClose(Old)
  747. ----------------------------------------
  748. ----------------------------------------
  749. FileCopy (from-list, to-name, warn)
  750. ........................................
  751. Copies one or more filenames to the destination "to-name".  Wildcards may be used.  If more than one file is copied, to-name should be a wildcard.
  752.  
  753. If "warn" is @TRUE, the user will get a warning before overwriting a file.
  754.  
  755. FileCopy("C:\win\*.*", "A:", @TRUE)
  756.  
  757. ----------------------------------------
  758. ----------------------------------------
  759. FileDelete (file-list)
  760. ........................................
  761. Deletes one or more files.  More than one filename may be specified.  Wildcards may be used.
  762.  
  763.  
  764. FileDelete("*.BAK *.OLD")
  765. ----------------------------------------
  766. ----------------------------------------
  767. FileExist (filename)
  768. ........................................
  769. Determines whether or not a file exists. 
  770.  
  771. Returns @TRUE or @FALSE.
  772.  
  773. Unless it is a full pathname, The current directory will be checked, and then all directories on the DOS PATH will be checked.
  774.  
  775. a=FileExist ("WIN.INI")
  776. a=FileExist ("c:\windows\win.ini")
  777. ----------------------------------------
  778. ----------------------------------------
  779. FileExtension (filename)
  780. ........................................
  781. FileExtension parses the passed filename and returns the extension part of the filename.
  782. ----------------------------------------
  783. ----------------------------------------
  784. FileHilite (masks,flag)
  785. ........................................
  786. Hilites or unhilites files
  787. masks -  which files to affect
  788. flag  -  @TRUE - Hilite matching files
  789.          @FALSE -Unhilite matching files
  790.  
  791.  
  792. FileHilite("*.ZIP *.LZH *.ARC",@TRUE)
  793. FileHilite("OLD*.ZIP",@FALSE)
  794.  
  795.  
  796.  
  797. ----------------------------------------
  798. ----------------------------------------
  799. FileItemize (file-list)
  800. ........................................
  801. Returns either a list of highlighted files (if file-list = "") or the list of files matching the set of wildcards specified.
  802.  
  803. The filenames are separated by spaces.
  804.  
  805. FileItemize("") ;returns hilited files
  806. FileItemize("*.BAK") ;returns all BAK's
  807. FileItemize("*.ARC *.ZIP *.LZH")
  808.       ;returns list of compressed files
  809. ----------------------------------------
  810. ----------------------------------------
  811. FileLocate (filename)
  812. ........................................
  813. Attempts to find "filename" in the current directory, and along the DOS PATH.  If found, the function will return the complete pathname to the file.
  814.  
  815. a=FileLocate("WIN.INI")
  816. Message("WIN.INI is located in",a)
  817.  
  818. ----------------------------------------
  819. ----------------------------------------
  820. FileMove (from-list, to-name, warn)
  821. ........................................
  822. Moves one or more filenames to the destination "to-name".  Wildcards may be used.  If more than one file is moved, "to-name" should be a wildcard.
  823.  
  824. If the destination is on the same drive, a rename will occur instead of a move. 
  825. If "warn" = @TRUE the user gets a warning before overwriting a file.
  826.  
  827. FileMove("C:\win\*.*","A:",@TRUE)
  828. ----------------------------------------
  829. ----------------------------------------
  830. FileOpen ( filename, open-type)
  831. ........................................
  832. FileOpen opens a STANDARD ASCII (only) file for reading or writing.  It returns a FILEHANDLE to be used to read,
  833. write and close the file.
  834.  
  835. To open for reading:
  836. FileOpen("stuff.txt","READ")
  837.  
  838. To open for writing:
  839. FileOpen("stuff.txt","WRITE")
  840.  
  841. ----------------------------------------
  842. ----------------------------------------
  843. FilePath (filename)
  844. ........................................
  845. FilePath parses the passed filename and returns the drive and path of the file specification, if any.
  846. ----------------------------------------
  847. ----------------------------------------
  848. FileRead(filehandle)
  849. ........................................
  850. FileRead reads data from a file.  At EOF the string *EOF* will be returned.
  851.  
  852. Handle=FileOpen("autoexec.bat","READ")
  853. :top
  854. Line=FileRead(Handle)
  855. Display(4,"AUTOEXEC DATA",Line)
  856. if Line!="*EOF*" then goto top
  857. FileClose(Handle)
  858. ----------------------------------------
  859. ----------------------------------------
  860. FileRename (file-list, to-name)
  861. ........................................
  862. Renames one or more filenames to the destination "to-name".  Wildcards may be used.  If more than one file is renamed, "to-name" should be a wildcard.
  863.  
  864. The destination MUST be on the same drive as the source.  You may wish to use FileMove instead of FileRename. 
  865.  
  866. FileMove("C:\win\*.*","A:")
  867. ----------------------------------------
  868. ----------------------------------------
  869. FileRoot (filename)
  870. ........................................
  871. FileRoot parses the passed filename and returns the root part of the filename.
  872. ----------------------------------------
  873. ----------------------------------------
  874. FileSize (file-list)
  875. ........................................
  876. Adds the sizes of all the files in the list and returns the total.
  877.  
  878. a=FileSize(FileItemize("*.*"))
  879. Message("Size of all files in dir",a)
  880. ----------------------------------------
  881. ----------------------------------------
  882. FileWrite(filehandle,output-data)
  883. ........................................
  884. FileWrite writes data to a file.
  885.  
  886.  
  887.  
  888. Handle=FileOpen("Stuff.txt","WRITE")
  889. FileWrite(Handle,"Gobbledygook")
  890. FileClose(Handle)
  891. ----------------------------------------
  892. ----------------------------------------
  893. Goto  :LABEL
  894. ........................................
  895. Goto tranfers control to the indicated label.  The label must begin with a colon (just like DOS BAT files).
  896.  
  897. The label MUST be within the current menu item.  See CMDPOST.CPM for bunches of examples.  
  898.  
  899. Goto's are especially handt when used with the IF-THEN statements.  As in...
  900. IF a==5 then GOTO ZORK
  901. ----------------------------------------
  902. ----------------------------------------
  903. IF - THEN
  904. ........................................
  905. IF - THEN statements (along with GOTO's) give true batch file capability to the Command Post language.
  906.  
  907. IF condition THEN statement
  908.  
  909. Example
  910.  
  911. IF a==5 then GOTO ZORK
  912.  
  913. See CMDPOST.CPM for lots of examples.
  914. ----------------------------------------
  915. ----------------------------------------
  916. IniRead (section, keyword, default)
  917. ........................................
  918. Looks up a value in the WIN.INI file.  If the value is not found, the "default" will be returned.
  919.  
  920. IniRead ("windows","device","none")
  921. will look in
  922.  
  923. [windows]
  924. device=...
  925.  
  926. and return the default ptr or "none".
  927. ----------------------------------------
  928. ----------------------------------------
  929. IniReadPvt (sec, key, default,filename)
  930. ........................................
  931. Looks up a value in the "filename" ini file.  If the value is not found, the "default" will be returned.
  932.  
  933. IniReadPvt
  934.  ("Main","Lang","English","CMDPOST.INI")
  935.  
  936. CMDPOST.INI
  937. [Main]
  938. Lang=German
  939.  
  940. ----------------------------------------
  941. ----------------------------------------
  942. IniWrite (section, keyword, data)
  943. ........................................
  944. Modifies the WIN.INI file with the desired data.
  945.  
  946.  
  947.  
  948. IniWrite("CmdPost","MyVar",5)
  949. will create a new keyword entry in the CmdPost section:
  950.  
  951. [CmdPost]
  952. MyVar=5
  953. ----------------------------------------
  954. ----------------------------------------
  955. IniWritePvt (sec, key, data,filename)
  956. ........................................
  957. Writes a value in the "filename" ini file.  
  958.  
  959. IniWritePvt
  960.   ("Main","Lang","French,"CMDPOST.INI")
  961.  
  962. Makes...
  963.  
  964. CMDPOST.INI
  965. [Main]
  966. Lang=French
  967. ----------------------------------------
  968. ----------------------------------------
  969. IsDefined (variable)
  970. ........................................
  971. Determines whether or not a variable has been defined.
  972.  
  973. Returns @YES or @NO.
  974.  
  975. ----------------------------------------
  976. ----------------------------------------
  977. IsKeyDown(key-codes)
  978. ........................................
  979. Determines if the SHIFT key or the CTRL key is currently down.
  980.     IsKeyDown(@SHIFT)
  981.     IsKeyDown(@CTRL)
  982.     IsKeyDown(@CTRL|@SHIFT)
  983.     IsKeyDown(@CTRL&@SHIFT)
  984.  
  985. Returns TRUE or FALSE.
  986. Note: Right Mouse button same as SHIFT
  987.       Middle button same as CTRL
  988. ----------------------------------------
  989. ----------------------------------------
  990. IsLicensed()
  991. ........................................
  992. Returns whether or not the current version of Command Post is a licensed copy or not.
  993.  
  994. Mainly used to predict what CP's window titles are going to be.  In the unlicensed versions, the titles are fixed.  In licensed versions, they are programmable.
  995. ----------------------------------------
  996. ----------------------------------------
  997. IsMenuChecked (menuname)
  998. ........................................
  999. Determines whether or not a menu item is currently checked.  Returns @YES or @NO.
  1000.  
  1001.  
  1002. ----------------------------------------
  1003. ----------------------------------------
  1004. IsMenuEnabled (menuname)
  1005. ........................................
  1006. Determines whether or not a menu item is currently enabled (i.e. not grayed).  Returns @YES or @NO.
  1007.  
  1008. Terminate(!IsMenuEnabled,"ViewName","")
  1009.  
  1010. ----------------------------------------
  1011. ----------------------------------------
  1012. IsNumber (string)
  1013. ........................................
  1014. Determines if a string can be converted into a number.
  1015.  
  1016. Returns @YES or @NO.
  1017.  
  1018. n=AskLine("TEST","Enter a number",entry)
  1019. Terminate(!IsNumber(entry),"Must Enter a
  1020.                   Number")
  1021.  
  1022. ----------------------------------------
  1023. ----------------------------------------
  1024. IsRunning ()
  1025. ........................................
  1026. Returns @TRUE if another copy of Command Post is already running.
  1027.  
  1028. Returns @FALSE if this is the first instance of Command Post.
  1029. ----------------------------------------
  1030. ----------------------------------------
  1031. ItemCount (list, delimiter)
  1032. ........................................
  1033. Returns the number of items in a list.  The items in the list must be separated by the "delimiter" character - usually " " for dirs and files, and a tab for window titles.
  1034.  
  1035. a=FileItemize("*.*")
  1036. n=ItemCount(a," ")
  1037. Message("Note","There are %n% files")
  1038. ----------------------------------------
  1039. ----------------------------------------
  1040. ItemExtract (select, list, delimiter)
  1041. ........................................
  1042. Returns the selected item from a list.  The items in the list must be separated by the "delimiter" character - usually " " for dirs and files, and a tab for window titles.
  1043.  
  1044. a="My dog has fleas"
  1045. w=ItemExtract(2,a," ")
  1046. Message("The second word is",w)
  1047. ----------------------------------------
  1048. ----------------------------------------
  1049. ItemSelect (title, list, delimiter)
  1050. ........................................
  1051. Returns a single item chosen from a list box presented to the user.  The items in the list must be separated by the "delimiter" character - usually " " for dirs and files, and a tab for window titles.
  1052.  
  1053. a=FileItemize("*.DOC")
  1054. a=ItemSelect("Files",a," ")
  1055. b=WinItemize()
  1056. b=ItemSelect("Windows",b,char2num(9))
  1057. ----------------------------------------
  1058. ----------------------------------------
  1059. LastError ()
  1060. ........................................
  1061. Returns a numeric value representing the last error that occurred.  Each error has a different value.  0 means no error occurred.   
  1062.  
  1063. To use use LastError, ErrorMode() must be set to @NOTIFY or @OFF to avoid the default @CANCEL on error recovery.
  1064. ----------------------------------------
  1065. ----------------------------------------
  1066. LogDisk (diskdrive)
  1067. ........................................
  1068. Selects the first character of the "diskdrive" string and logs that disk as the current disk.
  1069.  
  1070. DirChange will log a new drive if the pathname you want to change to is on a different one than the current one.
  1071.  
  1072. LogDisk("D")
  1073.  
  1074.  
  1075. ----------------------------------------
  1076. ----------------------------------------
  1077. Max (num [,num]...)
  1078. ........................................
  1079. Examines a series of integers and returns the largest number in the list.
  1080.  
  1081.  
  1082. a=max(100, -50, 30, 200, 10)
  1083. message("answer will be 200",a)
  1084. ----------------------------------------
  1085. ----------------------------------------
  1086. MenuChange (menuname, flags)
  1087. ........................................
  1088. Changes a menu item to be checked or unchecked, enabled or disabled(grayed).
  1089.  
  1090. The permissable flags are
  1091. @CHECK or @UNCHECK
  1092. @ENABLE or @DISABLE
  1093.  
  1094. @CHECK or @UNCHECK may be or'ed with @ENABLE or @DISABLE using the | operator.
  1095. ----------------------------------------
  1096. ----------------------------------------
  1097. Message (title, text)
  1098. ........................................
  1099. Displays a message box to the user, with a specified "title" and "text".
  1100.  
  1101. There will be an OK button for the user to press.
  1102.  
  1103. Message("Hello","This is an example.")
  1104. ----------------------------------------
  1105. ----------------------------------------
  1106. Min (num [,num]...)
  1107. ........................................
  1108. Examines a series of integers and returns the smallest number in the list.
  1109.  
  1110.  
  1111. a=min(100, -50, 30, 200, 10)
  1112. message("answer will be -50", a)
  1113. ----------------------------------------
  1114. ----------------------------------------
  1115. Num2Char (number)
  1116. ........................................
  1117. Converts a number to a one-character string.  Use this to display special ANSI characters.
  1118.  
  1119. tab=num2char(9)
  1120. c=num2char(169) ;(c) symbol
  1121. Message("Command Post", "%c%1990")
  1122.  
  1123.  
  1124.  
  1125. ----------------------------------------
  1126. ----------------------------------------
  1127. OtherDir ()
  1128. ........................................
  1129. Returns the drive and directory that the "other" (second-most recently used) Command Post window is set to.
  1130.  
  1131. If there is no other Command Post window (or if this one was the first), then the disk and directory of the current window will be used.
  1132.  
  1133. a=OtherDir()
  1134. Message("The Other Directory is",a)
  1135. ----------------------------------------
  1136. ----------------------------------------
  1137. OtherUpdate ()
  1138. ........................................
  1139. Causes the "other" (second-most recently used) Command Post window to update its display.  This command is useful when the current Command Post window may have altered the directory or file structure so that an update is
  1140. desirable.
  1141. ----------------------------------------
  1142. ----------------------------------------
  1143. Pause (title, text)
  1144. ........................................
  1145. Presents the user with a message box, using the "title" and "text" supplied.
  1146. The box has two buttons - OK and CANCEL. 
  1147. If OK is selected, processing continues. 
  1148. If CANCEL is selected, processing terminates.
  1149.  
  1150. Pause("Hey You","Insert Floppy in A:")
  1151. FileCopy("C:\DOC\*.DOC","A:")
  1152. ----------------------------------------
  1153. ----------------------------------------
  1154. Random (max)
  1155. ........................................
  1156. Returns a psuedo-random integer between 0 and "max".
  1157.  
  1158. A=Random(10)    ; between 0 and 10
  1159. B=Random(20)    ; between 0 and 20
  1160. c=Random(10)+10 ; between 10 and 20
  1161. ----------------------------------------
  1162. ----------------------------------------
  1163. Run     (program, parameters)
  1164. ........................................
  1165. Runs a "program" with the specified "parameters".
  1166.  
  1167. The program's window is passed a request to show itself as a default window size & position.
  1168.  
  1169. Run("notepad.exe","win.ini")
  1170. run("Clock.exe","") ; note empty parms
  1171.  
  1172. ----------------------------------------
  1173. ----------------------------------------
  1174. RunHide (program, parameters)
  1175. ........................................
  1176. Runs a "program" with the specified "parameters".
  1177.  
  1178. The program's window is passed a request to hide itself.
  1179.  
  1180.  
  1181. RunHide("notepad.exe","win.ini")
  1182. runHide("Clock.exe","") ; no parms
  1183.  
  1184. ----------------------------------------
  1185. ----------------------------------------
  1186. RunIcon (program, parameters)
  1187. ........................................
  1188. Runs a "program" with the specified "parameters".
  1189.  
  1190. The program's window is passed a request to show itself as an icon ('minimized' window).
  1191.  
  1192.  
  1193. RunIcon("notepad.exe","win.ini")
  1194. runIcon("Clock.exe","") ; no parms
  1195.  
  1196. ----------------------------------------
  1197. ----------------------------------------
  1198. RunZoom (program, parameters)
  1199. ........................................
  1200. Runs a "program" with the specified "parameters".
  1201.  
  1202. The program's window is passed a request to show itself as a full-screen ('maximized') window.
  1203.  
  1204.  
  1205. RunZoom("notepad.exe","win.ini")
  1206. runZoom("sol.exe","") ; no parms
  1207.  
  1208. ----------------------------------------
  1209. ----------------------------------------
  1210. SetDisplay (detail, sort, masks)
  1211. ........................................
  1212. Configures the Command Post window.
  1213. detail -  "SHORT" or "LONG"
  1214. sort-      "NAME",KIND","DATE","SIZE",
  1215.                or "UNSORTED"
  1216. masks-  which files to show
  1217. If all parms = "", the current Command Post directory will be refreshed and displayed.
  1218. SetDisplay("SHORT","NAME","*.*"); defalt
  1219. SetDisplay("","","") ; update currdir
  1220. SetDisplay("","","*.EXE *.COM *.BAT")
  1221. ----------------------------------------
  1222. ----------------------------------------
  1223. StrCat (string [,string]...)
  1224. ........................................
  1225. Concatenates any number of strings together and returns the concatenated string.
  1226.  
  1227. crlf=strcat(num2char(13),num2char(10))
  1228. a=strcat("line1",crlf,"line2")
  1229. ;a="line1
  1230. line2"
  1231. ----------------------------------------
  1232. ----------------------------------------
  1233. StrCmp (string1, string2)
  1234. ........................................
  1235. Compares two strings and return one of three possible values:
  1236.  
  1237. if "string1" is before "string2"  -1
  1238. if "string1" equals    "string2"   0
  1239. if "string1" is after  "string2"   1
  1240.  
  1241.  
  1242. ----------------------------------------
  1243. ----------------------------------------
  1244. StrFill (source, length)
  1245. ........................................
  1246. Creates a string by concatenating multiple copies of the "source" string to itself until the string length equals "length".
  1247.  
  1248.  
  1249. aa=Strfill("*",20)
  1250. message("20 Stars",aa)
  1251. ----------------------------------------
  1252. ----------------------------------------
  1253. StrFix (base, pad, length)
  1254. ........................................
  1255. If the "base" string is longer than "length" it will be truncated, else if it's shorter than "length" it will be padded with the "pad" string until it is "length" in size.
  1256. ----------------------------------------
  1257. ----------------------------------------
  1258. StrICmp (string1, string2)
  1259. ........................................
  1260. Compares two strings and returns one of three possible values, IGNORING CASE:
  1261.  
  1262. if "string1" is before "string2"  -1
  1263. if "string1" equals    "string2"   0
  1264. if "string1" is after  "string2"   1
  1265. ----------------------------------------
  1266. ----------------------------------------
  1267. StrIndex (string, substring, start, dir)
  1268. ........................................
  1269. Searches the "string", looking for the first occurrance of the "substring" after the "start" position.  "dir" may be either @FWDSCAN or @BACKSCAN to control the direction of the search.  
  1270. example: to parse filename:
  1271. a=CurrentFile()
  1272. i=strindex(a,".",1,@FWDSCAN)
  1273. root=strsub(a,1,i-1)
  1274. ext =strsub(a,i+1,strlen(a)-i)
  1275. ----------------------------------------
  1276. ----------------------------------------
  1277. StrLen (string)
  1278. ........................................
  1279. Returns the length of a "string".
  1280.  
  1281. a="ABCDE"
  1282. Message("Length of ABCDE is",strlen(a))
  1283. ----------------------------------------
  1284. ----------------------------------------
  1285. StrLower (string)
  1286. ........................................
  1287. Returns the lowercase version of a "string".
  1288.  
  1289. a=AskLine("Please","Enter Name","")
  1290. a=strlower(a)
  1291. b=strsub(a,1,1)
  1292. b=strupper(b)
  1293. c=strsub(a,2,strlen(a)-1)
  1294. a=strcat(b,c)
  1295. Message("Thanx",a)
  1296. ----------------------------------------
  1297. ----------------------------------------
  1298. StrReplace(string,old,new)
  1299. ........................................
  1300. StrReplace scans the 'string', searching for occurrances of 'old' and replacing each occurrance with 'new'.
  1301. e.g. Copy highlited files to clipboard:
  1302.  
  1303.   a=FileItemize("")
  1304.   crlf=StrCat(Num2Char(13),Num2Char(10))
  1305.   StrReplace(a," ",crlf)
  1306.   ClipPut(a)
  1307. ----------------------------------------
  1308. ----------------------------------------
  1309. StrScan (main, delims, start, dir)
  1310. ........................................
  1311. Scans a "string" for the first occurrance of ANY character in the "delims" string.  The scanning starts at "start" position and goes in the "dir" direction, which may be either @FWDSCAN
  1312. or @BACKSCAN.
  1313. ----------------------------------------
  1314. ----------------------------------------
  1315. StrSub (string, start, length)
  1316. ........................................
  1317. Returns the substring of "string" which starts in position "start" and goes for "length" characters.
  1318. ----------------------------------------
  1319. ----------------------------------------
  1320. StrTrim (string)
  1321. ........................................
  1322. Removes all leading and training spaces, if any, from "string" and returns the trimmed string.
  1323. ----------------------------------------
  1324. ----------------------------------------
  1325. StrUpper (string)
  1326. ........................................
  1327. Returns the uppercase version of a "string".
  1328.  
  1329. a=AskLine("Please","Enter Name","")
  1330. a=strlower(a)
  1331. b=strsub(a,1,1)
  1332. b=strupper(b)
  1333. c=strsub(a,2,strlen(a)-1)
  1334. a=strcat(b,c)
  1335. Message("Thanx",a)
  1336. ----------------------------------------
  1337. ----------------------------------------
  1338. Terminate (condition, title, msg)
  1339. ........................................
  1340. Tests a "condition", and cancels the menu item if it = @TRUE.
  1341.  
  1342. If "title" or "msg" are not null strings, displays a message box before terminating.
  1343.  
  1344. a=AskLine("Hi","Enter your age","")
  1345. terminate(!IsNumber(a),"","Use numbers")
  1346. terminate(a<1 || a>100),"ERR","Ha Ha")
  1347. message("Hi","Your age is %a%")
  1348. ----------------------------------------
  1349. ----------------------------------------
  1350. TextBox (title, filename)
  1351. ........................................
  1352. Displays a file in a listbox with a "title".  It may be used for multiline messages or instructions.
  1353.  
  1354. If the user highlights a line, it will be returned as a text string, thus TextBox can also be used as a selection box.
  1355.  
  1356. TextBox("CONFIG.SYS","C:\CONFIG.SYS")
  1357. ----------------------------------------
  1358. ----------------------------------------
  1359. Version ()
  1360. ........................................
  1361. Returns the version of the current Command Post program.
  1362.  
  1363.  
  1364. a=Version()
  1365. Message("Command Post","Version %a%")
  1366. ----------------------------------------
  1367. ----------------------------------------
  1368. WallPaper(bmp-name,tile)
  1369. ........................................
  1370. WallPaper immediately changes the Windows wallpaper.  Can even be used for slide shows. 
  1371.  
  1372. a=FileItemize("*.BMP")
  1373. a=ItemSelect("Select New paper",a," ")
  1374. tile=@FALSE
  1375. if FileSize(a)<40000 then tile=@TRUE  
  1376. Wallpaper(a,tile)
  1377.  
  1378. ----------------------------------------
  1379. ----------------------------------------
  1380. WinActivate (partialwindowname)
  1381. ........................................
  1382. Activates the named window.  Only the first part of the "partialwindowname" is required.
  1383.  
  1384.  
  1385. a=WinItemize()
  1386. a=ItemSelect("Choose a Window",a)
  1387. WinActivate(a)
  1388.  
  1389. ----------------------------------------
  1390. ----------------------------------------
  1391. WinArrange (style)
  1392. ........................................
  1393. Tiles, stacks, arranges in rows or arranges in columns the various open windows on the screen.
  1394.  
  1395. "style" may be @ROWS or @COLUMNS
  1396.         or @STACK or @ARRANGE
  1397.  
  1398. WinArrange("Stack")
  1399. ----------------------------------------
  1400. ----------------------------------------
  1401. WinClose (partialwindowname)
  1402. ........................................
  1403. Closes the first window found in which the first part of the windows name matches "partialwindowname".
  1404.  
  1405.  
  1406. WinClose("Clock")
  1407. WinClose("Clo")
  1408. ----------------------------------------
  1409. ----------------------------------------
  1410. WinCloseNot (pwn [,pwn]...)
  1411. ........................................
  1412. Closes all the windows EXCEPT the ones that match the "partialwindowname"s in the parameter list.
  1413.  
  1414.  
  1415. WinCloseNot("MS-DOS","Clock","PageMa")
  1416. ----------------------------------------
  1417. ----------------------------------------
  1418. WinConfig ()
  1419. ........................................
  1420. Returns the Windows configuration information as a number.  Bits are defined as follows:
  1421.  
  1422. 1  Protect Mode  |  64 8086 CPU     
  1423. 2  80286 CPU     | 128 80186 CPU 
  1424. 4  80386 CPU     | 256 Large PageFrame
  1425. 8  80486 CPU     | 512 Small PageFrame
  1426. 16 Standard Mode |1024 80x87 Installed
  1427. 32 Enhanced Mode |
  1428. ----------------------------------------
  1429. ----------------------------------------
  1430. WinExist (partialwindowname)
  1431. ........................................
  1432. Returns @TRUE or @FALSE, depending on whether a matching window can be found.
  1433.  
  1434.  
  1435.  
  1436.  
  1437. a=WinExist("Clock")
  1438.  
  1439. ----------------------------------------
  1440. ----------------------------------------
  1441. WinGetActive ()
  1442. ........................................
  1443. Returns the complete title of the currently active window.
  1444.  
  1445. Unless a WinActivate or other command was used, WinGetActive will generally return the current Command Post's window title.
  1446.  
  1447. a=WinGetActive()
  1448. Message("Active window was",a)
  1449. ----------------------------------------
  1450. ----------------------------------------
  1451. WinHide (partialwindowname)
  1452. ........................................
  1453. Hides the first window in which the first part of the window name matches "partialwindowname".  The window still exists, but is not available to the user until a WinShow command is executed.
  1454.  
  1455. run("clock.exe","")
  1456. WinHide("Clock")
  1457. ----------------------------------------
  1458. ----------------------------------------
  1459. WinIconize (partialwindowname)
  1460. ........................................
  1461. Iconizes ('minimizes') the first window in which the first part of the window name matches "partialwindowname". 
  1462.  
  1463. Run("Clock.exe","")
  1464. WinIconize("Clock")
  1465.  
  1466. ;equivalent to
  1467. RunIcon("Clock.exe","")
  1468. ----------------------------------------
  1469. ----------------------------------------
  1470. WinItemize ()
  1471. ........................................
  1472. Returns a list of all the currently- running windows, by window title, separated by tabs within the string.
  1473.  
  1474. ;Closes selected window
  1475. a=WinItemize()
  1476. a=ItemSelect("CLOSE",a)
  1477. WinCLose(a)
  1478. ----------------------------------------
  1479. ----------------------------------------
  1480. WinPlace (x-ul, y-ul, x-br, y-br, pwn)
  1481. ........................................
  1482. Places and sizes a window anywhere on the screen.  Use the WININFO.EXE utility to help write the WinPlace statements.
  1483.  
  1484. x-ul   x co-ordinate upper left
  1485. y-ul   y co-ordinate upper left
  1486. x-br   x co-ordinate bottom right
  1487. y-br   y co-ordinate bottom right
  1488. pwn    partial window name
  1489.  
  1490. WinPlace(10,10,300,300,"Clock")
  1491. ----------------------------------------
  1492. ----------------------------------------
  1493. WinPosition (partialwindowname)
  1494. ........................................
  1495. Returns the current Window position information for the selected Window.  It returns 4 comma separated numbers.
  1496.  
  1497. a=WinPosition("Clock")
  1498.  
  1499. A return value for the above function might be "0,0,100,100".
  1500. ----------------------------------------
  1501. ----------------------------------------
  1502. WinShow (partialwindowname)
  1503. ........................................
  1504. Shows the first window in which the first part of the window name matches "partialwindowname".  
  1505.  
  1506. runhide("clock.exe","")
  1507. WinShow("Clock")
  1508. ----------------------------------------
  1509. ----------------------------------------
  1510. WinTitle (pwn, new-name)
  1511. ........................................
  1512. Changes the title of the first window in which the first part of the window name matches "pwn".  That window will be named "new-name".
  1513. A pwn of "" is the current Command Post Window.
  1514. Note:  Some applications do not take kindly to having their window's title changed.
  1515.  
  1516. WinTitle( "", "My Menu")
  1517. ----------------------------------------
  1518. ----------------------------------------
  1519. WinVersion (@MAJOR | @MINOR)
  1520. ........................................
  1521. Returns the version numbers of the current version of Windows.
  1522. "level" = @MAJOR returns the integer part and @MINOR returns the decimal part (to the right of the decimal).
  1523.  
  1524. r=WinVersion(@MAJOR)
  1525. v=WinVersion(@MINOR)
  1526. Message("Windows Version","%r%.%v%")
  1527. ----------------------------------------
  1528. ----------------------------------------
  1529. WinWaitClose (partialwindowname)
  1530. ........................................
  1531. Suspends menu execution until there are no windows in which the first part of the window title matches "partialwindowname".
  1532.  
  1533. run("notepad.exe","special.txt")
  1534. Message("Edit file","Close when done")
  1535. WinWaitClose("Notepad")
  1536. Message("Edit file","You may continue")
  1537. ----------------------------------------
  1538. ----------------------------------------
  1539. WinZoom (partialwindowname)
  1540. ........................................
  1541. Zooms ('maximizes') the first window in which the first part of the window name matches "partialwindowname".  
  1542.  
  1543.  
  1544. Run("clock.exe","")
  1545. WinZoom("Clock")
  1546.  
  1547. ;equivalent to
  1548. RunZoom("clock.exe","")
  1549. ----------------------------------------
  1550. ----------------------------------------
  1551. Yield
  1552. ........................................
  1553. Suspends menu execution for enough time for other windows to process a few messages.
  1554.  
  1555. run("this.exe","")
  1556. run("that.exe","")
  1557. run("andthe.exe","")
  1558. run("other.exe","")
  1559. Yield
  1560. Message("All Done","Now what?")
  1561. ----------------------------------------
  1562.