home *** CD-ROM | disk | FTP | other *** search
/ Windows Shareware GOLD / NuclearComputingVol3No1.cdr / apps / f1340 / winbatch.txt < prev    next >
Text File  |  1991-03-02  |  284KB  |  9,272 lines

  1.                                                                 
  2.  
  3.  
  4.  
  5.                                                      WinBatch User's Manual
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                                  For IBM PC/XT, PC/AT, PS/2 and compatibles
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                                                           Wilson WindowWare
  38.                                             2701 California Ave SW  ste 212
  39.                                                           Seattle, WA 98116
  40.  
  41.  
  42.                                                     Orders:  (800) 762-8383
  43.                                                    Support:  (206) 937-9335
  44.  
  45.                                                        Fax:  (206) 935-7129
  46.  
  47.  
  48.  
  49.  
  50.                          Copyright 1988-1991 by Morrie Wilson.
  51.                                   All rights reserved.
  52.  
  53.  
  54.  
  55.          No part of this manual may be reproduced or transmitted in any form
  56.          or by any means, electronic or mechanical, including photocopying
  57.          and recording, for any purpose without the express written
  58.          permission of Wilson WindowWare, Inc.  Information in this document
  59.          is subject to change without notice and does not represent a
  60.          commitment by Wilson WindowWare, Inc.
  61.  
  62.  
  63.  
  64.          The software described herein is furnished under a license
  65.          agreement.  It is against the law to copy this software under any
  66.          circumstances except as provided by the license agreement.
  67.  
  68.  
  69.  
  70.          U.S. Government Restricted Rights
  71.  
  72.          Use, duplication, or disclosure by the Government is subject to
  73.          restrictions as set forth in subdivision (b)(3)(ii) of the Rights in
  74.          Technical Data and Computer Software clause at 252.227-7013.
  75.          Contractor/manufacturer is Wilson WindowWare, Inc./2701 California Ave
  76.          SW /ste 212/Seattle, WA 98116
  77.  
  78.  
  79.  
  80.          Trademarks
  81.  
  82.          IBM, PC/XT, PC/AT, and PS/2 are registered trademarks of International
  83.          Business Machines Corporation.
  84.          Microsoft and MS-DOS are registered trademarks of Microsoft
  85.          Corporation.
  86.          Windows, Word for Windows, and Excel are trademarks of Microsoft
  87.          Corporation.
  88.  
  89.          Scramble is a trademark of Diana Gruber.
  90.  
  91.          Command Post, WinBatch, and WinEdit are trademarks of Wilson
  92.          WindowWare, Inc.
  93.  
  94.  
  95.  
  96.  
  97.  
  98.                                                                              ii
  99.  
  100.                                                                        CONTENTS
  101.  
  102.  
  103.  
  104.                                         CONTENTS
  105.  
  106.          CONTENTS                              iii
  107.  
  108.          INTRODUCTION                         viii
  109.            System Requirements                viii
  110.            About This Manual                  viii
  111.            Notational Conventions               ix
  112.            Acknowledgements                     ix
  113.  
  114.          GETTING STARTED                         1
  115.  
  116.          TUTORIAL                                2
  117.            WinBatch Basics                       2
  118.               What is a Batch File?              2
  119.               Our First WinBatch File            2
  120.               Functions and Parameters           3
  121.               Displaying Text                    5
  122.               Getting Input                      6
  123.               Using Variables                    7
  124.               Making Decisions                   8
  125.               Branching                         10
  126.            Exploring WinBatch                   12
  127.               Running Programs                  12
  128.               Display and Input                 13
  129.               Manipulating Windows              15
  130.               Files and Directories             19
  131.               Handling Errors                   21
  132.               Selection Menus                   23
  133.               Nicer Display Boxes               26
  134.               Even Nicer Display Boxes          28
  135.               Running DOS Programs              28
  136.               Sending Keystrokes to Programs    29
  137.               Our Completed WinBatch File       30
  138.  
  139.          DIALOG BOXES                           31
  140.  
  141.          WinMacro                               39
  142.            Starting WinMacro                    39
  143.            Macro Definition Files               39
  144.            Hotkeys                              40
  145.            Recording Keystrokes                 41
  146.            WinMacro Example                     42
  147.            WBM files                            42
  148.            Unrecordable Areas                   43
  149.  
  150.          WINBATCH LANGUAGE                      44
  151.  
  152.  
  153.                                                                             iii
  154.  
  155.                                                                        CONTENTS
  156.  
  157.  
  158.            Language Components                  44
  159.               Constants                         44
  160.               Identifiers                       45
  161.               Variables                         45
  162.               Keywords                          46
  163.               Operators                         46
  164.               Precedence and evaluation order   47
  165.               Comments                          47
  166.               Statements                        48
  167.               Substitution                      48
  168.            Function Parameters                  49
  169.            Command-Line Parameters              49
  170.            Error Handling                       50
  171.            The Functions & Statements           51
  172.               Inputting Information             51
  173.               Displaying Information            51
  174.               File Management                   52
  175.               Directory Management              53
  176.               Disk Drive Management             54
  177.               Window Management                 54
  178.               Program Management                56
  179.               String Handling                   56
  180.               Arithmetic Functions              58
  181.               Clipboard Handling                58
  182.               System Control                    58
  183.  
  184.          WBL FUNCTION REFERENCE                 62
  185.            Introduction                         62
  186.            Abs                                  63
  187.            AskLine                              63
  188.            AskYesNo                             64
  189.            Average                              65
  190.            Beep                                 65
  191.            Call                                 66
  192.            CallExt                              67
  193.            Char2Num                             68
  194.            ClipAppend                           69
  195.            ClipGet                              70
  196.            ClipPut                              70
  197.            DateTime                             71
  198.            Debug                                72
  199.            Delay                                73
  200.            DialogBox                            74
  201.            DirChange                            75
  202.            DirGet                               76
  203.            DirHome                              77
  204.            DirItemize                           77
  205.            DirMake                              78
  206.  
  207.  
  208.                                                                              iv
  209.  
  210.                                                                        CONTENTS
  211.  
  212.  
  213.            DirRemove                            79
  214.            DirRename                            79
  215.            DiskFree                             80
  216.            Display                              81
  217.            DOSVersion                           81
  218.            Drop                                 82
  219.            EndSession                           83
  220.            Environment                          83
  221.            ErrorMode                            84
  222.            Execute                              85
  223.            Exit                                 86
  224.            Exclusive                            86
  225.            FileAppend                           87
  226.            FileClose                            88
  227.            FileCopy                             89
  228.            FileDelete                           90
  229.            FileExist                            90
  230.            FileExtension                        91
  231.            FileItemize                          92
  232.            FileLocate                           93
  233.            FileMove                             94
  234.            FileOpen                             95
  235.            FilePath                             96
  236.            FileRead                             96
  237.            FileRename                           97
  238.            FileRoot                             98
  239.            FileSize                             99
  240.            FileWrite                            99
  241.            Goto                                100
  242.            If...Then                           101
  243.            IgnoreInput                         101
  244.            IniRead                             102
  245.            IniReadPvt                          103
  246.            IniWrite                            104
  247.            IniWritePvt                         104
  248.            IsDefined                           105
  249.            IsKeyDown                           106
  250.            IsLicensed                          106
  251.            IsNumber                            107
  252.            ItemCount                           108
  253.            ItemExtract                         108
  254.            ItemSelect                          109
  255.            LastError                           110
  256.            LogDisk                             111
  257.            Max                                 112
  258.            Message                             112
  259.            Min                                 113
  260.            Num2Char                            114
  261.  
  262.  
  263.                                                                               v
  264.  
  265.                                                                        CONTENTS
  266.  
  267.  
  268.            ParseData                           114
  269.            Pause                               115
  270.            Random                              116
  271.            Return                              117
  272.            Run                                 117
  273.            RunHide                             118
  274.            RunIcon                             119
  275.            RunZoom                             120
  276.            SendKey                             121
  277.            SKDebug                             123
  278.            StrCat                              124
  279.            StrCmp                              125
  280.            StrFill                             126
  281.            StrFix                              127
  282.            StriCmp                             127
  283.            StrIndex                            128
  284.            StrLen                              129
  285.            StrLower                            130
  286.            StrReplace                          130
  287.            StrScan                             131
  288.            StrSub                              132
  289.            StrTrim                             133
  290.            StrUpper                            134
  291.            TextBox                             134
  292.            Version                             135
  293.            WallPaper                           136
  294.            WinActivate                         136
  295.            WinArrange                          137
  296.            WinClose                            138
  297.            WinCloseNot                         139
  298.            WinConfig                           139
  299.            WinExist                            140
  300.            WinGetActive                        141
  301.            WinHide                             142
  302.            WinIconize                          142
  303.            WinItemize                          143
  304.            WinPlace                            144
  305.            WinPosition                         145
  306.            WinShow                             146
  307.            WinTitle                            147
  308.            WinVersion                          148
  309.            WinWaitClose                        149
  310.            WinZoom                             150
  311.            Yield                               150
  312.  
  313.          APPENDIX A  Predefined Constants      152
  314.  
  315.          APPENDIX B  Errors                    153
  316.  
  317.  
  318.                                                                              vi
  319.  
  320.                                                                        CONTENTS
  321.  
  322.  
  323.            Minor Errors                        153
  324.            Moderate Errors                     154
  325.            Fatal Errors                        155
  326.  
  327.          Index                                 157
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.                                                                             vii
  374.  
  375.                                                                    INTRODUCTION
  376.  
  377.  
  378.  
  379.                                       INTRODUCTION
  380.  
  381.          WinBatch brings the power of batch language programming to the Windows
  382.          environment.  Although WinBatch can do everything that the familiar
  383.          DOS batch language can do, the capabilities of WinBatch begin where
  384.          the DOS batch language leaves off.
  385.  
  386.          With more than a hundred functions and commands, WinBatch can:
  387.  
  388.            *  Run Windows and DOS programs.
  389.            *  Send keystrokes directly to applications.
  390.            *  Rearrange, resize, hide, and close windows.
  391.            *  Run programs either concurrently or sequentially.
  392.            *  Display information to the user in various formats.
  393.            *  Prompt the user for any needed input.
  394.            *  Present scrollable file and directory lists.
  395.            *  Copy, move, delete, and rename files.
  396.            *  Read and write files directly.
  397.            *  Copy text to and from the Clipboard.
  398.            *  Perform string and arithmetic operations.
  399.            *  Make branching decisions based upon numerous factors.
  400.  
  401.  
  402.          And much, much more.
  403.  
  404.          Whether you are creating batch files for others, or looking for a way
  405.          to automate your own work and eliminate the drudgery of repetitive
  406.          tasks, you will find WinBatch to be a powerful, versatile, and easy-
  407.          to-use tool.
  408.  
  409.  
  410.  
  411.                                   System Requirements
  412.  
  413.          WinBatch requires an IBM PC or compatible with a minimum of 640K
  414.          memory running Microsoft Windows version 3.0 or higher.
  415.  
  416.  
  417.  
  418.                                    About This Manual
  419.  
  420.          This manual is divided into six sections:  First is Getting Started
  421.          (pg. 1), where we tell you how to install the program.  Then we offer
  422.          an extensive Tutorial (pg. 2), to get both beginning and advanced
  423.          users quickly up to speed with creating WinBatch files, followed by
  424.          separate sections on Dialog Boxes (pg. 31) and WinMacro (pg. 39).
  425.          Then we describe the different elements of the WinBatch Language (WBL)
  426.  
  427.  
  428.                                                                            viii
  429.  
  430.                                                                    INTRODUCTION
  431.  
  432.  
  433.          (pg. 44).  Finally, there is a comprehensive WBL Function Reference
  434.          (pg. 62), which contains  detailed information on each of the WinBatch
  435.          functions and commands.
  436.  
  437.  
  438.  
  439.                                  Notational Conventions
  440.  
  441.          Throughout this manual, we use the following conventions to
  442.          distinguish elements of text:
  443.  
  444.          ALL-CAPS
  445.  
  446.            Used for filenames.
  447.  
  448.          Boldface
  449.  
  450.            Used for important points, programs, function names, and parts of
  451.            syntax that must appear as shown.
  452.  
  453.          system
  454.  
  455.            Used for menu items as they appear to the user.
  456.  
  457.          Small fixed-width
  458.  
  459.            Used for batch file sample code.
  460.  
  461.          Italics
  462.  
  463.            Used for emphasis, and to liven up the dull software documentation
  464.            just a little.
  465.  
  466.  
  467.  
  468.                                     Acknowledgements
  469.  
  470.          WinBatch designed and written by Morrie Wilson.
  471.  
  472.          User's Manual designed by Richard Merit, written by Richard Merit and
  473.          Morrie Wilson.
  474.  
  475.          Our thanks to the many beta-testers for their invaluable comments and
  476.          suggestions.
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.                                                                              ix
  484.  
  485.  
  486.                                                                 GETTING STARTED
  487.  
  488.  
  489.                                     GETTING STARTED
  490.  
  491.          WinBatch is quite easy to install.  You will find an appropriate
  492.          diskette in your WinBatch package.  Take the diskette and insert it
  493.          into your floppy drive.  The WinBatch installation program is itself a
  494.          Windows application, so make sure Windows is running.
  495.  
  496.          From the Program Manager, doubleclick on the File Manager icon to run
  497.          it.  When File Manager starts, click on the A: or B: drive icon,
  498.          depending on which floppy drive you used.  A directory tree will
  499.          appear for the WinBatch diskette.  You should see a root directory
  500.          icon.  Doubleclick on this icon and a list of filenames will appear.
  501.          Find the filename SETUP.EXE and doubleclick on it.  Follow whatever
  502.          instructions Setup gives you.
  503.  
  504.          Setup will create the necessary files and place them into a directory
  505.          it will prompt you for.
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.                                                                               1
  537.  
  538.                                                                        TUTORIAL
  539.  
  540.  
  541.  
  542.                                         TUTORIAL
  543.  
  544.  
  545.  
  546.                                     WinBatch Basics
  547.  
  548.  
  549.          What is a Batch File?
  550.  
  551.          A batch file, whether a DOS batch file or a WinBatch file, is simply a
  552.          list of commands for the computer to process.  Any task which will be
  553.          run more than once, or which requires entering many commands or even a
  554.          single complex command, is a candidate for a batch file.  For example,
  555.          suppose you regularly enter the following commands to start Windows:
  556.  
  557.          First:
  558.  
  559.            cd\windows
  560.  
  561.          then:
  562.  
  563.            win
  564.  
  565.          and then:
  566.  
  567.            cd\
  568.  
  569.          Here, you are changing to the Windows directory, running Windows, and
  570.          then returning to the root directory.  Instead of having to type these
  571.          three commands every time you run Windows, you can create a DOS batch
  572.          file, called WI.BAT, which contains those exact same commands:
  573.  
  574.            cd\windows
  575.            win
  576.            cd\
  577.  
  578.          Now, to start Windows, you merely need to type the single command WI,
  579.          which runs the WI.BAT batch file, which executes your three commands.
  580.  
  581.          WinBatch files work basically the same way.
  582.  
  583.  
  584.          Our First WinBatch File
  585.  
  586.          Our first Winbatch file will simply run our favorite Windows
  587.          application: Solitaire.  First, start up Notepad, or any other editor
  588.  
  589.  
  590.  
  591.                                                                               2
  592.  
  593.                                                                        TUTORIAL
  594.  
  595.  
  596.          which is capable of saving text in pure ASCII format (may we suggest
  597.          WinEdit, from Wilson WindowWare).  Enter the following line of text:
  598.  
  599.            Run("sol.exe", "")
  600.  
  601.          Save the file with the name SOLITARE.WBT.  Now, run SOLITARE.WBT by
  602.          starting or switching to the File Manager (or MS-DOS Executive), and
  603.          either moving the cursor to the file name and pressing Enter, or
  604.          double-clicking on the file name with your mouse.  Presto!  It's
  605.          Solitaire.
  606.  
  607.          Okay, that wasn't really so impressive.  But it did serve to
  608.          illustrate several important WinBatch points.  They are:
  609.  
  610.          1. WinBatch files must be edited and saved in ASCII format.
  611.  
  612.          2. WinBatch files should be given a WBT extension.  When WinBatch is
  613.             first installed, it creates an entry in your WIN.INI file which
  614.             causes files with a WBT extension to be associated with WinBatch.
  615.             As long as WINBATCH.EXE is located in your DOS path, you can place
  616.             WBT files in any directory and run them by simply selecting them,
  617.             as we did above.
  618.  
  619.          3. After you have created a WBT file, you run it by moving your cursor
  620.             to it and pressing Enter, or double-clicking on it with your mouse
  621.             (you can also add a WBT file to a program group and run it using
  622.             the Program Manager; see your Windows manual for further
  623.             information).  Whatever method you use, we'll use the term Run to
  624.             refer to selecting and running the file.
  625.  
  626.  
  627.          Functions and Parameters
  628.  
  629.          Now, let's look more closely at the line we entered:
  630.  
  631.            Run("sol.exe", "")
  632.  
  633.          The first part, Run, is a WinBatch function.  As you might have
  634.          guessed, its purpose is to run a Windows program.  There are over a
  635.          hundred different functions and commands in WinBatch, and each has a
  636.          certain syntax which must be used.  The correct syntax for all
  637.          WinBatch functions may be found in the WBL Function Reference
  638.          (pg. 62).  The entry for Run starts off as follows:
  639.  
  640.          Syntax:
  641.  
  642.            Run (program-name, parameters)
  643.  
  644.  
  645.  
  646.                                                                               3
  647.  
  648.                                                                        TUTORIAL
  649.  
  650.  
  651.          Parameters:
  652.  
  653.            "program-name" = the name of the desired .EXE, .COM, .PIF, .BAT
  654.                             file, or a data file.
  655.  
  656.            "parameters" =   optional parameters as required by the
  657.                             application.
  658.  
  659.          Like all WinBatch functions, Run is followed by a number of
  660.          parameters, enclosed in parentheses.  Parameters are simply additional
  661.          information which are provided when a particular function is used;
  662.          they may be either required or optional.  Optional parameters are
  663.          indicated by being enclosed in square brackets.  In this case, Run has
  664.          two required parameters: the name of the program to run, and the
  665.          parameters to be passed to the program.
  666.  
  667.          WinBatch functions use several types of parameters.  Multiple
  668.          parameters are separated by commas.  In the example
  669.  
  670.            Run("sol.exe", "")
  671.  
  672.          "sol.exe" and "" are both string constants.  String constants can be
  673.          identified by the quote marks which delimit (surround) them.  You may
  674.          use either double ("), single forward (') or single back (`) quote
  675.          marks as string delimiters; the examples in this manual will use
  676.          double quotes.
  677.  
  678.          You may have noticed how we said earlier that the two parameters for
  679.          the Run function are required, and yet the entry for Run in the WBL
  680.          Function Reference describes the second parameter -- "parameters" --
  681.          as being optional.  Which is correct?  Well, from a language
  682.          standpoint, the second parameter is required.  That is, if you omit
  683.          it, you will get a syntax error, and your batch file will not run
  684.          properly.  However, the program that you are running may not need any
  685.          parameters.  Solitaire, for example, does not take any parameters.
  686.          The way we handle this in our batch file is to specify a null string
  687.          -- two quote marks with nothing in between -- as the second parameter,
  688.          as we have done in our example above.
  689.  
  690.          To illustrate this further, let's create a WinBatch file called
  691.          EDIT.WBT, containing the following line:
  692.  
  693.            Run("notepad.exe", "")
  694.  
  695.          This is just like our previous file, with only the name of the program
  696.          having been changed.  Save the file, and run it.  You should now be in
  697.          Notepad.  Now edit the EDIT.WBT file as follows:
  698.  
  699.  
  700.  
  701.                                                                               4
  702.  
  703.                                                                        TUTORIAL
  704.  
  705.  
  706.            Run("notepad.exe", "solitare.wbt")
  707.  
  708.          Save the file, exit Notepad, and run EDIT.WBT again.  You should now
  709.          be in Notepad, with SOLITARE.WBT loaded.  As we've just demonstrated,
  710.          Notepad is an example of a program which can be run with or without a
  711.          file name parameter passed to it by WinBatch.
  712.  
  713.          Before you leave Notepad, modify EDIT.WBT as follows:
  714.  
  715.            ; This is an example of the Run function in WinBatch
  716.            Run("notepad.exe", "solitare.wbt")
  717.  
  718.          The semicolon at the beginning of the first line signifies a comment,
  719.          and causes that line to be ignored.  You can place comment lines,
  720.          and/or blank lines anywhere in your WinBatch files.  In addition, you
  721.          can place a comment on the same line as a function by preceding the
  722.          comment with a semicolon.  For example:
  723.  
  724.            Run("sol.exe", "")    ; this is a very useful function
  725.  
  726.          Everything to the right of a semicolon is ignored.  However, if a
  727.          semicolon appears in a string delimited by quotes, it is treated as
  728.          part of the string.
  729.  
  730.  
  731.          Displaying Text
  732.  
  733.          Now, let's modify our SOLITARE.WBT file as follows.  You might as well
  734.          use the EDIT.WBT batch file you created earlier to start up Notepad:
  735.  
  736.            ; solitare.wbt
  737.            Display(5, "Good Luck!", "Remember ... it's only a game.")
  738.            Run("sol.exe", "")
  739.  
  740.          And run it.  Notice the message box which pops up on the screen with
  741.          words of encouragement.
  742.  
  743.          That's done by the Display function in the second line above.  Here's
  744.          the reference for Display:
  745.  
  746.          Syntax:
  747.  
  748.            Display (seconds, title, text)
  749.  
  750.          Parameters:
  751.  
  752.            seconds =    integer seconds to display the message (1-15).
  753.            "title" =    Title of the window to be displayed.
  754.  
  755.  
  756.                                                                               5
  757.  
  758.                                                                        TUTORIAL
  759.  
  760.  
  761.            "text" =     Text of the window to be displayed.
  762.  
  763.          Note that the Display function has three parameters.  The first
  764.          parameter -- in our example, 5 -- is the number of seconds which the
  765.          display box will remain on the screen (you can make the box disappear
  766.          before then by pressing any key or mouse button).  This is a numeric
  767.          constant, and -- unlike string constants -- it does not need to be
  768.          enclosed in quotes (although it can be, if you wish, as WinBatch will
  769.          automatically try to convert string variables to numeric variables
  770.          when necessary, and vice versa).  The second parameter is the title of
  771.          the message box, and the third parameter is the actual text displayed
  772.          in the box.  Now, exit Solitaire (if you haven't already done so), and
  773.          edit SOLITARE.WBT by placing a semicolon at the beginning of the line
  774.          with the Run function.  This is a handy way to disable, or "comment
  775.          out," lines in your WinBatch files when you want to modify and test
  776.          only certain segments.  Your SOLITARE.WBT file should look like this:
  777.  
  778.            ; solitare.wbt
  779.            Display(5, "Good Luck!", "Remember ... it's only a game.")
  780.            ; Run("sol.exe", "")
  781.  
  782.          Now, experiment with modifying the parameters in the Display function.
  783.          Try adjusting the value of the first parameter.  If you look up
  784.          Display in the WBL reference section, you will see that the acceptable
  785.          values for this parameter are 1-15.  If you use a value outside this
  786.          range, WinBatch will adjust it to "make it fit"; that is, it will
  787.          treat numbers less than 1 as if they were 1, and numbers greater than
  788.          15 as 15.  Experiment.  Also, try using a non-integer value, such as
  789.          2.5, and see what happens.  Play around with the text in the two
  790.          string parameters; try making one, or both, null strings ("").
  791.  
  792.  
  793.          Getting Input
  794.  
  795.          Now, let's look at ways of getting input from a user and making
  796.          decisions based on that input.  The most basic form of input is a
  797.          simple Yes/No response, and, indeed, there is a WinBatch function
  798.          called AskYesNo:
  799.  
  800.          Syntax:
  801.  
  802.            AskYesNo (title, question)
  803.  
  804.          Parameters
  805.  
  806.            "title" =    title of the question box.
  807.            "question" = question to be put to the user.
  808.  
  809.  
  810.  
  811.                                                                               6
  812.  
  813.                                                                        TUTORIAL
  814.  
  815.  
  816.          Returns:
  817.  
  818.            (integer)    @YES or @NO, depending on the button pressed.
  819.  
  820.          You should be familiar with the standard syntax format by now; it
  821.          shows us that AskYesNo has two required parameters.  The Parameters
  822.          section tells us that these parameters both take strings (indicated by
  823.          the quote marks), and tells us what each of the parameters means.
  824.  
  825.          You will notice that there is also a new section here, titled Returns.
  826.          This section shows you the possible values that may be returned by
  827.          this function.  All functions return values.  We weren't concerned
  828.          with the values returned by the Run and Display functions.  But with
  829.          AskYesNo, the returned value is very important, because we will need
  830.          that information to decide how to proceed.  We see that AskYesNo
  831.          returns an integer value.  An integer is a whole (non-fractional)
  832.          number, such as 0, 1, or 2 (the number 1.5 is not an integer).  We
  833.          also see that the integer value returned by AskYesNo is either @YES or
  834.          @NO.  @YES and @NO are predefined constants in WinBatch.  All
  835.          predefined constants begin with an @ symbol, and we will distinguish
  836.          them further by typing them in all caps.  You will find a list of all
  837.          predefined constants in Appendix A (pg. 152).  Even though the words
  838.          Yes and No are strings, it is important to remember that the
  839.          predefined constants @YES and @NO are not string variables (actually,
  840.          @YES is equal to 1, and @NO is equal to 0.  Don't worry if this is
  841.          confusing; you don't need to remember it).
  842.  
  843.          Now, let's modify our SOLITARE.WBT file as follows:
  844.  
  845.            AskYesNo("Really?", "Play Solitaire now?")
  846.            Run("sol.exe", "")
  847.  
  848.          and run it.  You should have gotten a nice dialog box which asked if
  849.          you wanted to play Solitaire, but no matter what you answered, it
  850.          started Solitaire anyway.  This is not very useful.  We need a way to
  851.          use the Yes/No response to determine further processing.  First, we
  852.          need to explore the concept and use of variables.
  853.  
  854.  
  855.          Using Variables
  856.  
  857.          A variable is simply a placeholder for a value.  The value that the
  858.          variable stands for can be either a text string (string variable) or a
  859.          number (numeric variable).  You may remember from Algebra 101 that if
  860.          X=3, then X+X=6.  X is simply a numeric variable, which stands here
  861.          for the number 3.  If we change the value of X to 4 (X=4), then the
  862.          expression X+X is now equal to 8.
  863.  
  864.  
  865.  
  866.                                                                               7
  867.  
  868.                                                                        TUTORIAL
  869.  
  870.  
  871.          Okay.  We know that the AskYesNo function returns a value of either
  872.          @YES or @NO.  What we need to do is create a variable to store the
  873.          value that AskYesNo returns, so that we can use it later on in our
  874.          batch file.  First, we need to give this variable a name.  In
  875.          WinBatch, variable names must begin with a letter, may contain any
  876.          combination of letters or numbers, and may be from 1 to 30 characters
  877.          long.  So, let's use a variable called response (we will distinguish
  878.          variable names in this text by typing them in all lowercase letters;
  879.          we will type function and command names starting with a capital
  880.          letter.  However, in WinBatch, the case is not significant, so you can
  881.          use all lowercase, or all uppercase, or whatever combination you
  882.          prefer).  We assign the value returned by AskYesNo to the variable
  883.          response, as follows:
  884.  
  885.            response = AskYesNo("Really?", "Play Solitaire now?")
  886.  
  887.          Notice the syntax.  The way that WinBatch processes this line is to
  888.          first evaluate the result of the AskYesNo function.  The function
  889.          returns a value of either @YES or @NO.  Then, WinBatch assigns this
  890.          returned value to response.  Therefore, response is now equal to
  891.          either @YES or @NO, depending on what the user enters.
  892.  
  893.          Now, we need a way to make a decision based upon this variable.
  894.  
  895.  
  896.          Making Decisions
  897.  
  898.          WinBatch provides a way to conditionally execute a statement, and that
  899.          is by using the If ... Then command.  Actually, there are two separate
  900.          parts to this construct: If and Then.  The format is:
  901.  
  902.            If condition Then statement
  903.  
  904.          (We refer to If ... Then as a command, rather than a function, because
  905.          functions are followed by parameters in parentheses, while commands
  906.          are not.  Commands are used for system control.)
  907.  
  908.          The use of If ... Then can easily be illustrated by going back to our
  909.          SOLITARE.WBT file, and making these modifications:
  910.  
  911.            response = AskYesNo("Really?", "Play Solitaire now?")
  912.            If response == @YES Then Run("sol.exe", "")
  913.  
  914.          In this example, we are using If ... Then to test whether the value of
  915.          the variable response is @YES.  If it is @YES, we start Solitaire.  If
  916.          it isn't @YES, we don't.  The rule is: if the condition following the
  917.          If keyword is true, then the statement following the Then keyword is
  918.  
  919.  
  920.  
  921.                                                                               8
  922.  
  923.                                                                        TUTORIAL
  924.  
  925.  
  926.          performed.  If the condition following the If keyword is false, then
  927.          anything following the Then keyword is ignored.
  928.  
  929.          There is something extremely important that you should note about the
  930.          syntax of the If ... Then command: the double equal signs (==).  In
  931.          WinBatch, a single equal sign (=) is an assignment operator -- it
  932.          assigns the value on the right of the equal sign to the variable on
  933.          the left of the equal sign.  As in:
  934.  
  935.            response = AskYesNo("Really?", "Play Solitaire now?")
  936.  
  937.          This is saying, in English: "Assign the value returned by the AskYesNo
  938.          function to the variable named response."  But in the statement:
  939.  
  940.            If response == @YES Then Run("sol.exe", "")
  941.  
  942.          we do not want to assign a new value to response, we merely want to
  943.          test whether it is equal to @YES.  Therefore, we use the double equal
  944.          signs (==), which is the equality operator in WinBatch.  The statement
  945.          above is saying, in English: "If the value of the variable named
  946.          response is equal to @YES, then run the program SOL.EXE."  If you used
  947.          a single equal sign (=) here by mistake, you would get an error
  948.          message, which is WinBatch's way of telling you to re-check your
  949.          syntax.
  950.  
  951.          If you've become confused, just remember that a single equal sign (=)
  952.          is an assignment operator, used to assign a value to a variable.
  953.          Double equal signs (==) are an equality operator, used to test whether
  954.          the values on both sides of the operator are the same.  If you have a
  955.          problem with one of your WinBatch files, make sure to check whether
  956.          you've used one of these symbols incorrectly.  It's a very common
  957.          mistake, which is why we emphasize it so strongly!
  958.  
  959.          We've seen what happens when the condition following the Then keyword
  960.          is true.  But what happens when it is false?  Remember we said that
  961.          when the If condition is false, the Then statement is ignored.  There
  962.          will be times, however when we want to perform an alternate action in
  963.          this circumstance.  For example, suppose we want to display a message
  964.          if the user decides that he or she doesn't want to play Solitaire.  We
  965.          could write:
  966.  
  967.            response = AskYesNo("Really?", "Play Solitaire now?")
  968.            If response == @YES Then Run("sol.exe", "")
  969.            If response == @NO Then Display(5, "", "Game canceled")
  970.  
  971.          In this case there are two If statements being evaluated, with one and
  972.          only one of them possibly being true (unless the user selects Cancel,
  973.          which would abort the batch file entirely).  However, this is
  974.  
  975.  
  976.                                                                               9
  977.  
  978.                                                                        TUTORIAL
  979.  
  980.  
  981.          inefficient from a processing standpoint.  Furthermore, what would
  982.          happen if you had several functions you wanted to perform if the user
  983.          answered Yes?  You would end up with something unwieldy:
  984.  
  985.            response = AskYesNo("Really?", "Play Solitaire now?")
  986.            If response == @YES Then Display(5, "", "On your mark ...")
  987.            If response == @YES Then Display(5, "", "Get set ...")
  988.            If response == @YES Then Display(5, "", "Go!")
  989.            If response == @YES Then Run("sol.exe", "")
  990.  
  991.          Clearly, there must be a better way of handling this.
  992.  
  993.  
  994.          Branching
  995.  
  996.          Enter the Goto command.  Goto, in combination with If ... Then, gives
  997.          you the ability to redirect the flow of control in your WinBatch
  998.          files.  Goto does exactly what it says -- it causes the flow of
  999.          control to go to another point in the batch file.  You must specify
  1000.          where you want the flow of control to be transferred, and you must
  1001.          mark this point with a label.  A label is simply a destination
  1002.          address, or marker.  The form of the Goto command is:
  1003.  
  1004.            Goto label
  1005.  
  1006.          where label is an identifier that you specify.  The same rules apply
  1007.          to label names as to variable names (the first character must be a
  1008.          letter, the label name may consist of any combination of letters and
  1009.          numbers, and the label name may be from 1 to 30 characters long).  In
  1010.          addition, the label is preceded by a colon (:) at the point where it
  1011.          is being used as a destination address.  Here's an example:
  1012.  
  1013.            response = AskYesNo("Really?", "Play Solitaire now?")
  1014.            If response == @NO Then Goto quit
  1015.            Display(5, "", "On your mark ...")
  1016.            Display(5, "", "Get set ...")
  1017.            Display(5, "", "Go!")
  1018.            Run("sol.exe", "")
  1019.            :quit
  1020.  
  1021.          If the If condition is true (that is, if the user answers No), then
  1022.          the Goto statement is performed.  The Goto statement is saying, in
  1023.          English "go to the line marked :quit, and continue processing from
  1024.          there."  Notice how the label quit is preceded by a colon on the last
  1025.          line, but not on the line where it follows the Goto keyword.  This is
  1026.          important.  Although you can have multiple lines in your batch file
  1027.          which say Goto quit, you can have only one line marked :quit (just
  1028.          like you can have several people going to your house, but can have
  1029.  
  1030.  
  1031.                                                                              10
  1032.  
  1033.                                                                        TUTORIAL
  1034.  
  1035.  
  1036.          only one house with a particular address).  Of course, you can use
  1037.          many different labels in a batch file, just as you can use many
  1038.          different variables, as long as each has a unique name.  For example:
  1039.  
  1040.            response = AskYesNo("Really?", "Play Solitaire now?")
  1041.            If response == @NO Then Goto quit
  1042.            Display(5, "", "On your mark ...")
  1043.            Display(5, "", "Get set ...")
  1044.            Display(5, "", "Go!")
  1045.            Run("sol.exe", "")
  1046.            Goto done
  1047.            :quit
  1048.            Display(5, "", "Game canceled")
  1049.            :done
  1050.  
  1051.          This is a little more complicated.  It uses two labels, quit and done.
  1052.          If the user answers No, then the If condition is true, control passes
  1053.          to the line marked :quit, and a message is displayed.  If, on the
  1054.          other hand, the user answers Yes, then the If condition is false, and
  1055.          the Goto quit line is ignored.  Instead, the next four lines are
  1056.          processed, and then the Goto done statement is performed.  The purpose
  1057.          of this line is to bypass the Display line which follows, by
  1058.          transferring control to the end of the batch file.  There is another
  1059.          way to keep your batch file processing from "falling through" to
  1060.          unwanted lines at the end of a program, and that is with the Exit
  1061.          command.  Exit causes a batch file to end immediately.  So, for
  1062.          example, we could rewrite the above batch file as follows:
  1063.  
  1064.            response = AskYesNo("Really?", "Play Solitaire now?")
  1065.            If response == @NO Then Goto quit
  1066.            Display(5, "", "On your mark ...")
  1067.            Display(5, "", "Get set ...")
  1068.            Display(5, "", "Go!")
  1069.            Run("sol.exe", "")
  1070.            Exit
  1071.            :quit
  1072.            Display(5, "", "Game canceled")
  1073.  
  1074.          Since the Run function is the last thing we want to do if the user
  1075.          answers Yes, the Exit command simply ends the program at that point.
  1076.          Note that we could put an Exit command at the end of the program as
  1077.          well, but it isn't necessary.  An Exit is implied at the end of a
  1078.          WinBatch program.
  1079.  
  1080.          This concludes the first part of our tutorial.  You now have the
  1081.          building blocks you need to create useful WinBatch files.  In the
  1082.          second part, which follows, we will look in more detail at some of the
  1083.          WinBatch functions which are available for your use.
  1084.  
  1085.  
  1086.                                                                              11
  1087.  
  1088.                                                                        TUTORIAL
  1089.  
  1090.  
  1091.                                    Exploring WinBatch
  1092.  
  1093.          What follows is just a sample of the many functions and commands
  1094.          available in WinBatch.  These should be sufficient to begin creating
  1095.          versatile and powerful batch files.  For complete information on these
  1096.          and all WinBatch functions and commands, refer to the WBL Function
  1097.          Reference (pg. 62).
  1098.  
  1099.  
  1100.          Running Programs
  1101.  
  1102.          There are three functions which you can use to start an application,
  1103.          each of which shares a common syntax:
  1104.  
  1105.  
  1106.          Run (program-name, parameters)
  1107.  
  1108.          We've already seen the Run function.  This function starts a program
  1109.          in a "normal" window.  Windows decides where to place the
  1110.          application's  window on the screen.
  1111.  
  1112.          Example:
  1113.  
  1114.            Run("notepad.exe", "myfile.txt")
  1115.  
  1116.          If the program has an EXE extension, its extension may be omitted:
  1117.  
  1118.            Run("notepad", "myfile.txt")
  1119.  
  1120.          Also, you can "run" data files if they have an extension in WIN.INI
  1121.          which is associated with an executable program.  So, if TXT files are
  1122.          associated with Notepad:
  1123.  
  1124.            Run("myfile.txt", "")
  1125.  
  1126.          would start Notepad, using the file MYFILE.TXT.
  1127.  
  1128.          When you specify a file to run, WinBatch looks first in the current
  1129.          directory, and then in the directories on your DOS path.  If the file
  1130.          is not found, WinBatch will return an error.  You can also specify a
  1131.          full path name for WinBatch to use, as in:
  1132.  
  1133.            Run("c:\windows\apps\winedit.exe", "")
  1134.  
  1135.  
  1136.          RunZoom (program-name, parameters)
  1137.  
  1138.          RunZoom is like Run, but starts a program as a full-screen window.
  1139.  
  1140.  
  1141.                                                                              12
  1142.  
  1143.                                                                        TUTORIAL
  1144.  
  1145.  
  1146.          Example:
  1147.  
  1148.            RunZoom("excel", "bigsheet.xls")
  1149.  
  1150.  
  1151.          RunIcon (program-name, parameters)
  1152.  
  1153.          RunIcon starts a program as an icon at the bottom of the screen.
  1154.  
  1155.          Example:
  1156.  
  1157.            RunIcon("clock", "")
  1158.  
  1159.  
  1160.          Display and Input
  1161.  
  1162.          Here we have functions which display information to the user and
  1163.          prompt the user for information, plus a couple of relevant system
  1164.          functions.
  1165.  
  1166.  
  1167.          Display (seconds, title, text)
  1168.  
  1169.          Displays a message to the user for a specified period of time.  The
  1170.          message will disappear after the time expires, or after any keypress
  1171.          or mouse click.
  1172.  
  1173.          Example:
  1174.  
  1175.            Display(2, "", "Loading Solitaire now")
  1176.  
  1177.  
  1178.          Message (title, text)
  1179.  
  1180.          This command displays a message box with a title and text you specify,
  1181.          which will remain on the screen until the user presses the OK button.
  1182.  
  1183.          Example:
  1184.  
  1185.            Message("Sorry", "That file cannot be found")
  1186.  
  1187.  
  1188.          Pause (title, text)
  1189.  
  1190.          This command is similar to Message, except an exclamation-point icon
  1191.          appears in the message box, and the user can press OK or Cancel.  If
  1192.          the user presses Cancel, the batch file exits.
  1193.  
  1194.  
  1195.  
  1196.                                                                              13
  1197.  
  1198.                                                                        TUTORIAL
  1199.  
  1200.  
  1201.          Example:
  1202.  
  1203.            Pause("Delete Backups", "Last chance to stop!")
  1204.            ; if batch file gets this far, the user pressed OK
  1205.            FileDelete("*.bak")
  1206.  
  1207.  
  1208.          AskYesNo (title, question)
  1209.  
  1210.          Displays a dialog box with a given title, which presents the user with
  1211.          three buttons: Yes, No, and Cancel.  If the user selects the Cancel
  1212.          button, the batch file is terminated.
  1213.          Example:
  1214.  
  1215.            response = AskYesNo("End Session", "Really quit Windows?")
  1216.  
  1217.  
  1218.          AskLine (title, prompt, default)
  1219.  
  1220.          Displays a dialog box with a given title, which prompts the user for a
  1221.          line of input.  Returns the default if the user just presses the OK
  1222.          button.
  1223.  
  1224.          Example:
  1225.  
  1226.            yourfile = AskLine("Edit File", "Filename:", "newfile.txt")
  1227.            Run("notepad", yourfile)
  1228.  
  1229.          If you specify a default value (as we have with NEWFILE.TXT), it will
  1230.          appear in the response box, and will be replaced with whatever the
  1231.          user types.  If the user doesn't type anything, the default is used.
  1232.  
  1233.  
  1234.          Beep
  1235.  
  1236.          Beeps once.
  1237.  
  1238.            Beep
  1239.  
  1240.          And if one beep isn't enough for you:
  1241.  
  1242.            Beep
  1243.            Beep
  1244.            Beep
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                                                                              14
  1252.  
  1253.                                                                        TUTORIAL
  1254.  
  1255.  
  1256.          Delay (seconds)
  1257.  
  1258.          Pauses batch file execution.
  1259.  
  1260.          The Delay function lets you suspend batch file processing for 1 to 15
  1261.          seconds.  You can use multiple occurrences for a longer delay:
  1262.  
  1263.            Delay(15)
  1264.            Delay(15)
  1265.  
  1266.          Will insert a 30-second pause.
  1267.  
  1268.  
  1269.          Manipulating Windows
  1270.  
  1271.          There are a large number of functions which allow you to manage the
  1272.          windows on your desktop.  Here are some of them:
  1273.  
  1274.  
  1275.          WinZoom (partial-windowname)
  1276.  
  1277.          Maximizes an application window to full-screen.
  1278.  
  1279.  
  1280.          WinIconize (partial-windowname)
  1281.  
  1282.          Turns an application window into an icon.
  1283.  
  1284.  
  1285.          WinShow (partial-windowname)
  1286.  
  1287.          Shows a window in its "normal" state.
  1288.  
  1289.          These three functions are used to modify the size of an already-
  1290.          running window.  WinZoom is the equivalent of selecting Maximize from
  1291.          a window's control menu, WinIconize is like selecting Minimize, and
  1292.          WinShow is like selecting Restore.
  1293.  
  1294.          The window on which you are performing any of these functions does not
  1295.          have to be the active window.  If the specified window is in the
  1296.          background, and a WinZoom or WinShow function causes the size of the
  1297.          window to change, then the window will be brought to the foreground.
  1298.          The WinZoom function has no effect on a window which is already
  1299.          maximized; likewise, WinShow has no effect on a window which is
  1300.          already "normal."
  1301.  
  1302.          Each of these functions accepts a partial windowname as a parameter.
  1303.          The windowname is the name which appears in the title bar at the top
  1304.  
  1305.  
  1306.                                                                              15
  1307.  
  1308.                                                                        TUTORIAL
  1309.  
  1310.  
  1311.          of the window.  You can specify the full name if you wish, but it may
  1312.          often be advantageous not to have to do so.  For example, if you are
  1313.          editing the file SOLITARE.WBT in a Notepad window, the windowname will
  1314.          be Notepad - SOLITARE.WBT:
  1315.  
  1316.          You probably don't want to have to hard-code this entire name into
  1317.          your batch file as:
  1318.  
  1319.            WinZoom("Notepad - SOLITARE.WBT")
  1320.  
  1321.          Instead, you can specify the partial windowname "Notepad":
  1322.  
  1323.            WinZoom("Notepad")
  1324.  
  1325.          If you have more than one Notepad window open, WinBatch will use the
  1326.          one which was most recently used or started.
  1327.  
  1328.          Note that WinBatch matches the partial windowname beginning with the
  1329.          first character, so that while
  1330.  
  1331.            WinZoom("Note")
  1332.  
  1333.          would be correct,
  1334.  
  1335.            WinZoom("pad")
  1336.  
  1337.          would not result in a match.
  1338.  
  1339.          Also, the case (upper or lower) of the title is significant, so
  1340.  
  1341.            WinZoom("notepad")
  1342.  
  1343.          would not work either.
  1344.  
  1345.  
  1346.          WinActivate (partial-windowname)
  1347.  
  1348.          Makes an application window the active window.
  1349.  
  1350.          This function makes a currently-open window the active window.  If the
  1351.          specified window is an icon, it will be restored to normal size;
  1352.          otherwise, its size will not be changed.
  1353.  
  1354.  
  1355.          WinClose (partial-windowname)
  1356.  
  1357.          Closes an application window.
  1358.  
  1359.  
  1360.  
  1361.                                                                              16
  1362.  
  1363.                                                                        TUTORIAL
  1364.  
  1365.  
  1366.          This is like selecting Close from an application's control menu.  You
  1367.          will still receive any closing message(s) that the application would
  1368.          normally give you, such as an "unsaved-file" dialog box.
  1369.  
  1370.  
  1371.          WinCloseNot (partial-windowname[, partial-windowname]...)
  1372.  
  1373.          Closes all application windows except those specified.
  1374.  
  1375.          This function lets you close all windows except the one(s) you want to
  1376.          remain open.  For example:
  1377.  
  1378.            WinCloseNot("Program Man")
  1379.  
  1380.          would leave only the Program Manager open, and:
  1381.  
  1382.            WinCloseNot("Program Man", "Solit")
  1383.  
  1384.          would leave the Program Manager and Solitaire windows open.
  1385.  
  1386.  
  1387.          WinWaitClose (partial-windowname)
  1388.  
  1389.          Waits until an application window is closed.
  1390.  
  1391.          This function causes your WinBatch file to pause until you have
  1392.          manually closed a specified window.  This is a convenient way to get
  1393.          WinBatch to open several windows sequentially, thereby not having
  1394.          unnecessary windows all over your desktop.  For example:
  1395.  
  1396.            RunZoom("invoices.xls", "")      ;balance the books
  1397.            WinWaitClose("Microsoft Ex")     ;wait till Excel closed
  1398.            RunZoom("sol", "")               ;you deserve a break
  1399.            WinWaitClose("Solitaire")        ;wait until Solit closed
  1400.            Run("winword", "agenda.doc")     ;more paperwork
  1401.            WinWaitClose("Microsoft Wor")    ;wait until W4W closed
  1402.            Run("clock","")                  ;lunchtime yet?
  1403.  
  1404.          During the time that the batch file is suspended, the WinBatch icon
  1405.          will remain at the bottom of your screen.  You can cancel the batch
  1406.          file at any time by selecting Terminate from the icon's control menu.
  1407.  
  1408.  
  1409.          WinExist (partial-windowname)
  1410.  
  1411.          Tells if a window exists.
  1412.  
  1413.  
  1414.  
  1415.  
  1416.                                                                              17
  1417.  
  1418.                                                                        TUTORIAL
  1419.  
  1420.  
  1421.          This function returns @TRUE or @FALSE, depending on whether a matching
  1422.          window can be found.  This provides a way of insuring that only one
  1423.          copy of a given window will be open at a time.
  1424.  
  1425.          If you've been following this tutorial faithfully from the beginning,
  1426.          you probably have several copies of Solitaire running at the moment.
  1427.          (You can check by pressing Ctrl-Esc and bringing up the Task Manager.
  1428.          You say you've got five Solitaire windows open?  Okay, close them
  1429.          all.)  Now, let's modify our SOLITARE.WBT file.  First, trim out the
  1430.          excess lines so that it looks like this:
  1431.  
  1432.            Run("sol.exe", "")
  1433.  
  1434.          Now, let's use the WinExist function to make sure that WinBatch only
  1435.          starts Solitaire if it isn't already running:
  1436.  
  1437.            If WinExist("Solitaire") == @FALSE Then Run("sol.exe", "")
  1438.  
  1439.          And this should work fine.  Run SOLITARE.WBT twice now, and see what
  1440.          happens.  The first time you run it, it should start Solitaire; the
  1441.          second (and subsequent) time, it should not do anything.
  1442.  
  1443.          However, it's quite likely that you want the batch file to do
  1444.          something if Solitaire is already running -- namely, bring the
  1445.          Solitaire window to the foreground.  This can be accomplished by using
  1446.          the WinActivate function, along with a couple of Goto statements:
  1447.  
  1448.            If WinExist("Solitaire") == @FALSE Then Goto open
  1449.            WinActivate("Solitaire")
  1450.            Goto loaded
  1451.            :open
  1452.            Run("sol.exe", "")
  1453.            :loaded
  1454.  
  1455.          Note that we can change this to have WinExist check for a True value
  1456.          instead, by modifying the structure of the batch file:
  1457.  
  1458.            If WinExist("Solitaire") == @TRUE Then Goto activate
  1459.            Run("sol.exe", "")
  1460.            Goto loaded
  1461.            :activate
  1462.            WinActivate("Solitaire")
  1463.            :loaded
  1464.  
  1465.          Either format is perfectly correct, and the choice of which to use is
  1466.          merely a matter of personal style.  The result is exactly the same.
  1467.  
  1468.  
  1469.  
  1470.  
  1471.                                                                              18
  1472.  
  1473.                                                                        TUTORIAL
  1474.  
  1475.  
  1476.          EndSession ( )
  1477.  
  1478.          Ends the current Windows session.
  1479.  
  1480.          This does exactly what it says.  It will not ask any questions
  1481.          (although you will receive any closing messages that your currently-
  1482.          open windows would normally display), so you may want to build in a
  1483.          little safety net:
  1484.  
  1485.            sure = AskYesNo("End Session", "Really quit Windows?")
  1486.            If sure == @YES Then EndSession()
  1487.  
  1488.          EndSession is an example of a WinBatch function which does not take
  1489.          any parameters, as indicated by the empty parentheses which follow it.
  1490.          The parentheses are still required, though.
  1491.  
  1492.  
  1493.          Files and Directories
  1494.  
  1495.  
  1496.          DirChange (pathname)
  1497.  
  1498.          Changes the directory to the pathname specified.
  1499.          Use this function when you want to run a program which must be started
  1500.          from its own directory.  "Pathname" may optionally include a drive
  1501.          letter.
  1502.  
  1503.          Example:
  1504.  
  1505.            DirChange("c:\windows\winword")
  1506.            Run("winword.exe", "")
  1507.  
  1508.  
  1509.          DirGet ( )
  1510.  
  1511.          Gets the current working directory.
  1512.  
  1513.          This function is especially useful when used in conjunction with
  1514.          DirChange, to save and then return to the current directory.
  1515.  
  1516.          Example:
  1517.  
  1518.            origdir = DirGet()
  1519.            DirChange("c:\windows\winword")
  1520.            Run("winword.exe", "")
  1521.            DirChange(origdir)
  1522.  
  1523.  
  1524.  
  1525.  
  1526.                                                                              19
  1527.  
  1528.                                                                        TUTORIAL
  1529.  
  1530.  
  1531.          FileExist (filename)
  1532.  
  1533.          Determines if a file exists.
  1534.  
  1535.          This function will return @TRUE if the specified file exists, and
  1536.          @FALSE if it doesn't exist.
  1537.  
  1538.          Example:
  1539.  
  1540.            If FileExist("win.bak") == @FALSE Then FileCopy("win.ini",
  1541.               "win.bak", @FALSE)
  1542.            Run("notepad.exe", "win.ini")
  1543.  
  1544.  
  1545.          FileCopy (from-list, to-file, warning)
  1546.  
  1547.          Copies files.
  1548.  
  1549.          If warning is @TRUE, WinEdit will pop up a dialog box warning you if
  1550.          you are about to overwrite an existing file, and giving you an
  1551.          opportunity to change your mind.  If warning is @FALSE, it will
  1552.          overwrite existing files with no warning.
  1553.  
  1554.          Example:
  1555.  
  1556.            FileCopy("cmdpost.cpm", "*.sav", @TRUE)
  1557.            Run("notepad.exe", "cmdpost.cpm")
  1558.  
  1559.          The asterisk (*) is a wildcard character, which matches any letter or
  1560.          group of letters in a file name.  In this case, it will cause
  1561.          CMDPOST.CPM to be copied as CMDPOST.SAV.
  1562.  
  1563.  
  1564.          FileDelete (file-list)
  1565.  
  1566.          Deletes files.
  1567.  
  1568.          Example:
  1569.  
  1570.            If FileExist("win.bak") == @TRUE Then FileDelete("win.bak")
  1571.  
  1572.  
  1573.          FileRename (from-list, to-file)
  1574.  
  1575.          Renames files to another set of names.
  1576.  
  1577.          We can illustrate the use of these WinBatch file functions with a
  1578.          typical batch file application.  Let's suppose that our word processor
  1579.  
  1580.  
  1581.                                                                              20
  1582.  
  1583.                                                                        TUTORIAL
  1584.  
  1585.  
  1586.          saves a backup copy of each document, with a BAK extension, but we
  1587.          want a larger safety net when editing important files.  We want to
  1588.          keep the five most recent versions of the wonderful software manual
  1589.          we're writing.  Here's a WinBatch file to accomplish this:
  1590.  
  1591.            If FileExist("winbatch.bak") == @TRUE Then Goto backup
  1592.            :edit
  1593.            Run("winword.exe", "winbatch.doc")
  1594.            Exit
  1595.            :backup
  1596.            FileDelete("winbatch.bk5")
  1597.            FileRename("winbatch.bk4", "winbatch.bk5)
  1598.            FileRename("winbatch.bk3", "winbatch.bk4)
  1599.            FileRename("winbatch.bk2", "winbatch.bk3)
  1600.            FileRename("winbatch.bk1", "winbatch.bk2)
  1601.            FileRename("winbatch.bak", "winbatch.bk1)
  1602.            Goto edit
  1603.  
  1604.          If the file WINBATCH.BAK exists, it means that we have made a change
  1605.          to WINBATCH.DOC.  So, before we start editing, we delete the oldest
  1606.          backup copy, and perform several FileRename functions, until
  1607.          eventually WINBATCH.BAK becomes WINBATCH.BK1.  Notice how the flow of
  1608.          control moves to the line labeled :backup, and then back to the line
  1609.          labeled :edit, and how we terminate processing with the Exit command.
  1610.          If we did not include the Exit command, the batch file would continue
  1611.          in an endless loop.
  1612.  
  1613.          However, this still isn't quite right.  What would happen if the file
  1614.          WINBATCH.BK5 didn't exist?  In the DOS batch language, we would get an
  1615.          error message, and processing would continue.  But in WinBatch, the
  1616.          error would be fatal, and cause the batch file to abort.
  1617.  
  1618.          There are two ways that we can handle this.  We could use an If
  1619.          FileExist test before every file operation, and test the returned
  1620.          value for a @TRUE before proceeding.  But this is clumsy, even with
  1621.          such a small batch file, and would become unwieldy with a larger one.
  1622.  
  1623.  
  1624.          Handling Errors
  1625.  
  1626.          Luckily, there is a WinBatch system function to help us here:
  1627.          ErrorMode.  The ErrorMode function determines what happens if an error
  1628.          occurs during batch file processing.  Here's the syntax:
  1629.  
  1630.  
  1631.          ErrorMode (mode)
  1632.  
  1633.          Specifies how to handle errors.
  1634.  
  1635.  
  1636.                                                                              21
  1637.  
  1638.                                                                        TUTORIAL
  1639.  
  1640.  
  1641.          Parameters:
  1642.  
  1643.            "mode" =     @CANCEL, @NOTIFY, or @OFF.
  1644.  
  1645.          Returns:
  1646.  
  1647.            (integer)    previous error setting.
  1648.  
  1649.          Use this command to control the effects of runtime errors.  The
  1650.          default is @CANCEL, meaning the execution of the batch file will be
  1651.          canceled for any error.
  1652.  
  1653.          @CANCEL:  All runtime errors will cause execution to be canceled.  The
  1654.          user will be notified which error occurred.
  1655.  
  1656.          @NOTIFY:  All runtime errors will be reported to the user, and they
  1657.          can choose to continue if it isn't fatal.
  1658.  
  1659.          @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  1660.          errors will be reported to the user.  User has the option of
  1661.          continuing if the error is not fatal.
  1662.  
  1663.          As you can see, the default mode is @CANCEL, and it's a good idea to
  1664.          leave it like this.  However, it is quite reasonable to change the
  1665.          mode for sections of your batch files where you anticipate errors
  1666.          occurring.  This is just what we've done in our modified batch file:
  1667.  
  1668.            If FileExist("winbatch.bak") == @TRUE Then Goto backup
  1669.            :edit
  1670.            Run("winword.exe", "winbatch.doc")
  1671.            Exit
  1672.            :backup
  1673.            ErrorMode(@OFF)
  1674.            FileDelete("winbatch.bk5")
  1675.            FileRename("winbatch.bk4", "winbatch.bk5)
  1676.            FileRename("winbatch.bk3", "winbatch.bk4)
  1677.            FileRename("winbatch.bk2", "winbatch.bk3)
  1678.            FileRename("winbatch.bk1", "winbatch.bk2)
  1679.            FileRename("winbatch.bak", "winbatch.bk1)
  1680.            ErrorMode(@CANCEL)
  1681.            Goto edit
  1682.  
  1683.          Notice how we've used ErrorMode(@OFF) to prevent errors in the section
  1684.          labeled backup: from aborting the batch file, and then used
  1685.          ErrorMode(@CANCEL) at the end of the that section to change back to
  1686.          the default error mode.  This is a good practice to follow.
  1687.  
  1688.  
  1689.  
  1690.  
  1691.                                                                              22
  1692.  
  1693.                                                                        TUTORIAL
  1694.  
  1695.  
  1696.          Selection Menus
  1697.  
  1698.          So far, whenever we have needed to use a file name, we have hard-coded
  1699.          it into our WinBatch files.  For example:
  1700.  
  1701.            Run("notepad.exe", "agenda.txt")
  1702.  
  1703.          Naturally, there should be a way to get this information from the user
  1704.          "on the fly", so that we wouldn't have to write hundreds of different
  1705.          batch files.  And there is a way.  Two ways, actually.  Consider,
  1706.          first, a function that we have already seen, AskLine:
  1707.  
  1708.            file = AskLine("", "Enter Filename to edit?", "")
  1709.            Run("notepad.exe", file)
  1710.  
  1711.          This will prompt for a filename, and run Notepad on that file.
  1712.  
  1713.          There are only three problems with this approach.  First, the user
  1714.          might not remember the name of the file.  Second, the user might enter
  1715.          the name incorrectly.  And finally, modern software is supposed to be
  1716.          sophisticated and user-friendly enough to handle these things the
  1717.          right way.  And WinBatch certainly can.
  1718.  
  1719.          There are two new functions we need to use for our new, improved file
  1720.          selection routine: FileItemize and ItemSelect.
  1721.  
  1722.  
  1723.          FileItemize (file-list)
  1724.  
  1725.          Returns a space-delimited list of files.
  1726.  
  1727.          This function compiles a list of filenames and separates the names
  1728.          with spaces.  There are several variations we can use:
  1729.  
  1730.            FileItemize("*.doc")
  1731.  
  1732.          would give us a list of all files in the current directory with a DOC
  1733.          extension,
  1734.  
  1735.            FileItemize("*.com *.exe")
  1736.  
  1737.          would give us a list of all files in the current directory with a COM
  1738.          or EXE extension, and
  1739.  
  1740.            FileItemize("*.*")
  1741.  
  1742.          would give us a list of all files in the current directory.
  1743.  
  1744.  
  1745.  
  1746.                                                                              23
  1747.  
  1748.                                                                        TUTORIAL
  1749.  
  1750.  
  1751.          Of course, we need to be able to use this list, and for that we use:
  1752.  
  1753.  
  1754.          ItemSelect (title, list, delimiter)
  1755.  
  1756.          Displays a listbox filled with items from a list you specify in a
  1757.          string.  The items are separated in your string by a delimiter
  1758.          character.
  1759.  
  1760.          This is the function which actually displays the list box.  Remember
  1761.          that FileItemize returns a file list delimited by spaces, which would
  1762.          look something like this:
  1763.  
  1764.            FILE1.DOC FILE2.DOC FILE3.DOC
  1765.  
  1766.          When we use ItemSelect, we need to tell it that the delimiter is a
  1767.          space.  We do this as follows:
  1768.  
  1769.            textfiles = FileItemize("*.doc *.txt")
  1770.            yourfile = ItemSelect("Select file to edit", textfiles, " ")
  1771.            Run("notepad.exe", yourfile)
  1772.  
  1773.          First, we use FileItemize to build a list of filenames with DOC and
  1774.          TXT extensions.  We assign this list to the variable textfiles.  Then,
  1775.          we use the ItemSelect function to build a list box, passing it the
  1776.          variable textfiles as its second parameter.  The third parameter we
  1777.          use for ItemSelect is simply a space with quote marks around it; this
  1778.          tells ItemSelect that the variable textfiles is delimited by spaces.
  1779.          Note that this is different from the null string that we've seen
  1780.          earlier -- here, you must include a space between the quote marks.
  1781.          Finally, we assign the value returned by ItemSelect to the variable
  1782.          yourfile, and run Notepad using that file.
  1783.  
  1784.          In the list box, if the user presses Enter or clicks on the OK button
  1785.          without a file being highlighted, ItemSelect returns a null string.
  1786.          If you want, you can test for this condition:
  1787.  
  1788.            textfiles = FileItemize("*.doc *.txt")
  1789.            :retry
  1790.            yourfile = ItemSelect("Select file to edit", textfiles, " ")
  1791.            If yourfile == "" Then Goto retry
  1792.            Run("notepad.exe", yourfile)
  1793.  
  1794.  
  1795.          DirItemize (dir-list)
  1796.  
  1797.          Returns a space-delimited list of directories.
  1798.  
  1799.  
  1800.  
  1801.                                                                              24
  1802.  
  1803.                                                                        TUTORIAL
  1804.  
  1805.  
  1806.          This function is similar to FileItemize, but instead of returning a
  1807.          list of files, it returns a list of directories.  Remember we said
  1808.          that FileItemize only lists files in the current directory.  Often, we
  1809.          want to be able to use files in other directories as well.  We can do
  1810.          this by first letting the user select the appropriate directory, using
  1811.          the DirItemize and ItemSelect combination:
  1812.  
  1813.            DirChange("\")
  1814.            subdirs = DirItemize("*")
  1815.            targdir = ItemSelect("Select dir", subdirs, " ")
  1816.            DirChange(targdir)
  1817.            files = FileItemize("*.*")
  1818.            file = ItemSelect("Select file", files, " ")
  1819.            Run("notepad.exe", file)
  1820.  
  1821.          First we change to the root directory.  Then we use DirItemize to get
  1822.          a list of all the subdirectories off of the root directory.  Next, we
  1823.          use ItemSelect to give us a list box of directories from which to
  1824.          select.  Finally, we change to the selected directory, and use
  1825.          FileItemize and ItemSelect to pick a file.
  1826.  
  1827.          Although this batch file works, it needs to be polished up a bit.
  1828.          What happens if the file we want is in the \WINDOWS\BATCH directory?
  1829.          Our batch file doesn't go more than one level deep from the root
  1830.          directory.  We want  to continue down the directory tree, but we also
  1831.          need a way of telling when we're at the end of a branch.  As it
  1832.          happens, there is such a way: DirItemize will return a null string if
  1833.          there are no directories to process.  Given this knowledge, we can set
  1834.          up a loop to test when we are at the lowest level:
  1835.  
  1836.            DirChange("\")
  1837.            :getdir
  1838.            subdirs = DirItemize("*")
  1839.            If subdirs == "" Then Goto getfile
  1840.            targdir = ItemSelect("Select dir (OK = curr)", subdirs, " ")
  1841.            If targdir == "" Then Goto getfile
  1842.            DirChange(targdir)
  1843.            Goto getdir
  1844.            :getfile
  1845.            files = FileItemize("*.*")
  1846.            file = ItemSelect("Select file", files, " ")
  1847.            If file == "" Then Goto getfile
  1848.            Run("notepad.exe", file)
  1849.  
  1850.          After we use the DirItemize function, we test the returned value for a
  1851.          null string.  If we have a null string, then we know that the current
  1852.          directory has no subdirectories, and so we proceed to select the
  1853.          filename from the current directory (Goto getfile) .  If, however,
  1854.  
  1855.  
  1856.                                                                              25
  1857.  
  1858.                                                                        TUTORIAL
  1859.  
  1860.  
  1861.          DirItemize returns a non-blank list, then we know that there is, in
  1862.          fact, at least one subdirectory.  In that case, we use ItemSelect to
  1863.          present the user with a list box of directories.  Then, we test the
  1864.          value returned by ItemSelect.  If the returned value is a null string,
  1865.          it means that the user did not select a directory from the list, and
  1866.          presumably wants a file in the current directory.  We happily oblige
  1867.          (Goto getfile).  On the other hand, a non-blank value returned by
  1868.          ItemSelect indicates that the user has selected a subdirectory from
  1869.          the list box.  In that case, we change to the selected directory, and
  1870.          loop back to the beginning of the directory selection routine (Goto
  1871.          getdir).  We continue this process until either (a) the user selects a
  1872.          directory, or (b) there are no directories left to select.
  1873.          Eventually, we get to the section of the batch file labeled :getfile.
  1874.  
  1875.  
  1876.          Nicer Display Boxes
  1877.  
  1878.          Have you tried displaying long messages, and found that WinBatch
  1879.          didn't wrap the lines quite the way you wanted?  Here are a couple of
  1880.          tricks.
  1881.  
  1882.  
  1883.          Num2Char (integer)
  1884.  
  1885.          Converts a number to its character equivalent.
  1886.  
  1887.          We want to be able to insert a carriage return/line feed combination
  1888.          at the end of each line in our output, and the Num2Char function will
  1889.          let us do that.  A carriage return has an ASCII value of 13, and a
  1890.          line feed has an ASCII value of 10 (don't worry if you don't
  1891.          understand what this sentence means).  To be able to use these values,
  1892.          we must convert them to characters, as follows:
  1893.  
  1894.            cr = Num2Char(13)
  1895.            lf = Num2Char(10)
  1896.  
  1897.          Now, we need to be able to place the variables cr and lf in our
  1898.          message.  For example, let's say we want to do this:
  1899.  
  1900.            Message("", "This is line one This is line two")
  1901.  
  1902.          If we just inserted the variables into the string, as in:
  1903.  
  1904.            cr = Num2Char(13)
  1905.            lf = Num2Char(10)
  1906.            Message("", "This is line one cr lf This is line two")
  1907.  
  1908.  
  1909.  
  1910.  
  1911.                                                                              26
  1912.  
  1913.                                                                        TUTORIAL
  1914.  
  1915.  
  1916.          we would not get the desired effect.  WinBatch would simply treat them
  1917.          as ordinary text.
  1918.  
  1919.          However, WinBatch does provide us with a method of performing variable
  1920.          substitution such as this, and that is by delimiting the variables
  1921.          with percentage signs (%).  If we do this:
  1922.  
  1923.            cr = Num2Char(13)
  1924.            lf = Num2Char(10)
  1925.            Message("", "This is line one %cr% %lf%This is line two")
  1926.  
  1927.          we will get what we want.
  1928.  
  1929.          Note that there is no space after %lf%; this is so that the second
  1930.          line will be aligned with the first line (every space within the
  1931.          delimiting quote marks of a string variable is significant).
  1932.  
  1933.          Now, wouldn't it be convenient if we could combine cr and lf into a
  1934.          single variable?  We can.
  1935.  
  1936.  
  1937.          StrCat (string[, string]...)
  1938.  
  1939.          Concatenates strings together.
  1940.  
  1941.          The StrCat function lets us combine any number of string constants
  1942.          and/or string variables.  Here's how we combine the variables cr and
  1943.          lf into the single variable crlf:
  1944.  
  1945.            crlf = StrCat(cr, lf)
  1946.  
  1947.          Note that the strings to be concatenated are separated by commas,
  1948.          within the parentheses.  Now, we can rewrite our example, as follows:
  1949.  
  1950.            cr = Num2Char(13)
  1951.            lf = Num2Char(10)
  1952.            crlf = StrCat(cr, lf)
  1953.            Message("", "This is line one %crlf%This is line two")
  1954.  
  1955.          If we wanted to re-use this message a number of times, it would be
  1956.          quite convenient to use the StrCat function to make a single variable
  1957.          out of it:
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.                                                                              27
  1967.  
  1968.                                                                        TUTORIAL
  1969.  
  1970.  
  1971.            cr = Num2Char(13)
  1972.            lf = Num2Char(10)
  1973.            crlf = StrCat(cr, lf)
  1974.            line1 = "This is line one"
  1975.            line2 = "This is line two"
  1976.            mytext = StrCat(line1, crlf, line2)
  1977.            Message("", mytext)
  1978.  
  1979.  
  1980.          Even Nicer Display Boxes
  1981.  
  1982.          For fancy dialog boxes, complete with all the bells and whistles, see
  1983.          the separate manual section on the DialogBox function (pg. 31).
  1984.  
  1985.  
  1986.          Running DOS Programs
  1987.  
  1988.          WinBatch can run DOS programs, just like it runs Windows programs:
  1989.  
  1990.            DirChange("c:\game")
  1991.            Run("scramble.exe", "")
  1992.  
  1993.          If you want to use an internal DOS command, such as DIR or TYPE, you
  1994.          can do so by running the DOS command interpreter, COMMAND.COM, with
  1995.          the /c program parameter, as follows:
  1996.  
  1997.            Run("command.com", "/c type readme.txt")
  1998.  
  1999.          Everything that you would normally type on the DOS command line goes
  2000.          after the /c in the second parameter.  Here's another example:
  2001.  
  2002.            Run("command.com", "/c type readme.txt | more")
  2003.  
  2004.          These examples assume that COMMAND.COM is in a directory on your DOS
  2005.          path.  If it isn't, you could specify a full path name for it:
  2006.  
  2007.            Run("c:\command.com", "/c type readme.txt | more")
  2008.  
  2009.          Or, better still, you could use the WinBatch Environment function.
  2010.  
  2011.  
  2012.          Environment (env-variable)
  2013.  
  2014.          Gets a DOS environment variable.
  2015.  
  2016.          Since DOS always stores the full path and filename of the command
  2017.          processor in the DOS environment variable COMSPEC, it is an easy
  2018.          matter to retrieve this information:
  2019.  
  2020.  
  2021.                                                                              28
  2022.  
  2023.                                                                        TUTORIAL
  2024.  
  2025.  
  2026.            coms = Environment("COMSPEC")
  2027.  
  2028.          and use it in our batch file:
  2029.  
  2030.            coms = Environment("COMSPEC")
  2031.            Run(coms, "/c type readme.txt")
  2032.  
  2033.          To get a DOS window, just run COMMAND.COM with no parameters:
  2034.  
  2035.            coms = Environment("COMSPEC")
  2036.            Run(coms, "")
  2037.  
  2038.  
  2039.          Sending Keystrokes to Programs
  2040.  
  2041.          Here we come to one of the most useful and powerful features of
  2042.          WinBatch: the ability to send keystrokes to Windows programs, just as
  2043.          if you were typing them directly from the keyboard.
  2044.  
  2045.  
  2046.          SendKey (character-codes)
  2047.  
  2048.          Sends keystrokes to the active application.
  2049.  
  2050.          This is an ideal way to make the computer automatically type the
  2051.          keystrokes that you enter every time you start a certain program.  For
  2052.          example, to start up Notepad and have it prompt you for a file to
  2053.          open, you would use:
  2054.  
  2055.            Run("notepad.exe", "")
  2056.            SendKey("!FO")
  2057.  
  2058.          The parameter you specify for SendKey is the string that you want sent
  2059.          to the program.  This string consists of standard characters, as well
  2060.          as some special characters which you will find listed under the entry
  2061.          for SendKey in the WBL Function Reference (pg. 121).  In the example
  2062.          above, the exclamation mark (!) stands for the Alt key, so !F is the
  2063.          equivalent of pressing and holding down the Alt key while
  2064.          simultaneously pressing the F key.  The O in the example above is
  2065.          simply the letter O, and is the same as pressing the O key by itself.
  2066.  
  2067.          Here's another example:
  2068.  
  2069.            RunZoom("sol.exe", "")
  2070.            SendKey("!GC{RIGHT}{SP}~")
  2071.  
  2072.          This starts up Solitaire, brings up the Game menu (!G), and selects
  2073.          Deck (C) from that menu.  Then it moves the cursor to the next card
  2074.  
  2075.  
  2076.                                                                              29
  2077.  
  2078.                                                                        TUTORIAL
  2079.  
  2080.  
  2081.          back style on the right ({RIGHT}), selects that card back ({SP}), and
  2082.          then selects OK (~).  And voila!  A different card design every time
  2083.          you play!
  2084.  
  2085.  
  2086.          Our Completed WinBatch File
  2087.  
  2088.          Here is the final working version of the SOLITARE.WBT file that we've
  2089.          slowly been building throughout this tutorial:
  2090.  
  2091.            ; solitare.wbt
  2092.            mins = AskLine("Solitaire", "How many minutes do you want to
  2093.               play?", "")
  2094.            If WinExist("Solitaire") == @TRUE Then Goto activate
  2095.            RunZoom("sol.exe", "")
  2096.            Goto loaded
  2097.            :activate
  2098.            WinActivate("Solitaire")
  2099.            WinZoom("Solitaire")
  2100.            :loaded
  2101.            SendKey("!GC{RIGHT}{SP}~")
  2102.            goal = mins * 60
  2103.            timer = 0
  2104.            :moretime
  2105.            remain = goal - timer
  2106.            WinTitle("Solitaire", "Solitaire (%remain% seconds left)")
  2107.            Delay(10)
  2108.            timer = timer + 10
  2109.            If WinExist("Solitaire") == @FALSE Then Exit
  2110.            If timer < goal Then Goto moretime
  2111.            Beep
  2112.            WinClose("Solitaire")
  2113.            Message("Time's up", "Get back to work!")
  2114.  
  2115.          It incorporates many of the concepts that we've discussed so far, as
  2116.          well as using some arithmetic (*, -, +) and relational (<) operators
  2117.          that are covered in the section on the WinBatch Language (pg. 44).
  2118.  
  2119.          It can also be improved and customized in a number of ways.
  2120.  
  2121.          If you can understand and follow the structures and processes
  2122.          illustrated in this sample file, and can begin to incorporate them
  2123.          into your own WinBatch files, you are well on your way to becoming a
  2124.          true WinBatch guru!
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.                                                                              30
  2132.  
  2133.                                                                    DIALOG BOXES
  2134.  
  2135.  
  2136.  
  2137.                                       DIALOG BOXES
  2138.  
  2139.          The DialogBox function can be used to design complex dialog boxes for
  2140.          user interaction.  These dialog boxes can contain data entry fields,
  2141.          file selection boxes, radio buttons, and check boxes.
  2142.  
  2143.          This is a somewhat advanced topic, which assumes a basic understanding
  2144.          of the WinBatch structures already presented.
  2145.  
  2146.  
  2147.          DialogBox
  2148.  
  2149.          Pops up a Windows dialog box defined by the WBD template file.
  2150.  
  2151.          Syntax:
  2152.  
  2153.            DialogBox ("title", "WBD file")
  2154.  
  2155.          Parameters:
  2156.  
  2157.            "title" =    the title of the dialog box.
  2158.  
  2159.            "WBD file" = the name of the WBD template file.
  2160.  
  2161.          For each dialog box, you must first create a template file, with a
  2162.          (recommended) WBD extension, which will identify the structure of the
  2163.          dialog box, as well as the variables used by it.  Unlike the other
  2164.          WinBatch functions, you do not actually pass variables to DialogBox as
  2165.          parameters.  However, the DialogBox function does indeed have the
  2166.          ability to manipulate, and even create, variables.  If you are
  2167.          familiar with programming, you may think of DialogBox as a subroutine,
  2168.          and all the variables it uses as being global.
  2169.  
  2170.          Let's start with a simple example.  Suppose we want to write a
  2171.          WinBatch file which starts up Notepad, with two options which can be
  2172.          selected at runtime:
  2173.  
  2174.            1.  It can optionally zoom Notepad to full-screen.
  2175.            2.  It can optionally save a backup of the file to be edited.
  2176.  
  2177.          We could accomplish this with two AskYesNo statements:
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.                                                                              31
  2187.  
  2188.                                                                    DIALOG BOXES
  2189.  
  2190.  
  2191.            file = ItemSelect("", FileItemize("*.*"), " ")
  2192.            zoom = AskYesNo("", "Start Notepad zoomed?")
  2193.            backup = AskYesNo("", "Save a backup copy of %file%?")
  2194.            If backup == @NO Then Goto nobackup
  2195.            filebackupname = StrCat(FileRoot(file), ".", "bak")
  2196.            FileCopy(file, filebackupname, @TRUE)
  2197.            :nobackup
  2198.            If zoom == @NO Then Run("notepad.exe", file)
  2199.            If zoom == @YES Then RunZoom("notepad.exe", file)
  2200.  
  2201.          (The FileRoot function is new here: it simply returns the root of the
  2202.          filename, without the dot or the extension).
  2203.  
  2204.          This is fine, but DialogBox gives us another way of accomplishing the
  2205.          same thing.  We will construct a template file called EDIT.WBD, in
  2206.          which the AskYesNo statements will be functionally replaced by check
  2207.          boxes.  Here's what the template file will look like:
  2208.  
  2209.            [zoom+1Start editor zoomed]
  2210.            [backup+1Save backup of file]
  2211.  
  2212.          It is an ordinary ASCII file.
  2213.  
  2214.          Some explanation is in order.  First, note the square brackets.  Each
  2215.          element in a WBT file is enclosed in brackets; in this case, there are
  2216.          two distinct elements.  Next, notice that the first items that appear
  2217.          inside the brackets are variable names.  These variables -- zoom and
  2218.          backup -- are the same variables that we used in the AskYesNo
  2219.          statements, above.  Immediately following the variable name is a plus
  2220.          sign (+), which identifies the elements as being check boxes.  After
  2221.          the + symbol is the number 1, which represents the value that will be
  2222.          assigned to the variable if the box gets checked.  Note that there is
  2223.          no space before or after the + symbol.  Finally, we have the text
  2224.          which will be displayed next to the check box.
  2225.  
  2226.          Now, let's modify our WinBatch file to use this WBD template:
  2227.  
  2228.            file = ItemSelect("", FileItemize("*.*"), " ")
  2229.            DialogBox("Edit a file", "edit.wbd")
  2230.            If backup == 0 Then Goto nobackup
  2231.            filebackupname = StrCat(FileRoot(file), ".", "bak")
  2232.            FileCopy(file, filebackupname, @TRUE)
  2233.            :nobackup
  2234.            If zoom == 1 Then Run("notepad.exe", file)
  2235.            If zoom == 1 Then RunZoom("notepad.exe", file)
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.                                                                              32
  2242.  
  2243.                                                                    DIALOG BOXES
  2244.  
  2245.  
  2246.          The WBD template file should be in the current directory or in a
  2247.          directory on your path; otherwise, you must give a complete path
  2248.          specification for it when it appears in the DialogBox statement.
  2249.  
  2250.          Now, run the WinBatch file.  After you select a file from the list box
  2251.          generated by the ItemSelect function, you will get the dialog box.
  2252.  
  2253.          Notice how WinBatch adds two buttons -- OK and Cancel -- to the bottom
  2254.          of the dialog box.  Cancel terminates the batch file entirely.
  2255.  
  2256.          You may want to try running this with various combinations of boxes
  2257.          checked, just to confirm that it works properly.  It should.
  2258.  
  2259.          Now, look again at the WinBatch file.  Notice how the variables zoom
  2260.          and backup do not appear until after the DialogBox statement.  In
  2261.          essence, these variables are created by the WBD template, and
  2262.          initialized with values of 0.  If the user checks a box, the variable
  2263.          associated with that box is given the value which appears next to the
  2264.          + symbol in the template.  So, if the first box is checked, then zoom
  2265.          will have a value of 1 after the DialogBox statement is executed.  If
  2266.          it remains un-checked, it will still have a value of 0.  These values
  2267.          can then be used in your WinBatch files, as we have done above.
  2268.  
  2269.          Suppose that you want a box to be checked, by default.  All you need
  2270.          to do is to assign a non-zero value to the corresponding variable
  2271.          before you execute the DialogBox statement.  For example:
  2272.  
  2273.            file = ItemSelect("", FileItemize("*.*"), " ")
  2274.            zoom = 1
  2275.            DialogBox("Edit a file", "edit.wbd")
  2276.            If backup == 0 Then Goto nobackup
  2277.            filebackupname = StrCat(FileRoot(file), ".", "bak")
  2278.            FileCopy(file, filebackupname, @TRUE)
  2279.            :nobackup
  2280.            If zoom == 1 Then Run("notepad.exe", file)
  2281.            If zoom == 1 Then RunZoom("notepad.exe", file)
  2282.  
  2283.          When you run it this time, the first box will already be checked,
  2284.          because we first assigned a value of 1 to the variable zoom.  The
  2285.          variable will still have a value of 1 after the DialogBox statement is
  2286.          executed -- unless the user un-checks the box, in which case it will
  2287.          have a value of 0.  The variable associated with an unchecked box is
  2288.          always equal to 0; the variable associated with a checked box is equal
  2289.          to the value you specify for that box.  For the most part, you would
  2290.          be fine simply using a value of 1 to indicate a checked box.
  2291.  
  2292.          You can change the layout of the WBD template to suit your taste.  For
  2293.          example, this:
  2294.  
  2295.  
  2296.                                                                              33
  2297.  
  2298.                                                                    DIALOG BOXES
  2299.  
  2300.  
  2301.            [zoom+1Start editor zoomed]   [backup+1Save backup of file]
  2302.  
  2303.          would put the two check boxes side by side.  However, you may not put
  2304.          tab characters in a template file, so be sure to use spaces instead
  2305.          (unless your editor can convert tabs to spaces).  Also, template files
  2306.          are limited to 15 lines, and to the first 60 columns
  2307.  
  2308.          The next element which you can use in a dialog box is the radio
  2309.          button.  Whereas you can have several check boxes checked at one time,
  2310.          the radio button gets its name from the five-button car radio, which
  2311.          can only have one station selected at a time.  You can have more than
  2312.          one group of radio buttons, but only one button in each group may be
  2313.          "pressed."  Therefore, this is ideal for situations where the user
  2314.          must make a choice from multiple alternatives:
  2315.  
  2316.          Here's a group of four radio buttons:
  2317.  
  2318.            [editor^1Notepad]   [editor^2WinEdit]
  2319.            [editor^3Write]     [editor^4WinWord]
  2320.  
  2321.          Let's look at how these are different from check boxes.  First, the
  2322.          symbol which identifies a radio button is a caret (^), instead of a +.
  2323.          Second, each of the buttons has the same variable name (editor).  And
  2324.          third, each button has a unique value following the ^ symbol.
  2325.  
  2326.          This should make sense if you consider what we are trying to
  2327.          accomplish: we want to obtain a value for the variable editor.  The
  2328.          user has four programs to choose from, and he must choose one, and
  2329.          only one.  As you have probably guessed, the value associated with the
  2330.          button which the user "pushes" will be assigned to editor.
  2331.  
  2332.          Let's add this to our existing EDIT.WBD template:
  2333.  
  2334.            [zoom+1Start editor zoomed]
  2335.            [backup+1Save backup of file]
  2336.            [editor^1Notepad]   [editor^2WinEdit]
  2337.            [editor^3Write]     [editor^4WinWord]
  2338.  
  2339.          and expand our WinBatch file to take advantage of it:
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.                                                                              34
  2352.  
  2353.                                                                    DIALOG BOXES
  2354.  
  2355.  
  2356.            file = ItemSelect("", FileItemize("*.*"), " ")
  2357.            zoom = 1
  2358.            DialogBox("Edit a file", "edit.wbd")
  2359.            If backup == 0 Then Goto nobackup
  2360.            filebackupname = StrCat(FileRoot(file), ".", "bak")
  2361.            FileCopy(file, filebackupname, @TRUE)
  2362.            :nobackup
  2363.            If zoom == 0 Then runcmd = "Run"
  2364.            If zoom == 1 Then runcmd = "RunZoom"
  2365.            If editor == 1 Then %runcmd%("notepad.exe", file)
  2366.            If editor == 2 Then %runcmd%("winedit.exe", file)
  2367.            If editor == 3 Then %runcmd%("write.exe", file)
  2368.            If editor == 4 Then %runcmd%("winword.exe", file)
  2369.  
  2370.          (We're using the variable runcmd to avoid having to code eight
  2371.          separate Run and RunZoom statements.  Pretty clever, isn't it.)
  2372.  
  2373.          Look at how we are testing the value of editor to determine which
  2374.          program to run.  When the DialogBox statement is executed, the first
  2375.          radio button in each group is selected, regardless of its value.  In
  2376.          this case, the first button appearing in the template, in the editor
  2377.          group, has a value of 1, so, unless the user selects a different
  2378.          button, the variable editor will have a value of 1 after DialogBox
  2379.          finishes, and Notepad will be run.  If the user selects the WinEdit
  2380.          button, editor will have a value of 2 , and Winedit will be run.
  2381.  
  2382.          Another important element which you can use in your templates is the
  2383.          file selection list box, which combines the functionality of
  2384.          DirItemize, FileItemize, and ItemSelect.  It has the following form:
  2385.  
  2386.            [file\            ]
  2387.            [file\            ]
  2388.            [file\            ]
  2389.            [file\            ]
  2390.            [file\            ]
  2391.  
  2392.          Here, file is the variable name (you can use another name instead of
  2393.          file), and the backslash (\) is the symbol which identifies this as a
  2394.          file list element.  The amount of space between the \ symbol and the
  2395.          right bracket will determine the width of the file selection list box.
  2396.          And the number of occurrences of this element (each must have an
  2397.          identical name) will determine the height of the list box.
  2398.  
  2399.          Let's add this to our template:
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.                                                                              35
  2407.  
  2408.                                                                    DIALOG BOXES
  2409.  
  2410.  
  2411.            [zoom+1Start editor zoomed]
  2412.            [backup+1Save backup of file]
  2413.            [editor^1Notepad]   [editor^2WinEdit]
  2414.            [editor^3Write]     [editor^4WinWord]
  2415.            [file\            ]
  2416.            [file\            ]
  2417.            [file\            ]
  2418.            [file\            ]
  2419.            [file\            ]
  2420.  
  2421.          and revise our batch file:
  2422.  
  2423.            zoom = 1
  2424.            DialogBox("Edit a file", "edit.wbd")
  2425.            If backup == 0 Then Goto nobackup
  2426.            filebackupname = StrCat(FileRoot(file), ".", "bak")
  2427.            FileCopy(file, filebackupname, @TRUE)
  2428.            :nobackup
  2429.            If zoom == 0 Then runcmd = "Run"
  2430.            If zoom == 1 Then runcmd = "RunZoom"
  2431.            If editor == 1 Then %runcmd%("notepad.exe", file)
  2432.            If editor == 2 Then %runcmd%("winedit.exe", file)
  2433.            If editor == 3 Then %runcmd%("write.exe", file)
  2434.            If editor == 4 Then %runcmd%("winword.exe", file)
  2435.  
  2436.          All we did was remove the first line from the earlier example, which
  2437.          used FileItemize and ItemSelect to retrieve a file name.
  2438.  
  2439.          By default, the file selection list box uses *.* as a file mask.  If
  2440.          you want to limit the selection to, say, DOC files, assign a value to
  2441.          the appropriate variable before executing the DialogBox statement:
  2442.  
  2443.            file = "*.doc"
  2444.            DialogBox("Edit a file", "edit.wbd")
  2445.  
  2446.          Another element, the file mask edit box, allows the user to change the
  2447.          file mask interactively.  It's format is:
  2448.  
  2449.            [file#    ]
  2450.  
  2451.          Where the variable name, in this case file, must be the same as the
  2452.          one used in the file selection list box, and is followed by a number
  2453.          sign (#).  If the user enters a valid wild card mask in the file mask
  2454.          edit box, the file display in the file selection list box will be
  2455.          updated accordingly.  For example, if DOC files are currently shown,
  2456.          and the user types *.TXT, the display will change to show TXT files.
  2457.  
  2458.  
  2459.  
  2460.  
  2461.                                                                              36
  2462.  
  2463.                                                                    DIALOG BOXES
  2464.  
  2465.  
  2466.          You can optionally display the current directory (whose contents are
  2467.          being listed) by including an additional element in the template:
  2468.  
  2469.            [file$            ]
  2470.  
  2471.          This is identical to the file list element, except the symbol for the
  2472.          directory element is a dollar sign ($).  The variable name must be the
  2473.          same as the one used in the file selection list box:
  2474.  
  2475.            [file$            ]
  2476.               File mask [file#    ]
  2477.            [file\            ]
  2478.            [file\            ]
  2479.            [file\            ]
  2480.            [file\            ]
  2481.            [file\            ]
  2482.  
  2483.          Note that we have included the descriptive text "File mask" next to
  2484.          the file mask edit box.  You may place explanatory text anywhere in
  2485.          the template file, as long as it doesn't appear inside square
  2486.          brackets.
  2487.  
  2488.          You can also display a WinBatch variable in your dialog box by using
  2489.          an element of this form:
  2490.  
  2491.            [varname$]
  2492.  
  2493.          Where the name of the variable is followed by a dollar sign ($).
  2494.          WinBatch will replace this with the current value of the variable.
  2495.  
  2496.          Finally, we have the edit box, which allows us to assign user-supplied
  2497.          text to a variable.  The edit box element has the form:
  2498.  
  2499.            [input#           ]
  2500.  
  2501.          The variable name (in this case, input) is followed a number sign (#),
  2502.          and the width of the area between the brackets determines the width of
  2503.          the edit box which gets displayed.  Whatever the user types in the box
  2504.          gets assigned to the associated variable.  Here is a sample RENAME.WBD
  2505.          template:
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.                                                                              37
  2517.  
  2518.                                                                    DIALOG BOXES
  2519.  
  2520.  
  2521.            Select file to be renamed
  2522.            [oldname$           ]
  2523.            [oldname\           ]
  2524.            [oldname\           ]
  2525.            [oldname\           ]
  2526.            [oldname\           ]
  2527.  
  2528.            Type new name for the file
  2529.            [newname#           ]
  2530.  
  2531.          Which could be used with this WinBatch file:
  2532.  
  2533.            DialogBox("File Rename", "rename.wbd")
  2534.            FileRename(oldname, newname)
  2535.  
  2536.          You will have noticed that there are two symbols -- $ and # -- which
  2537.          have dual meanings, depending on whether or not there is a file list
  2538.          selection variable in the template with the same name.  The three file
  2539.          elements -- [file\], [file$], and [file#] -- are a "set", and share a
  2540.          common variable name.  All other variables in your template should
  2541.          have unique names.
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.                                                                              38
  2572.  
  2573.                                                                        WinMacro
  2574.  
  2575.  
  2576.  
  2577.                                         WinMacro
  2578.  
  2579.          WinMacro is a standalone companion program included in the WinBatch
  2580.          package, which lets you create macro files and "attach" them to the
  2581.          control menu of any Windows application.  These macros can then be
  2582.          executed, either by selecting them from the control menu, or through
  2583.          the use of a "hotkey."  WinMacro also has the ability to "record"
  2584.          keystrokes, which can later be "played back" virtually anywhere in the
  2585.          Windows environment.
  2586.  
  2587.  
  2588.  
  2589.                                    Starting WinMacro
  2590.  
  2591.          You can run WINMACRO.EXE just like any other Windows program, using
  2592.          your favorite Windows-program-starting method (keyboard, mouse,
  2593.          Program Manager, File Manager, MS-DOS Executive, Command Post,
  2594.          WinBatch, etc.).  However, if you will be using WinMacro on a regular
  2595.          basis, you may wish to have it load automatically when you start up
  2596.          Windows.  You can do this by adding WINMACRO.EXE to the LOAD= line in
  2597.          your WIN.INI file (consult your Microsoft Windows manual for more
  2598.          information).  If you are wise enough to be using Command Post as your
  2599.          primary shell , you can just add a RunIcon("winmacro.exe, "") line to
  2600.          the "autoexec" section of your user menu (if you're not yet a convert
  2601.          to Command Post, consider contacting the nice folks at Wilson
  2602.          WindowWare for more information on this outstanding program).
  2603.  
  2604.          WinBatch starts up as an icon, and remains active until you either
  2605.          close it or end your Windows session (whichever comes first).
  2606.  
  2607.  
  2608.  
  2609.                                  Macro Definition Files
  2610.  
  2611.          WinMacro definition (WDF) files are plain ASCII files which you create
  2612.          and edit.  They must have a WDF extension, and they must be located in
  2613.          the same directory as WINMACRO.EXE.  A WDF file contains any number of
  2614.          definition lines, each of which represents an individual command.
  2615.          Each line has the following format:
  2616.  
  2617.            Title   [\ optional hotkey] : program to be executed
  2618.  
  2619.          Title is the name which will appear on the application's control menu
  2620.          to identify the command.  The hotkey is optional; if it is included,
  2621.          it must be preceded by a backslash (\).  This is followed by a colon
  2622.          (:), and then the program which should be executed when the command is
  2623.          selected, with any required parameters.  This can be any Windows or
  2624.  
  2625.  
  2626.                                                                              39
  2627.  
  2628.                                                                        WinMacro
  2629.  
  2630.  
  2631.          DOS EXE, COM, PIF, or BAT file, and you must include the appropriate
  2632.          file extension.  If the program isn't located either in the current
  2633.          directory or on your DOS path, you must include a path specification
  2634.          for it.  To run a WinBatch file, run WINBATCH.EXE, with the name of
  2635.          the WBT file as a parameter.
  2636.  
  2637.          Let's create a WinMacro definition file, named GLOBAL.WDF:
  2638.  
  2639.            Run Notepad            : notepad.exe
  2640.            Play Solitaire    \ ^F9  : winbatch.exe solitare.wbt
  2641.  
  2642.          (This second line assumes that you have created SOLITARE.WBT as part
  2643.          of the WinBatch tutorial.  If not, just substitute any WBT file).
  2644.  
  2645.          GLOBAL.WDF is a special file name.  When WinMacro starts up, it looks
  2646.          for this file.  If present, WinMacro loads it, and attaches its
  2647.          contents to the control menu of every window currently running, as
  2648.          well as any windows that may subsequently be opened (the control menu
  2649.          is the menu that you access by typing Alt-Space, or by clicking  the
  2650.          little box on the left side of the title bar of any window).
  2651.  
  2652.          Go ahead and start up WinMacro, then access the control menu of any
  2653.          open window.  You should see that the two commands in your GLOBAL.WDF
  2654.          file have been attached to the control menu, and both are now
  2655.          available for your use.  You can run these user-defined commands by
  2656.          selecting them from the menu.  In addition, because you have defined a
  2657.          hotkey for the "Play Solitaire" command, you can run it from any
  2658.          window by pressing Ctrl-F9.
  2659.  
  2660.  
  2661.  
  2662.                                         Hotkeys
  2663.  
  2664.          You can assign a hotkey to any WinMacro definition line.  A  hotkey
  2665.          consists of the Ctrl key plus any letter (A - Z) or function (F1 -
  2666.          F16) key.  In addition, you can optionally use the Alt and Shift keys:
  2667.  
  2668.            Key       Char
  2669.  
  2670.            Ctrl      ^
  2671.            Alt       !
  2672.            Shift     +
  2673.  
  2674.          Here are some examples of valid key combinations:
  2675.  
  2676.            Hotkey    Equivalent keystrokes
  2677.  
  2678.            ^F5       Ctrl-F5
  2679.  
  2680.  
  2681.                                                                              40
  2682.  
  2683.                                                                        WinMacro
  2684.  
  2685.  
  2686.            ^!F5      Ctrl-Alt-F5
  2687.            ^+F5      Ctrl-Shift-F5
  2688.            ^!+F5     Ctrl-Alt-Shift-F5
  2689.            ^D        Ctrl-D
  2690.            ^!D       Ctrl-Alt-D
  2691.            ^+D       Ctrl-Shift-D
  2692.            ^!+D      Ctrl-Alt-Shift-D
  2693.  
  2694.          In addition to GLOBAL.WDF, you can create application-specific
  2695.          WinMacro definition files.  They have the form progname.WDF, where
  2696.          "progname" is the name of the application's COM or EXE file.  So, if
  2697.          you wanted to have a WDF file which would apply only to Notepad, you
  2698.          would name it NOTEPAD.WDF.  Its contents would be attached only to
  2699.          Notepad's control menu, and its hotkeys would be active only when
  2700.          Notepad was the active window.  WinMacro loads application-specific
  2701.          WDF files after GLOBAL.WDF, so if you have, for example, a NOTEPAD.WDF
  2702.          file, it's contents will be attached to Notepad's control menu in
  2703.          addition to (not instead of) GLOBAL.WDF.  If you define the same
  2704.          hotkey in GLOBAL.WDF and NOTEPAD.WDF, the one in NOTEPAD.WDF will
  2705.          apply.
  2706.  
  2707.          If you edit a WDF file while WinMacro is running, and want to see the
  2708.          changes reflected in the current menus, select About/Reload from the
  2709.          WinMacro icon's menu.  All windows will be updated.
  2710.  
  2711.  
  2712.  
  2713.                                   Recording Keystrokes
  2714.  
  2715.          Another feature of WinMacro is the ability to record keystrokes to a
  2716.          file, which can be played back at a later time.  To do this, make sure
  2717.          that WinMacro is running, and then type Ctrl-Shift-Home from any
  2718.          window, or select Begin Macro Record from the WinMacro icon's menu.
  2719.          WinMacro will present you with a menu of existing WBM files.  If you
  2720.          want to overwrite an existing file, select its name from the menu;
  2721.          otherwise, enter a name for the file you wish to create in the edit
  2722.          box (a WBM extension will automatically be added), and press the Enter
  2723.          key or click on the OK button.  At this point, the icon will begin
  2724.          flashing, indicating that you are in record mode.
  2725.  
  2726.          Once you are in record mode, every keystroke you type will be recorded
  2727.          to your WBM file.  Mouse movement and mouse clicks are not recorded.
  2728.          To end record mode, type Ctrl-Shift-End from any window, or click on
  2729.          the flashing WinMacro icon and select End Macro Record from the menu.
  2730.          The icon will stop flashing.
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.                                                                              41
  2737.  
  2738.                                                                        WinMacro
  2739.  
  2740.  
  2741.          Once you have created a WBM keystroke macro file, you can assign it to
  2742.          a hotkey in a WDF file, using the steps outlined above.  You use
  2743.          WinBatch to run WBM files, the same way you do with WBT files.
  2744.  
  2745.  
  2746.  
  2747.                                     WinMacro Example
  2748.  
  2749.          Let's create a macro for Solitaire which will cycle to the next deck
  2750.          back design (sound familiar?).  First, WinMacro should be running.
  2751.          Next, start up Solitaire, and make sure that it is the current window.
  2752.          Now, activate keystroke record mode, as outlined above, and name the
  2753.          file SOLITARE.WBM.  Once the WinMacro icon begins flashing, we're
  2754.          ready to record.  Enter the following series of keystrokes:
  2755.  
  2756.            Alt-G
  2757.            C
  2758.            Cursor right
  2759.            Space
  2760.            Enter
  2761.  
  2762.          And end record mode.  Now, create a WinMacro definition file named
  2763.          SOLITARE.WDF, containing the following entry:
  2764.  
  2765.            Change deck design     \ ^C : winbatch.exe solitare.wbm
  2766.  
  2767.          Finally, select About/Reload from the WinMacro icon's menu.  Your new
  2768.          command is now available from the Solitaire control menu, or simply by
  2769.          typing Ctrl-C when the Solitaire window is active.
  2770.  
  2771.  
  2772.  
  2773.                                        WBM files
  2774.  
  2775.          If you look at a WBM file, you will see that it is nothing more than a
  2776.          series of one or more SendKey statements.  For example, the
  2777.          SOLITARE.WBM file that we just created looks something like this
  2778.  
  2779.            ; Recorded Macro D:\WINDOWS\BATCH\SOLITARE.WBM
  2780.            SendKey(`!gc{RIGHT} {ENTER}`)
  2781.            ; End Recorded Macro
  2782.  
  2783.          If you glance back at the SOLITARE.WBT file in the Tutorial section of
  2784.          this manual (pg. 30), you will find a line which looks amazingly like
  2785.          the middle one above (~ has the same meaning as {ENTER}).  This
  2786.          demonstrates that WBM files are simply WBT files in disguise.
  2787.  
  2788.  
  2789.  
  2790.  
  2791.                                                                              42
  2792.  
  2793.                                                                        WinMacro
  2794.  
  2795.  
  2796.          So, why do we use different extensions for the two types of files?
  2797.          Consider, if you will, that a WBT file is a standalone program, which
  2798.          can be run from the Program Manager or File Manager.  It starts up
  2799.          whatever other programs it needs, does its work, and cleans up after
  2800.          itself.  A WBM file, on the other hand, is only a program fragment.
  2801.          When called, it sends a sequence of keystrokes to the active window,
  2802.          but it neither knows nor cares what window that may happen to be.  In
  2803.          Solitaire, Alt-G selects the Game menu; in another program, it may
  2804.          trigger the Goodbye function.  Needless to say, WBM files should be
  2805.          played back only in the window where they were recorded, and the
  2806.          easiest way to ensure this is to attach them to application-specific
  2807.          WDF files, as we have done here with Solitaire.  That's why we
  2808.          distinguish them from regular WBT files.
  2809.  
  2810.          However, because SendKey is a perfectly respectable WinBatch function
  2811.          -- and because WinMacro does generate SendKey statements -- it is
  2812.          quite useful to be able to record a WBM file, and later incorporate it
  2813.          into a full-fledged WinBatch file.  Suppose that we had a one-line
  2814.          WinBatch WBT file like this:
  2815.  
  2816.            RunZoom("sol.exe", "")
  2817.  
  2818.          and we wanted to follow that with a SendKey statement to change the
  2819.          deck design every time the file was run.  Instead of laboring over the
  2820.          WinBatch manual to find the cryptic symbols necessary to accomplish
  2821.          such a feat, we could simply use the WinMacro record feature to create
  2822.          a WBM file, as we did above, and then paste the resulting SendKey
  2823.          statement into the WinBatch WBT file:
  2824.  
  2825.            RunZoom("sol.exe", "")
  2826.            SendKey(`!gc{RIGHT} {ENTER}`)
  2827.  
  2828.          You can also use your favorite editor to remove any accidental
  2829.          keystrokes you make when you are recording a WBM file.
  2830.  
  2831.  
  2832.  
  2833.                                    Unrecordable Areas
  2834.  
  2835.          WinMacro is unable to record keystrokes entered in Windows' System
  2836.          Modal Dialog Boxes.  These include the dialog boxes in the MS-DOS
  2837.          Executive window, as well as dialog boxes generated by severe system
  2838.          errors.  By the same token, WinBatch cannot play back keystrokes in
  2839.          these types of dialog boxes.
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.                                                                              43
  2847.  
  2848.                                                               WINBATCH LANGUAGE
  2849.  
  2850.  
  2851.  
  2852.                                    WINBATCH LANGUAGE
  2853.  
  2854.  
  2855.  
  2856.                                   Language Components
  2857.  
  2858.          WinBatch language statements are constructed from constants,
  2859.          variables, operators, functions, commands, and comments.
  2860.  
  2861.          Each line in a WinBatch file can be up to 255 characters long.
  2862.  
  2863.  
  2864.          Constants
  2865.  
  2866.          The programming language supports both integer and string constants.
  2867.  
  2868.  
  2869.          Integer Constants
  2870.  
  2871.          Integer constants are built from the digits 0 through 9.  They can
  2872.          range in magnitude from negative to positive 231 -1  (approximately
  2873.          two billion).  Constants larger than these permissible magnitudes will
  2874.          produce unpredictable results.
  2875.  
  2876.          Examples of integer constants:
  2877.  
  2878.            1
  2879.            -45
  2880.            377849
  2881.            -1999999999
  2882.  
  2883.  
  2884.          String Constants
  2885.  
  2886.          String constants are comprised of displayable characters bounded by
  2887.          quote marks.  You can use double quotes ("), single quotes ('), or
  2888.          back quotes (`) to enclose a string constant, as long as the same type
  2889.          of quote is used to both start and end it.  If you need to embed the
  2890.          delimiting quote mark inside the string constant, use the delimiting
  2891.          quote mark twice.
  2892.  
  2893.          Examples of string constants:
  2894.  
  2895.            "a"
  2896.            `Betty Boop`
  2897.            "This constant has an embedded "" mark"
  2898.            'This constant also has an embedded " mark'
  2899.  
  2900.  
  2901.                                                                              44
  2902.  
  2903.                                                               WINBATCH LANGUAGE
  2904.  
  2905.  
  2906.          Predefined Constants
  2907.  
  2908.          The programming language has a number of built-in integer constants
  2909.          that can be used for various purposes.  These start with the @-sign,
  2910.          and are case-insensitive (although we prefer to use ALL CAPS).
  2911.  
  2912.          Some predefined constants:
  2913.  
  2914.            @FALSE                              @TILE
  2915.            @NO                                 @TRUE
  2916.            @STACK                              @YES
  2917.  
  2918.          A list of all the predefined constants can be found in Appendix A
  2919.          (pg. 152).
  2920.  
  2921.  
  2922.          Identifiers
  2923.  
  2924.          Identifiers are the names supplied for variables, functions, and
  2925.          commands in your program.
  2926.  
  2927.          An identifier is a sequence of one or more letters or digits that
  2928.          begins with a letter.  Identifiers may have up to 30 characters.
  2929.  
  2930.          All identifiers are case insensitive.  Upper- and lowercase characters
  2931.          may be mixed at will inside variable names, commands or functions.
  2932.  
  2933.          For example, these statements all mean the same thing:
  2934.  
  2935.            AskLine(MyTitle, Prompt, Default)
  2936.            ASKLINE(MYTITLE, PROMPT, DEFAULT)
  2937.            aSkLiNe(MyTiTlE, pRoMpT, dEfAuLt)
  2938.  
  2939.  
  2940.          Variables
  2941.  
  2942.          A variable may contain an integer, a string, or a string representing
  2943.          an integer.  Automatic conversions between integers and strings are
  2944.          performed as a matter of course during execution.
  2945.  
  2946.          If a function requires a string parameter and an integer parameter is
  2947.          supplied, the variable will be automatically modified to include the
  2948.          representative string.
  2949.  
  2950.          If a function requires an integer parameter and a string parameter is
  2951.          supplied, an attempt will be made to convert the string to an integer.
  2952.          If it does not convert successfully, an error will result.
  2953.  
  2954.  
  2955.  
  2956.                                                                              45
  2957.  
  2958.                                                               WINBATCH LANGUAGE
  2959.  
  2960.  
  2961.          Keywords
  2962.  
  2963.          "Keywords" are the predefined identifiers that have special meaning to
  2964.          the programming language.  These cannot be used as variable names.
  2965.  
  2966.          WBL keywords consist of the functions, commands, and predefined
  2967.          constants.
  2968.  
  2969.          Some examples of reserved keywords:
  2970.  
  2971.            Beep
  2972.            DirChange
  2973.            @Yes
  2974.            FileCopy
  2975.  
  2976.  
  2977.          Operators
  2978.  
  2979.          The programming language operators take one operand ("unary
  2980.          operators") or two operands ("binary operators").
  2981.  
  2982.          Unary operators (integers only):
  2983.  
  2984.            -         Arithmetic Negation (Two's complement)
  2985.            +         Identity (Unary plus)
  2986.            ~         Bitwise Not.  Changes each 0 bit to 1, and vice-versa.
  2987.            !         Logical Not.  Produces 0 (@FALSE) if the operand is
  2988.                      nonzero, else 1 (@TRUE) if the operand is zero.
  2989.  
  2990.          Binary arithmetic operators (integers only):
  2991.  
  2992.            *         Multiplication
  2993.            /         Division
  2994.            mod       Modulo
  2995.            +         Addition
  2996.            -         Subtraction
  2997.            <<        Left Shift
  2998.            >>        Right Shift
  2999.            &         Bitwise And
  3000.            |         Bitwise Or
  3001.            ^         Bitwise Exclusive Or (XOR)
  3002.            &&        Logical And
  3003.            ||        Logical Or
  3004.  
  3005.          Binary relational operators (integers and strings):
  3006.  
  3007.            >         Greater-than
  3008.            >=        Greater-than or equal
  3009.  
  3010.  
  3011.                                                                              46
  3012.  
  3013.                                                               WINBATCH LANGUAGE
  3014.  
  3015.  
  3016.            <         Less-than
  3017.            <=        Less-than or equal
  3018.            ==        Equality
  3019.  
  3020.            != or <>  Inequality
  3021.  
  3022.          Assignment operator (integers and strings):
  3023.  
  3024.            =         Assigns evaluated result of an expression to a variable
  3025.  
  3026.  
  3027.          Precedence and evaluation order
  3028.  
  3029.          The precedence of the operators affect the evaluation of operands in
  3030.          expressions.  Operands associated with higher-precedence operators are
  3031.          evaluated before the lower-precedence operators.
  3032.  
  3033.          The table below shows the precedence of the operators.  Where
  3034.          operators have the same precedence, they are evaluated from left to
  3035.          right.
  3036.  
  3037.            Operator            Description
  3038.  
  3039.            ( )                 Parenthetical grouping
  3040.            ~ ! - +             Unary operators
  3041.            * / mod             Multiplication & Division
  3042.            + -                 Addition & Subtraction
  3043.            <<  >>              Shift operators
  3044.            < <= == >= > != <>  Relational operators
  3045.            & ^ |               Bit manipulation operators
  3046.            && ||               Logical operators
  3047.  
  3048.  
  3049.          Comments
  3050.  
  3051.          A comment is a sequence of characters that are ignored when processing
  3052.          a command.  A semicolon (not otherwise part of a string constant)
  3053.          indicates the beginning of a comment.
  3054.  
  3055.          All characters to the right of the semicolon are considered comments,
  3056.          and are ignored.
  3057.  
  3058.          Blank lines are also ignored.
  3059.  
  3060.          Examples of comments:
  3061.  
  3062.            ; This is a comment
  3063.            abc = 5 ; This is also a comment
  3064.  
  3065.  
  3066.                                                                              47
  3067.  
  3068.                                                               WINBATCH LANGUAGE
  3069.  
  3070.  
  3071.          Statements
  3072.  
  3073.  
  3074.          Assignment Statements
  3075.  
  3076.          Assignment statements are used to set variables to specific or
  3077.          computed values.  Variables may be set to integers or strings.
  3078.  
  3079.          Examples:
  3080.  
  3081.            a = 5
  3082.            value = Average(a, 10, 15)
  3083.            location = "Northern Hemisphere"
  3084.            world = StrCat(location, " ", "Southern Hemisphere")
  3085.  
  3086.  
  3087.          Control Statements
  3088.  
  3089.          Control statements are generally used to execute system management
  3090.          functions and consist of a call to a command without assigning any
  3091.          return values.
  3092.  
  3093.          Examples:
  3094.  
  3095.            Exit
  3096.            Yield
  3097.  
  3098.  
  3099.          Substitution
  3100.  
  3101.          The batch language has a powerful substitution feature which inserts
  3102.          the contents of a string variable into a statement before the line is
  3103.          parsed.
  3104.  
  3105.          To substitute the contents of a variable in the statement, simply put
  3106.          a percent-sign (%) on both sides of the variable name.
  3107.  
  3108.          Examples:
  3109.  
  3110.            mycmd = "DirChange('c:\')"    ; set mycmd to a command
  3111.            %mycmd%                       ; execute the command
  3112.  
  3113.          Or consider this one:
  3114.  
  3115.            IniWrite("PC", "User", "Richard")
  3116.            ...
  3117.            owner = IniRead("PC", "User", "somebody")
  3118.            message("", "Thank you, %user%")
  3119.  
  3120.  
  3121.                                                                              48
  3122.  
  3123.                                                               WINBATCH LANGUAGE
  3124.  
  3125.  
  3126.          To put a single percent-sign (%) on a source line, specify a double
  3127.          percent sign(%%).  This is required even inside quoted strings.
  3128.  
  3129.          Note:  The length of a line, after any substitution occurs, may not
  3130.          exceed 255 characters.
  3131.  
  3132.  
  3133.  
  3134.                                   Function Parameters
  3135.  
  3136.          Most of the functions and commands in the language require parameters.
  3137.          These come in three types:
  3138.  
  3139.            Integer
  3140.            String
  3141.            Variable name
  3142.  
  3143.          WinBatch performs automatic conversions between strings and integers,
  3144.          so in general you can use them interchangeably.
  3145.  
  3146.          Integer parameters may be any of the following:
  3147.  
  3148.            An integer (i.e. 23)
  3149.            A string representing an integer (i.e. "23")
  3150.            A variable containing an integer
  3151.            A variable containing a string representing an integer
  3152.  
  3153.          String parameters may be any of the following:
  3154.  
  3155.            A string
  3156.            An integer
  3157.            A variable containing a string
  3158.            A variable containing an integer
  3159.  
  3160.  
  3161.  
  3162.                                 Command-Line Parameters
  3163.  
  3164.          WinBatch is run with the following command line:
  3165.  
  3166.            WINBATCH filename.WBT p1 p2 ... pn
  3167.  
  3168.          "filename.wbt" is any valid WinBatch file.
  3169.  
  3170.          "p1 p2 ... pn" are optional parameters to be passed to the WBT file on
  3171.          startup, delimited by spaces.
  3172.  
  3173.  
  3174.  
  3175.  
  3176.                                                                              49
  3177.  
  3178.                                                               WINBATCH LANGUAGE
  3179.  
  3180.  
  3181.          Parameters passed to a WBT file are automatically parsed into
  3182.          variables named param1, param2, param3, etc.  An additional variable,
  3183.          param0, is the total number of command-line parameters.
  3184.  
  3185.  
  3186.  
  3187.                                      Error Handling
  3188.  
  3189.          There are three types of errors that can occur while processing a
  3190.          batch file:  Minor, Moderate, and Fatal.  What happens when an error
  3191.          occurs depends on the current error mode, which is set with the
  3192.          ErrorMode function.
  3193.  
  3194.          There are three possible modes you can specify:
  3195.  
  3196.          @CANCEL
  3197.  
  3198.            User is notified when any error occurs, and then the batch file is
  3199.            canceled.  This is the default.
  3200.  
  3201.          @NOTIFY
  3202.  
  3203.            User is notified when any error occurs, and has option to continue
  3204.            unless the error is fatal.
  3205.  
  3206.          @OFF
  3207.  
  3208.            User is only notified if the error is moderate or fatal.  User has
  3209.            option to continue unless the error is fatal.
  3210.  
  3211.          The function LastError returns the code of the most-recent error
  3212.          encountered during the current batch file.
  3213.  
  3214.          Minor errors are numbered from 1000 to 1999.
  3215.          Moderate errors are numbered from 2000 to 2999.
  3216.          Fatal errors are numbered from 3000 to 3999.
  3217.  
  3218.          Error handling is reset to @CANCEL at the start of each batch file.
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.                                                                              50
  3232.  
  3233.                                                               WINBATCH LANGUAGE
  3234.  
  3235.  
  3236.                                The Functions & Statements
  3237.  
  3238.  
  3239.                                  Inputting Information
  3240.  
  3241.          AskLine (title, prompt, default)
  3242.  
  3243.            Lets user enter a line of information.
  3244.  
  3245.          AskYesNo (title, question)
  3246.  
  3247.            Lets user choose from Yes, No, or Cancel.
  3248.  
  3249.          ItemCount (list, delimiter)
  3250.  
  3251.            Returns the number of items in a list.
  3252.  
  3253.          ItemExtract (select, list, delimiter)
  3254.  
  3255.            Returns the selected item from a list.
  3256.  
  3257.          ItemSelect (title, list, delimiter)
  3258.  
  3259.            Chooses an item from a listbox.
  3260.  
  3261.          TextBox (title, filename)
  3262.  
  3263.            Fills a listbox from text strings in a file.
  3264.  
  3265.  
  3266.                                  Displaying Information
  3267.  
  3268.          Beep
  3269.  
  3270.            Beeps at the user.
  3271.  
  3272.          DialogBox (title, WBD file)
  3273.  
  3274.            Pops up a Windows dialog box defined by the WBD template file.
  3275.  
  3276.          Display (seconds, title, text)
  3277.  
  3278.            Momentarily displays a string.
  3279.  
  3280.          Message (title, text)
  3281.  
  3282.            Displays text in a message box.
  3283.  
  3284.  
  3285.  
  3286.                                                                              51
  3287.  
  3288.                                                               WINBATCH LANGUAGE
  3289.  
  3290.  
  3291.          Pause (title, text)
  3292.  
  3293.            Displays text in a message box.
  3294.  
  3295.  
  3296.                                     File Management
  3297.  
  3298.          FileAppend (from-list, to-file)
  3299.  
  3300.            Appends one or more files to another file.
  3301.  
  3302.          FileClose (filehandle)
  3303.  
  3304.            Closes a file.
  3305.  
  3306.          FileCopy (from-list, to-file, warning)
  3307.  
  3308.            Copies files.
  3309.  
  3310.          FileDelete (file-list)
  3311.  
  3312.            Deletes files.
  3313.  
  3314.          FileExist (filename)
  3315.  
  3316.            Determines if a file exists.
  3317.  
  3318.          FileExtension (filename)
  3319.  
  3320.            Returns extension of file.
  3321.  
  3322.          FileItemize (file-list)
  3323.  
  3324.            Builds a list of files.
  3325.  
  3326.          FileLocate (filename)
  3327.  
  3328.            Finds a file within the current DOS path.
  3329.  
  3330.          FileMove (from-list, to-file, warning)
  3331.  
  3332.            Moves files to another set of pathnames.
  3333.  
  3334.          FileOpen (filename, open-type)
  3335.  
  3336.            Opens a STANDARD ASCII (only) file for reading or writing.
  3337.  
  3338.  
  3339.  
  3340.  
  3341.                                                                              52
  3342.  
  3343.                                                               WINBATCH LANGUAGE
  3344.  
  3345.  
  3346.          FilePath (filename)
  3347.  
  3348.            Returns path of file.
  3349.  
  3350.          FileRead (filehandle)
  3351.  
  3352.            Reads data from a file.
  3353.  
  3354.          FileRename (from-list, to-file)
  3355.  
  3356.            Renames files to another set of names.
  3357.  
  3358.          FileRoot (filename)
  3359.  
  3360.            Returns root of file.
  3361.  
  3362.          FileSize (file-list)
  3363.  
  3364.            Adds up the total size of a set of files.
  3365.  
  3366.          FileWrite (filehandle,output-data)
  3367.  
  3368.            Writes data to a file.
  3369.  
  3370.          IniRead (section, keyname, default)
  3371.  
  3372.            Reads a string from the WIN.INI file.
  3373.  
  3374.          IniReadPvt (section, keyname, default, filename)
  3375.  
  3376.            Reads a string from a private INI file.
  3377.  
  3378.          IniWrite (section, keyname, string)
  3379.  
  3380.            Writes a string to the WIN.INI file.
  3381.  
  3382.          IniWritePvt (section, keyname, data, filename)
  3383.  
  3384.            Writes a string to a private INI file.
  3385.  
  3386.  
  3387.                                   Directory Management
  3388.  
  3389.          DirChange ([d:]path)
  3390.  
  3391.            Changes the current directory.
  3392.  
  3393.  
  3394.  
  3395.  
  3396.                                                                              53
  3397.  
  3398.                                                               WINBATCH LANGUAGE
  3399.  
  3400.  
  3401.          DirGet ( )
  3402.  
  3403.            Returns the current directory path.
  3404.  
  3405.          DirHome ( )
  3406.  
  3407.            Returns the initial directory path.
  3408.  
  3409.          DirItemize (dir-list)
  3410.  
  3411.            Builds a list of directories.
  3412.  
  3413.          DirMake ([d:]path)
  3414.  
  3415.            Creates a new directory.
  3416.  
  3417.          DirRemove ([d:]path)
  3418.  
  3419.            Removes an existing directory.
  3420.  
  3421.          DirRename ([d:]oldpath, [d:]newpath)
  3422.  
  3423.            Renames a directory.
  3424.  
  3425.  
  3426.                                  Disk Drive Management
  3427.  
  3428.          DiskFree (drive-list)
  3429.  
  3430.            Returns the amount of free space on a set of drives.
  3431.  
  3432.          LogDisk (drive)
  3433.  
  3434.            Changes the logged disk drive.
  3435.  
  3436.  
  3437.                                    Window Management
  3438.  
  3439.          WinActivate (partial-windowname)
  3440.  
  3441.            Makes an application window the active window.
  3442.  
  3443.          WinArrange (style)
  3444.  
  3445.            Arranges all running application windows on the screen.
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.                                                                              54
  3452.  
  3453.                                                               WINBATCH LANGUAGE
  3454.  
  3455.  
  3456.          WinClose (partial-windowname)
  3457.  
  3458.            Closes an application window.
  3459.  
  3460.          WinCloseNot (partial-windowname [, partial-windowname]...)
  3461.  
  3462.            Closes all application windows except those specified.
  3463.  
  3464.          WinConfig ( )
  3465.  
  3466.            Returns WIN3 mode flags.
  3467.  
  3468.          WinExist (partial-windowname)
  3469.  
  3470.            Tells if window exists.
  3471.  
  3472.          WinGetActive ( )
  3473.  
  3474.            Gets the title of the active window.
  3475.  
  3476.          WinHide (partial-windowname)
  3477.  
  3478.            Hides an application window.
  3479.  
  3480.          WinIconize (partial-windowname)
  3481.  
  3482.            Turns an application window into an icon.
  3483.  
  3484.          WinItemize ( )
  3485.  
  3486.            Lists all the main windows currently running.
  3487.  
  3488.          WinPlace (x-ul, y-ul, x-br, y-br, partial-windowname)
  3489.  
  3490.            Changes the size and position of an application window on the
  3491.            screen.
  3492.  
  3493.          WinPosition (partial-windowname)
  3494.  
  3495.            Returns window position.
  3496.  
  3497.          WinShow (partial-windowname)
  3498.  
  3499.            Shows a currently-hidden application window.
  3500.  
  3501.          WinTitle (partial-windowname, new-windowname)
  3502.  
  3503.            Changes the title of an application window.
  3504.  
  3505.  
  3506.                                                                              55
  3507.  
  3508.                                                               WINBATCH LANGUAGE
  3509.  
  3510.  
  3511.          WinWaitClose (partial-windowname)
  3512.  
  3513.            Waits until an application window is closed.
  3514.  
  3515.          WinZoom (partial-windowname)
  3516.  
  3517.            Maximizes an application window to full-screen.
  3518.  
  3519.  
  3520.                                    Program Management
  3521.  
  3522.          Run (program-name, parameters)
  3523.  
  3524.            Runs a program as a normal window.
  3525.  
  3526.          RunHide (program-name, parameters)
  3527.  
  3528.            Runs a program in a hidden window.
  3529.  
  3530.          RunIcon (program-name, parameters)
  3531.  
  3532.            Runs a program as an icon.
  3533.  
  3534.          RunZoom (program-name, parameters)
  3535.  
  3536.            Runs a program in a maximized window.
  3537.  
  3538.  
  3539.                                     String Handling
  3540.  
  3541.          Char2Num (string)
  3542.  
  3543.            Returns the ANSI code of a string's first character.
  3544.  
  3545.          IsNumber (string)
  3546.  
  3547.            Determines if a string represents a valid number.
  3548.  
  3549.          Num2Char (number)
  3550.  
  3551.            Converts a number to the ANSI character it represents.
  3552.  
  3553.          ParseData (string)
  3554.  
  3555.            Parses the passed string, just like passed parameters are parsed.
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.                                                                              56
  3562.  
  3563.                                                               WINBATCH LANGUAGE
  3564.  
  3565.  
  3566.          StrCat (string[, string]...)
  3567.  
  3568.            Concatenates strings together.
  3569.  
  3570.          StrCmp (string1, string2)
  3571.  
  3572.            Compares two strings.
  3573.  
  3574.          StrFill (string, string-length)
  3575.  
  3576.            Builds a string from a repeated smaller string.
  3577.  
  3578.          StrFix (base-string, padding-string, length)
  3579.  
  3580.            Pads or truncates a string to a fixed length.
  3581.  
  3582.          StriCmp (string1, string2)
  3583.  
  3584.            Compares two strings, ignoring their case.
  3585.  
  3586.          StrIndex (main-str, sub-str, start, direction)
  3587.  
  3588.            Locates a string within a larger string.
  3589.  
  3590.          StrLen (string)
  3591.  
  3592.            Returns the length of a string
  3593.  
  3594.          StrLower (string)
  3595.  
  3596.            Converts a string to all lower-case characters.
  3597.  
  3598.          StrReplace (string, old, new)
  3599.  
  3600.            Replaces all occurances of a substring with another.
  3601.  
  3602.          StrScan (main-str, delims, start, direction)
  3603.  
  3604.            Finds an occurrence of one or more delimiter characters in a
  3605.            string.
  3606.  
  3607.          StrSub (string, start, length)
  3608.  
  3609.            Returns a substring from within a string.
  3610.  
  3611.          StrTrim (string)
  3612.  
  3613.            Trims leading and trailing blanks from a string.
  3614.  
  3615.  
  3616.                                                                              57
  3617.  
  3618.                                                               WINBATCH LANGUAGE
  3619.  
  3620.  
  3621.          StrUpper (string)
  3622.  
  3623.            Converts a string to all upper-case characters.
  3624.  
  3625.  
  3626.                                   Arithmetic Functions
  3627.  
  3628.          Abs (number)
  3629.  
  3630.            Returns the absolute value of a number.
  3631.  
  3632.          Average (num [, num]...)
  3633.  
  3634.            Returns the average of a list of integers.
  3635.  
  3636.          Max (num [, num]...)
  3637.  
  3638.            Determines the highest number in a list.
  3639.  
  3640.          Min (num [, num]...)
  3641.  
  3642.            Determines the lowest number in a list.
  3643.  
  3644.          Random (max)
  3645.  
  3646.            Generates a positive random number.
  3647.  
  3648.  
  3649.                                    Clipboard Handling
  3650.  
  3651.          ClipAppend (string)
  3652.  
  3653.            Appends a string to the end of the Clipboard.
  3654.  
  3655.          ClipGet ( )
  3656.  
  3657.            Returns the Clipboard contents into a string.
  3658.  
  3659.          ClipPut (string)
  3660.  
  3661.            Replaces the Clipboard contents with a string.
  3662.  
  3663.  
  3664.                                      System Control
  3665.  
  3666.          Call (filename.wbt, parameters)
  3667.  
  3668.            Calls another WBT file as a subroutine.
  3669.  
  3670.  
  3671.                                                                              58
  3672.  
  3673.                                                               WINBATCH LANGUAGE
  3674.  
  3675.  
  3676.          CallExt (filename.wbt, parameters)
  3677.  
  3678.            Calls another WBT file as a separate subprogram.
  3679.  
  3680.          DateTime ( )
  3681.  
  3682.            Returns the current date and time.
  3683.  
  3684.          Debug (mode)
  3685.  
  3686.            Turns Debug mode on or off.
  3687.  
  3688.          Delay (seconds)
  3689.  
  3690.            Pauses batch file execution.
  3691.  
  3692.          DOSVersion (level)
  3693.  
  3694.            Returns the version numbers of the current version of DOS.
  3695.  
  3696.          Drop (var [, var]...)
  3697.  
  3698.            Deletes variables to recover their memory.
  3699.  
  3700.          EndSession ( )
  3701.  
  3702.            Ends the current Windows session.
  3703.  
  3704.          Environment (env-variable)
  3705.  
  3706.            Returns the value of a DOS environment variable.
  3707.  
  3708.          ErrorMode (mode)
  3709.  
  3710.            Sets what happens in the event of an error.
  3711.  
  3712.          Exclusive (mode)
  3713.  
  3714.            Controls whether or not other Windows program will get any time to
  3715.            execute.
  3716.  
  3717.          Execute statement
  3718.  
  3719.            Directly executes a WinBatch statement.
  3720.  
  3721.          Exit
  3722.  
  3723.            Exits the current batch file's operation.
  3724.  
  3725.  
  3726.                                                                              59
  3727.  
  3728.                                                               WINBATCH LANGUAGE
  3729.  
  3730.  
  3731.          Goto label
  3732.  
  3733.            Changes the flow of control in a batch file.
  3734.  
  3735.          If condition Then statement
  3736.  
  3737.            Conditionally performs a function.
  3738.  
  3739.          IgnoreInput (mode)
  3740.  
  3741.            Turns off hardware input to windows.
  3742.  
  3743.          IsDefined (variable)
  3744.  
  3745.            Determines if a variable is currently defined.
  3746.  
  3747.          IsKeyDown (key-codes)
  3748.  
  3749.            Tells about keys/mouse.
  3750.  
  3751.          IsLicensed ( )
  3752.  
  3753.            Tells if WinBatch is licensed.
  3754.  
  3755.          LastError ( )
  3756.  
  3757.            Returns the last error encountered.
  3758.  
  3759.          Return ( )
  3760.  
  3761.            Returns from a Call or a CallExt to the calling program.
  3762.  
  3763.          SendKey (character-codes)
  3764.  
  3765.            Sends keystrokes to the active application.
  3766.  
  3767.          SKDebug (mode)
  3768.  
  3769.            Controls how SendKey works
  3770.  
  3771.          Version ( )
  3772.  
  3773.            Returns the version of WinBatch currently running.
  3774.  
  3775.          WallPaper (bmp-name, tile)
  3776.  
  3777.            Changes the Windows wallpaper.
  3778.  
  3779.  
  3780.  
  3781.                                                                              60
  3782.  
  3783.                                                               WINBATCH LANGUAGE
  3784.  
  3785.  
  3786.          WinVersion (level)
  3787.  
  3788.            Returns the version of Windows that is currently running.
  3789.  
  3790.          Yield
  3791.  
  3792.            Pauses batch file processing so other applications can process some
  3793.            messages.
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.                                                                              61
  3837.  
  3838.                                                          WBL FUNCTION REFERENCE
  3839.  
  3840.  
  3841.  
  3842.                                  WBL FUNCTION REFERENCE
  3843.  
  3844.  
  3845.  
  3846.                                       Introduction
  3847.  
  3848.          WinBatch gives you more than a hundred functions and commands, which
  3849.          we describe in detail in this section.
  3850.  
  3851.          We use a shorthand notation to indicate the syntax of the functions.
  3852.  
  3853.          Function names and other actual characters you type are in boldface.
  3854.          Optional parameters are enclosed in square brackets "[ ]".  When a
  3855.          function takes a variable number of parameters, the variable parts
  3856.          will be followed by ellipses ("...").
  3857.  
  3858.          Take, for example, string concatenation:
  3859.  
  3860.          StrCat (string[, string]...)
  3861.  
  3862.          This says that the StrCat function takes at least one string
  3863.          parameter.  Optionally, you can specify more strings to concatenate.
  3864.          If you do, you must separate the strings with commas.
  3865.  
  3866.          For each function and command, we show you the Syntax, describe the
  3867.          Parameters (if any), the value it Returns (if any), a description of
  3868.          the function, Example code (shown in courier type), and related
  3869.          functions you may want to See Also.
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.                                                                              62
  3892.  
  3893.                                                          WBL FUNCTION REFERENCE
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.                                           Abs
  3900.  
  3901.          Returns the magnitude of the argument.
  3902.  
  3903.          Syntax:
  3904.  
  3905.            Abs (integer)
  3906.  
  3907.          Parameters:
  3908.  
  3909.            integer =    integer whose absolute value is desired.
  3910.  
  3911.          Returns:
  3912.  
  3913.            (integer)    absolute value of argument.
  3914.  
  3915.          This function returns the absolute (positive) value of the integer
  3916.          which is passed to it, regardless of whether that integer is positive
  3917.          or negative.
  3918.  
  3919.          Example:
  3920.  
  3921.            dy = Abs(y1 - y2)
  3922.            Message("Years", "There are %dy% years 'twixt %y1% and %y2%")
  3923.  
  3924.          See Also:
  3925.  
  3926.            Average, Max, Min
  3927.  
  3928.  
  3929.  
  3930.                                         AskLine
  3931.  
  3932.          Prompts the user for one line of input.
  3933.  
  3934.          Syntax:
  3935.  
  3936.            AskLine (title, prompt, default)
  3937.  
  3938.          Parameters:
  3939.  
  3940.            "title" =    title of the dialog box.
  3941.            "prompt" =   question to be put to the user.
  3942.            "default" =  default answer.
  3943.  
  3944.  
  3945.  
  3946.                                                                              63
  3947.  
  3948.                                                          WBL FUNCTION REFERENCE
  3949.  
  3950.  
  3951.          Returns:
  3952.  
  3953.            (string)     user response.
  3954.  
  3955.          Use this function to query the user for a line of data.  The entire
  3956.          user response will be returned if the user presses the OK button or
  3957.          the Enter key.  If the user presses Cancel, the batch file processing
  3958.          is canceled.
  3959.  
  3960.          Example:
  3961.  
  3962.            name = AskLine("Game", "Please enter your name", "")
  3963.            game = AskLine("Game", "Favorite game?", "Solitaire")
  3964.            message(StrCat(name,"'s favorite game is "), game)
  3965.  
  3966.          See Also:
  3967.  
  3968.            AskYesNo, Display, ItemSelect, Message, Pause, TextBox
  3969.  
  3970.  
  3971.  
  3972.                                         AskYesNo
  3973.  
  3974.          Prompts the user for a YES or NO answer.
  3975.  
  3976.          Syntax:
  3977.  
  3978.            AskYesNo (title, question)
  3979.  
  3980.          Parameters
  3981.  
  3982.            "title" =    title of the question box.
  3983.            "question" = question to be put to the user.
  3984.  
  3985.          Returns:
  3986.  
  3987.            (integer)    @YES or @NO, depending on the button pressed.
  3988.  
  3989.          This function displays a message box with three pushbuttons - Yes, No,
  3990.          and Cancel.  If the user presses Cancel, the current batch file is
  3991.          ended, so there is no return value.
  3992.  
  3993.          Example:
  3994.  
  3995.            q = AskYesNo('Testing', 'Please press "YES"')
  3996.            If q == @YES Then Exit
  3997.            Display(3, 'ERROR', 'I said press "YES"')
  3998.  
  3999.  
  4000.  
  4001.                                                                              64
  4002.  
  4003.                                                          WBL FUNCTION REFERENCE
  4004.  
  4005.  
  4006.          See Also:
  4007.  
  4008.            AskLine, Display, ItemSelect, Message, Pause, TextBox
  4009.  
  4010.  
  4011.  
  4012.                                         Average
  4013.  
  4014.          Provides the integer average of the arguments.
  4015.  
  4016.          Syntax:
  4017.  
  4018.            Average (integer [, integer]...)
  4019.  
  4020.          Parameters:
  4021.  
  4022.            integer =    integers to get the average of.
  4023.  
  4024.          Returns:
  4025.  
  4026.            (integer)    average of the arguments.
  4027.  
  4028.          Use this function to compute the mean average of a series of numbers,
  4029.          delimited by commas.  This function returns an integer value, so there
  4030.          can be some rounding error involved.
  4031.  
  4032.          Example:
  4033.  
  4034.            avg = Average(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
  4035.            Message("The average is", avg)
  4036.  
  4037.          See Also:
  4038.  
  4039.            Abs, Max, Min
  4040.  
  4041.  
  4042.  
  4043.                                           Beep
  4044.  
  4045.          Beeps once.
  4046.  
  4047.          Syntax:
  4048.  
  4049.            Beep
  4050.  
  4051.          Use this command to produce a short beep, generally to alert the user
  4052.          to an error situation.
  4053.  
  4054.  
  4055.  
  4056.                                                                              65
  4057.  
  4058.                                                          WBL FUNCTION REFERENCE
  4059.  
  4060.  
  4061.          Example:
  4062.  
  4063.            Beep
  4064.            Pause("WARNING!!!", "You are about to destroy data!")
  4065.  
  4066.  
  4067.  
  4068.                                           Call
  4069.  
  4070.          Calls another WBT file as a subroutine.
  4071.  
  4072.          Syntax:
  4073.  
  4074.            Call (filename.wbt, parameters)
  4075.  
  4076.          Parameters:
  4077.  
  4078.            "filename.wbt" = the WBT file you are calling.  The WBT extension
  4079.                             is required.
  4080.  
  4081.            "parameters" =   the parameters to pass to the file, if any, in the
  4082.                             form "p1 p2 p3 ... pn".
  4083.  
  4084.          Returns:
  4085.  
  4086.            (integer)        always @FALSE.
  4087.  
  4088.          This function is used to pass control temporarily to a secondary WBT
  4089.          file.  The main WBT file can optionally pass parameters to the
  4090.          secondary WBT file.  All variables are common (global) between the
  4091.          calling and the called WBT files, so that the secondary WBT file may
  4092.          modify or create variables.  The secondary WBT file should end with a
  4093.          Return statement, to pass control back to the main WBT file.
  4094.  
  4095.          If a string of parameters is passed to the secondary WBT file, it will
  4096.          automatically be parsed into individual variables with the names
  4097.          param1, param2, param3, etc.  The variable param0 will be a count of
  4098.          the total number of parameters in the string.
  4099.  
  4100.          Example:
  4101.  
  4102.            ; MAIN.WBT
  4103.            name = AskLine("", "What is your name?", "")
  4104.            age = AskLine("", "How old are you?", "")
  4105.            valid = @NO
  4106.            Call("chek-age.wbt", age)
  4107.            If valid == @NO Then Message("", "Invalid age")
  4108.  
  4109.  
  4110.  
  4111.                                                                              66
  4112.  
  4113.                                                          WBL FUNCTION REFERENCE
  4114.  
  4115.  
  4116.            ; CHEK-AGE.WBT
  4117.            userage = param1
  4118.            really = AskYesNo("", "%name%, are you really %userage%?")
  4119.            If really == @NO Then Return
  4120.            If (userage > 0) && (userage < 150) Then valid = @YES
  4121.            Return
  4122.  
  4123.          See Also:
  4124.  
  4125.            CallExt, ParseData, Return
  4126.  
  4127.  
  4128.  
  4129.                                         CallExt
  4130.  
  4131.          Calls another WBT file as a separate subprogram.
  4132.  
  4133.          Syntax:
  4134.  
  4135.            CallExt (filename.wbt, parameters)
  4136.  
  4137.          Parameters:
  4138.  
  4139.            "filename.wbt" = the WBT file you are calling.  The extension is
  4140.                             required.
  4141.            "parameters" =   the parameters to pass to the file, if any, in the
  4142.                             form "p1 p2 p3 ... pn".
  4143.  
  4144.          Returns:
  4145.  
  4146.            (integer)        always @FALSE.
  4147.  
  4148.          This function is used to pass control temporarily to a secondary WBT
  4149.          file.  The main WBT file can optionally pass parameters to the
  4150.          secondary WBT file.  All variables are exclusive (local) to their
  4151.          respective files, so that neither WBT file "knows about" variables
  4152.          being used by the other.  The secondary WBT file should end with a
  4153.          Return statement, to pass control back to the main WBT file.
  4154.  
  4155.          If a string of parameters is passed to the secondary WBT file, it will
  4156.          automatically be parsed into individual variables with the names
  4157.          param1, param2, param3, etc.  The variable param0 will be a count of
  4158.          the total number of parameters in the string.
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.                                                                              67
  4167.  
  4168.                                                          WBL FUNCTION REFERENCE
  4169.  
  4170.  
  4171.          Example:
  4172.  
  4173.            ; MAIN.WBT
  4174.            old = AskLine("RENAME", "File to rename", "")
  4175.            If !FileExist(old) Then Exit
  4176.            new = AskLine("RENAME", "New name for %old%", "")
  4177.            If FileExist(new) Then Exit
  4178.            CallExt("rename.wbt", "%old% %new%")
  4179.  
  4180.            ; RENAME.WBT
  4181.            old = param1
  4182.            new = param2
  4183.            FileRename(old, new)
  4184.            Return
  4185.  
  4186.          See Also:
  4187.  
  4188.            Call, ParseData, Return
  4189.  
  4190.  
  4191.  
  4192.                                         Char2Num
  4193.  
  4194.          Converts the first character of a string to its numeric equivalent.
  4195.  
  4196.          Syntax:
  4197.  
  4198.            Char2Num (string)
  4199.  
  4200.          Parameters:
  4201.  
  4202.            "string" =   any text string.  Only the first character will be
  4203.                         converted.
  4204.  
  4205.          Returns:
  4206.  
  4207.            (integer)    ANSI character code.
  4208.  
  4209.          This function returns the 8-bit ANSI code corresponding to the first
  4210.          character of the string parameter.
  4211.  
  4212.          Note:  For the commonly-used characters (with codes below 128), ANSI
  4213.          and ASCII characters are identical.
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.                                                                              68
  4222.  
  4223.                                                          WBL FUNCTION REFERENCE
  4224.  
  4225.  
  4226.          Example:
  4227.  
  4228.            ; Show the hex equivalent of entered character
  4229.            inpchar = AskLine("ANSI Equivalents", "Char:", "")
  4230.            ansi = StrSub(inpchar, 1, 1)
  4231.            ansiequiv = Char2Num(InpChar)
  4232.            Message("ANSI Codes", "%ansi% => %ansiequiv%")
  4233.  
  4234.          See Also:
  4235.  
  4236.            Num2Char
  4237.  
  4238.  
  4239.  
  4240.                                        ClipAppend
  4241.  
  4242.          Appends a string to the Clipboard.
  4243.  
  4244.          Syntax:
  4245.  
  4246.            ClipAppend (string)
  4247.  
  4248.          Parameters:
  4249.  
  4250.            "string" =   text string to add to Clipboard.
  4251.  
  4252.          Returns:
  4253.  
  4254.            (integer)    @TRUE if string was appended;
  4255.                         @FALSE if Clipboard ran out of memory.
  4256.  
  4257.          Use this function to append a string to the Windows Clipboard.  The
  4258.          Clipboard must either contain text data or be empty for this function
  4259.          to succeed.
  4260.  
  4261.          Example:
  4262.  
  4263.            ; The code below will append 2 copies of the
  4264.            ; Clipboard contents back to the Clipboard, resulting
  4265.            ; in 3 copies of the original contents with a CR/LF
  4266.            ; between each copy.
  4267.            a = ClipGet()
  4268.            crlf = StrCat(Num2Char(13), Num2Char(10))
  4269.            ClipAppend(crlf)
  4270.            ClipAppend(a)
  4271.            ClipAppend(crlf)
  4272.            ClipAppend(a)
  4273.  
  4274.  
  4275.  
  4276.                                                                              69
  4277.  
  4278.                                                          WBL FUNCTION REFERENCE
  4279.  
  4280.  
  4281.          See Also:
  4282.  
  4283.            ClipGet, ClipPut
  4284.  
  4285.  
  4286.  
  4287.                                         ClipGet
  4288.  
  4289.          Returns the contents of the Clipboard.
  4290.  
  4291.          Syntax:
  4292.  
  4293.            ClipGet ( )
  4294.  
  4295.          Parameters:
  4296.  
  4297.            (none)
  4298.  
  4299.          Returns:
  4300.  
  4301.            (string)     clipboard contents.
  4302.  
  4303.          Use this function to copy text from the Windows Clipboard into a
  4304.          string variable.
  4305.  
  4306.          Note:  If the Clipboard contains an excessively large string a (fatal)
  4307.          out of memory error may occur.
  4308.  
  4309.          Example:
  4310.  
  4311.            ; The code below will convert Clipboard contents to
  4312.            ; uppercase
  4313.            ClipPut(StrUpper(ClipGet()))
  4314.            a = ClipGet()
  4315.            Message("UPPERCASE Clipboard Contents", a)
  4316.  
  4317.          See Also:
  4318.  
  4319.            ClipAppend, ClipPut
  4320.  
  4321.  
  4322.  
  4323.                                         ClipPut
  4324.  
  4325.          Copies a string to the clipboard.
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.                                                                              70
  4332.  
  4333.                                                          WBL FUNCTION REFERENCE
  4334.  
  4335.  
  4336.          Syntax:
  4337.  
  4338.            ClipPut (string)
  4339.  
  4340.          Parameters:
  4341.  
  4342.            "string" =   any text string.
  4343.  
  4344.          Returns:
  4345.  
  4346.            (integer)    @TRUE if string was copied;
  4347.                         @FALSE if clipboard ran out of memory.
  4348.  
  4349.          Use this function to copy a string to the Windows Clipboard.  The
  4350.          previous Clipboard contents will be lost.
  4351.  
  4352.          Example:
  4353.  
  4354.            ; The code below will convert Clipboard contents to
  4355.            ; lowercase
  4356.            ClipPut(StrLower(ClipGet()))
  4357.            a = ClipGet()
  4358.            Message("lowercase Clipboard Contents", a)
  4359.  
  4360.          See Also:
  4361.  
  4362.            ClipAppend, ClipGet
  4363.  
  4364.  
  4365.  
  4366.                                         DateTime
  4367.  
  4368.          Provides the current Date and time.
  4369.  
  4370.          Syntax:
  4371.  
  4372.            DateTime ( )
  4373.  
  4374.          Parameters:
  4375.  
  4376.            (none)
  4377.  
  4378.          Returns:
  4379.  
  4380.            (string)     today's date and time
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.                                                                              71
  4387.  
  4388.                                                          WBL FUNCTION REFERENCE
  4389.  
  4390.  
  4391.          This function will return the current date and time in a pre-formatted
  4392.          string.  The format it is returned in depends on how it is set up in
  4393.          the international section of the WIN.INI file:
  4394.  
  4395.          ddd mm:dd:yy hh:mm:ss XX
  4396.          ddd dd:mm:yy hh:mm:ss XX
  4397.          ddd yy:mm:dd hh:mm:ss XX
  4398.  
  4399.          Where:
  4400.  
  4401.            ddd is day of the week (e.g. Mon)
  4402.            mm  is the month (e.g. 10)
  4403.            dd  is the day of the month (e.g. 23)
  4404.            yy  is the year (e.g. 90)
  4405.            hh  is the hours
  4406.            mm  is the minutes
  4407.            ss  is the seconds
  4408.            XX  is the Day/Night code (e.g. AM or PM)
  4409.  
  4410.          Note:  Windows provides even more formatting options than this.
  4411.  
  4412.          The WIN.INI file will be examined to determine which format to use.
  4413.          You can adjust the WIN.INI file via the International section of the
  4414.          Control Panel if the format isn't what you prefer.
  4415.  
  4416.          Example:
  4417.  
  4418.            ; assuming the current standard is U.S.
  4419.            ; (i.e. day  dd/mm/yy hh:mm:ss AM)
  4420.            Message("Current Date & Time", DateTime())
  4421.  
  4422.  
  4423.  
  4424.                                          Debug
  4425.  
  4426.          Controls the debug mode.
  4427.  
  4428.          Syntax:
  4429.  
  4430.            Debug (mode)
  4431.  
  4432.          Parameters:
  4433.  
  4434.            mode =       @ON or @OFF
  4435.  
  4436.          Returns:
  4437.  
  4438.            (integer)    previous debug mode
  4439.  
  4440.  
  4441.                                                                              72
  4442.  
  4443.                                                          WBL FUNCTION REFERENCE
  4444.  
  4445.  
  4446.          Use this function to turn the debug mode on or off.  The default is
  4447.          @OFF.
  4448.  
  4449.          When debug mode is on, WinBatch will display the statement just
  4450.          executed, its result (if any), any error conditions, and the next
  4451.          statement to execute.
  4452.  
  4453.          The statements are displayed in a special dialog box.  As you can see
  4454.          in the Example section following, the dialog box gives the user four
  4455.          options:  Next, Run, Cancel and Show Var.
  4456.  
  4457.          Next executes the next statement and remains in debug mode.
  4458.  
  4459.          Run exits debug mode and runs the rest of the program normally.
  4460.  
  4461.          Cancel terminates the current batch file.
  4462.  
  4463.          Show Var displays the contents of a variable whose name the user
  4464.          entered in the edit box.
  4465.  
  4466.          Example:
  4467.  
  4468.            Debug(@ON)
  4469.            a = 6
  4470.            q = AskYesNo("Testing Debug Mode", "Is the Pope Catholic")
  4471.            Debug(@OFF)
  4472.            b = a + 4
  4473.  
  4474.          See Also:
  4475.  
  4476.            ErrorMode, LastError
  4477.  
  4478.  
  4479.  
  4480.                                          Delay
  4481.  
  4482.          Pauses execution for a specified amount of time.
  4483.  
  4484.          Syntax:
  4485.  
  4486.            Delay (seconds)
  4487.  
  4488.          Parameters:
  4489.  
  4490.            seconds =    integer seconds to delay (2 - 15)
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.                                                                              73
  4497.  
  4498.                                                          WBL FUNCTION REFERENCE
  4499.  
  4500.  
  4501.          Returns:
  4502.  
  4503.            (integer)    always @TRUE
  4504.  
  4505.          This function causes the currently-executing batch file to be
  4506.          suspended for the specified period of time.  Seconds must be an
  4507.          integer between 2 and 15.  Smaller or larger numbers will be adjusted
  4508.          accordingly.
  4509.  
  4510.          Example:
  4511.  
  4512.            Message("Wait", "About 15 seconds")
  4513.            Delay(15)
  4514.            Message("Hi", "I'm Baaaaaaack")
  4515.  
  4516.          See Also:
  4517.  
  4518.            Yield
  4519.  
  4520.  
  4521.  
  4522.                                        DialogBox
  4523.  
  4524.          Pops up a Windows dialog box defined by the WBD template file.
  4525.  
  4526.          Syntax:
  4527.  
  4528.            DialogBox ("title", "WBD file")
  4529.  
  4530.          Parameters:
  4531.  
  4532.            "title" =    the title of the dialog box.
  4533.            "WBD file" = the name of the WBD template file.
  4534.  
  4535.          Returns:
  4536.  
  4537.            (integer)    always 0.
  4538.  
  4539.          Each element in the template file is enclosed in square brackets, and
  4540.          consists of a variable name, followed by one of the following symbols:
  4541.  
  4542.            Symbol  Meaning                  Example
  4543.  
  4544.               +    check box                [backup+1Save backup]
  4545.               #    edit box                 [newfile#         ]
  4546.               \    file selection listbox   [editfile\        ]
  4547.               ^    radio button             [prog^1Note]   [prog^2Write]
  4548.               $    variable                 [var$]
  4549.  
  4550.  
  4551.                                                                              74
  4552.  
  4553.                                                          WBL FUNCTION REFERENCE
  4554.  
  4555.  
  4556.          The number following the check box and radio button symbols is the
  4557.          value which will get assigned to the variable if its corresponding box
  4558.          is checked, or button is selected.  Following the number is the
  4559.          descriptive text which will appear next to the box or button.
  4560.  
  4561.          When used in conjunction with a file selection list box variable with
  4562.          the same name, two of these symbols have special meanings:
  4563.  
  4564.               #    file mask edit box  [editfile#     ]
  4565.               $    directory variable  [editfile$     ]
  4566.  
  4567.          Anything not appearing within square brackets is displayed as text.
  4568.  
  4569.          Example:
  4570.  
  4571.            [editfile$             ]
  4572.               File mask [editfile#     ]
  4573.            [editfile\             ]
  4574.            [editfile\             ]
  4575.            [editfile\             ]
  4576.            [editfile\             ]
  4577.            [editfile\             ]
  4578.            [backup+1Save backup of file]
  4579.            [prog^1Notepad]     [prog^2WinEdit]
  4580.  
  4581.          See Also:
  4582.  
  4583.            Manual section on the DialogBox function (pg. 31).
  4584.  
  4585.  
  4586.  
  4587.                                        DirChange
  4588.  
  4589.          Changes the current directory.  Can also log a new drive.
  4590.  
  4591.          Syntax:
  4592.  
  4593.            DirChange ([d:]path)
  4594.  
  4595.          Parameters:
  4596.  
  4597.            "[d:]" =     an optional disk drive to log onto.
  4598.            "path" =     the desired path.
  4599.  
  4600.          Returns:
  4601.  
  4602.            (integer)    @TRUE if directory was changed;
  4603.                         @FALSE if the path could not be found.
  4604.  
  4605.  
  4606.                                                                              75
  4607.  
  4608.                                                          WBL FUNCTION REFERENCE
  4609.  
  4610.  
  4611.          Use this function to change the current working directory to another
  4612.          directory, either on the same or a different disk drive.
  4613.  
  4614.          Example:
  4615.  
  4616.            DirChange("c:\")
  4617.            TextBox("This is your CONFIG.SYS file", "config.sys")
  4618.  
  4619.          See Also:
  4620.  
  4621.            DirGet, DirHome, LogDisk
  4622.  
  4623.  
  4624.  
  4625.                                          DirGet
  4626.  
  4627.          Gets the current working directory.
  4628.  
  4629.          Syntax:
  4630.  
  4631.            DirGet ( )
  4632.  
  4633.          Parameters:
  4634.  
  4635.            (none)
  4636.  
  4637.          Returns:
  4638.  
  4639.            (string) =   current working directory.
  4640.  
  4641.          Use this function to determine which directory we are currently in.
  4642.          It's especially useful when changing drives or directories
  4643.          temporarily.
  4644.  
  4645.          Example:
  4646.  
  4647.            ; Get, then restore current working directory
  4648.            origdir = DirGet()
  4649.            DirChange("c:\")
  4650.            FileCopy("config.sys", "%origdir%xxxtemp.xyz", @FALSE)
  4651.            DirChange(origdir)
  4652.  
  4653.          See Also:
  4654.  
  4655.            DirHome
  4656.  
  4657.  
  4658.  
  4659.  
  4660.  
  4661.                                                                              76
  4662.  
  4663.                                                          WBL FUNCTION REFERENCE
  4664.  
  4665.  
  4666.                                         DirHome
  4667.  
  4668.          Returns directory containing the WinBatch executable files.
  4669.  
  4670.          Syntax:
  4671.  
  4672.            DirHome ( )
  4673.  
  4674.          Parameters:
  4675.  
  4676.            (none)
  4677.  
  4678.          Returns:
  4679.  
  4680.            (string)     pathname of the home directory.
  4681.  
  4682.          Use this function to determine the location of WINBATCH.EXE.
  4683.  
  4684.          Example:
  4685.  
  4686.            a = DirHome()
  4687.            Message("WinBatch Executable is in ", a)
  4688.  
  4689.          See Also:
  4690.  
  4691.            DirGet
  4692.  
  4693.  
  4694.  
  4695.                                        DirItemize
  4696.  
  4697.          Returns a space-delimited list of directories.
  4698.  
  4699.          Syntax:
  4700.  
  4701.            DirItemize (dir-list)
  4702.  
  4703.          Parameters:
  4704.  
  4705.            "dir-list" = a string containing a set of subdirectory names, which
  4706.                         may be wildcarded.
  4707.  
  4708.          Returns:
  4709.  
  4710.            (string)     list of directories.
  4711.  
  4712.          This function compiles a list of subdirectories and separates the
  4713.          names with spaces.
  4714.  
  4715.  
  4716.                                                                              77
  4717.  
  4718.                                                          WBL FUNCTION REFERENCE
  4719.  
  4720.  
  4721.          This is especially useful in conjunction with the ItemSelect function,
  4722.          which enables the user to choose an item from such a space-delimited
  4723.          list.
  4724.  
  4725.          DirItemize("*.*") returns all dirs
  4726.  
  4727.          Example:
  4728.  
  4729.            a = DirItemize("*")
  4730.            ItemSelect("Directories", a, " ")
  4731.  
  4732.          See Also:
  4733.  
  4734.            FileItemize, WinItemize, ItemSelect
  4735.  
  4736.  
  4737.  
  4738.                                         DirMake
  4739.  
  4740.          Creates a new directory.
  4741.  
  4742.          Syntax:
  4743.  
  4744.            DirMake ([d:]path)
  4745.  
  4746.          Parameters:
  4747.  
  4748.            "[d:]" =     the desired disk drive.
  4749.            "path" =     the path to create.
  4750.  
  4751.          Returns:
  4752.  
  4753.            (integer)    @TRUE if the directory was successfully created;
  4754.                         @FALSE if it wasn't.
  4755.  
  4756.          Use this function to create a new directory.
  4757.  
  4758.          Example:
  4759.  
  4760.            DirMake("c:\xxxstuff")
  4761.  
  4762.          See Also:
  4763.  
  4764.            DirRemove, DirRename
  4765.  
  4766.  
  4767.  
  4768.  
  4769.  
  4770.  
  4771.                                                                              78
  4772.  
  4773.                                                          WBL FUNCTION REFERENCE
  4774.  
  4775.  
  4776.                                        DirRemove
  4777.  
  4778.          Removes a directory.
  4779.  
  4780.          Syntax:
  4781.  
  4782.            DirRemove (dir-list)
  4783.  
  4784.          Parameters:
  4785.  
  4786.            "dir-list" = a space-delimited list of directory pathnames.
  4787.  
  4788.          Returns:
  4789.  
  4790.            (integer)    @TRUE if the directory was successfully removed;
  4791.                         @FALSE if it wasn't.
  4792.  
  4793.          Use this function to delete directories.  You can delete one or more
  4794.          at a time by separating directory names with spaces.  You cannot,
  4795.          however, use wildcards.
  4796.  
  4797.          Examples:
  4798.  
  4799.            DirRemove("c:\xxxstuff")
  4800.  
  4801.            DirRemove("tempdir1 tempdir2 tempdir3")
  4802.  
  4803.          See Also:
  4804.  
  4805.            DirMake, DirRename
  4806.  
  4807.  
  4808.  
  4809.                                        DirRename
  4810.  
  4811.          Renames a directory.
  4812.  
  4813.          Syntax:
  4814.  
  4815.            DirRename ([d:]oldpath, [d:]newpath)
  4816.  
  4817.          Parameters:
  4818.  
  4819.            "oldpath" =  existing directory name, with optional drive.
  4820.            "newpath" =  new name for directory.
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826.                                                                              79
  4827.  
  4828.                                                          WBL FUNCTION REFERENCE
  4829.  
  4830.  
  4831.          Returns:
  4832.  
  4833.            (integer)    @TRUE if the directory was successfully renamed;
  4834.                         @FALSE if it wasn't.
  4835.  
  4836.          Example:
  4837.  
  4838.            DirRename("c:\temp", "c:\work")
  4839.  
  4840.          See Also:
  4841.  
  4842.            DirMake, DirRemove
  4843.  
  4844.  
  4845.  
  4846.                                         DiskFree
  4847.  
  4848.          Finds the total space available on a group of drives.
  4849.  
  4850.          Syntax:
  4851.  
  4852.            DiskFree (drive-list)
  4853.  
  4854.          Parameters:
  4855.  
  4856.            "drive-list" = at least one drive letter, separated by spaces.
  4857.  
  4858.          Returns:
  4859.  
  4860.            (integer)      the number of bytes available on all the specified
  4861.                           drives.
  4862.  
  4863.          This function takes a string consisting of drive letters, separated by
  4864.          spaces.  Only the first character of each non-blank group of
  4865.          characters is used to determine the drives, so you can use just the
  4866.          drive letters, or add a colon (:), or add a backslash (\), or even a
  4867.          whole pathname, and still get a perfectly valid result.
  4868.  
  4869.          Example:
  4870.  
  4871.            size = DiskFree("c d")
  4872.            Message("Space Available on C: & D:", size)
  4873.  
  4874.          See Also:
  4875.  
  4876.            FileSize
  4877.  
  4878.  
  4879.  
  4880.  
  4881.                                                                              80
  4882.  
  4883.                                                          WBL FUNCTION REFERENCE
  4884.  
  4885.  
  4886.                                         Display
  4887.  
  4888.          Displays a message to the user for a specified period of time.
  4889.  
  4890.          Syntax:
  4891.  
  4892.            Display (seconds, title, text)
  4893.  
  4894.          Parameters:
  4895.  
  4896.            seconds =    integer seconds to display the message (1-15).
  4897.            "title" =    title of the window to be displayed.
  4898.            "text" =     text of the window to be displayed.
  4899.  
  4900.          Returns:
  4901.  
  4902.            (integer)    always @TRUE.
  4903.  
  4904.          Use this function to display a message for a few seconds, and then
  4905.          continue processing without user input.
  4906.  
  4907.          Seconds must be an integer between 1 and 15.  Smaller or larger
  4908.          numbers will be adjusted accordingly.
  4909.  
  4910.          The display box may be prematurely canceled by the user by clicking a
  4911.          mouse button, or hitting any key.
  4912.  
  4913.          Example:
  4914.  
  4915.            Display(3, "Current window is", WinGetActive())
  4916.  
  4917.          See Also:
  4918.  
  4919.            Pause, Message
  4920.  
  4921.  
  4922.  
  4923.                                        DOSVersion
  4924.  
  4925.          Returns the version numbers of the current version of DOS.
  4926.  
  4927.          Syntax:
  4928.  
  4929.            DOSVersion (level)
  4930.  
  4931.          Parameters:
  4932.  
  4933.            level =      @MAJOR or @MINOR.
  4934.  
  4935.  
  4936.                                                                              81
  4937.  
  4938.                                                          WBL FUNCTION REFERENCE
  4939.  
  4940.  
  4941.          Returns:
  4942.  
  4943.            (integer)    integer or decimal part of DOS version number.
  4944.  
  4945.          @MAJOR returns the integer part (to the left of the decimal).
  4946.          @MINOR returns the decimal part (to the right of the decimal).
  4947.  
  4948.          If the version of DOS in use is 4.0, then:
  4949.  
  4950.            DOSVersion(@MAJOR) == 4
  4951.            DOSVersion(@MINOR) == 0
  4952.  
  4953.          Example:
  4954.  
  4955.            i = DOSVersion(@MAJOR)
  4956.            d = DOSVersion(@MINOR)
  4957.            If StrLen(d) == 1 Then d = StrCat("0", d)
  4958.            Message("DOS Version", "%i%.%d%")
  4959.  
  4960.          See Also:
  4961.  
  4962.            Environment, Version, WinVersion
  4963.  
  4964.  
  4965.  
  4966.                                           Drop
  4967.  
  4968.          Removes variables from memory.
  4969.  
  4970.          Syntax:
  4971.  
  4972.            Drop (var, [var]...)
  4973.  
  4974.          Parameters:
  4975.  
  4976.            var =        variable names to remove.
  4977.  
  4978.          Returns:
  4979.  
  4980.            (integer)    always @TRUE.
  4981.  
  4982.          This function removes variables from the language processor's variable
  4983.          list, and recovers the memory associated with the variable (and
  4984.          possibly related string storage).
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.                                                                              82
  4992.  
  4993.                                                          WBL FUNCTION REFERENCE
  4994.  
  4995.  
  4996.          Example:
  4997.  
  4998.            a = "A variable"
  4999.            b = "Another one"
  5000.            Drop(a, b)         ; This removes A and B from memory
  5001.  
  5002.  
  5003.  
  5004.                                        EndSession
  5005.  
  5006.          Ends the Windows session.
  5007.  
  5008.          Syntax:
  5009.  
  5010.            EndSession ( )
  5011.  
  5012.          Parameters:
  5013.  
  5014.            (none)
  5015.  
  5016.          Returns:
  5017.  
  5018.            (integer)    always 0.
  5019.  
  5020.          Use this command to end the Windows session.  This command is
  5021.          equivalent to closing the Program Manager window.
  5022.  
  5023.          Example:
  5024.  
  5025.            sure = AskYesNo ("End Session", "You SURE you want to exit
  5026.               Windows?")
  5027.            If sure == @No Then Goto cancel
  5028.            EndSession()
  5029.            :cancel
  5030.            Message("", "Exit Windows canceled")
  5031.  
  5032.          See Also:
  5033.  
  5034.            Exit, WinClose, WinCloseNot
  5035.  
  5036.  
  5037.  
  5038.                                       Environment
  5039.  
  5040.          Gets a DOS environment variable.
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.                                                                              83
  5047.  
  5048.                                                          WBL FUNCTION REFERENCE
  5049.  
  5050.  
  5051.          Syntax:
  5052.  
  5053.            Environment (env-variable)
  5054.  
  5055.          Parameters:
  5056.  
  5057.            "env-variable" = any defined environment variable.
  5058.  
  5059.          Returns:
  5060.  
  5061.            (string)     environment variable contents.
  5062.  
  5063.          Use this function to query the DOS environment.
  5064.  
  5065.          Example:
  5066.  
  5067.            ; Display the PATH for this DOS session
  5068.            currpath = Environment("PATH")
  5069.            Message("Current DOS Path", currpath)
  5070.  
  5071.          See Also:
  5072.  
  5073.            IniRead, Version, WinVersion
  5074.  
  5075.  
  5076.  
  5077.                                        ErrorMode
  5078.  
  5079.          Specifies how to handle errors.
  5080.  
  5081.          Syntax:
  5082.  
  5083.            ErrorMode (mode)
  5084.  
  5085.          Parameters:
  5086.  
  5087.            mode =       @CANCEL or @NOTIFY or @OFF.
  5088.  
  5089.          Returns:
  5090.  
  5091.            (integer)    previous error setting.
  5092.  
  5093.          Use this function to control the effects of runtime errors.  The
  5094.          default is @CANCEL, meaning the execution of the batch file will be
  5095.          canceled for any error.
  5096.  
  5097.          @CANCEL:  All runtime errors will cause execution to be canceled.  The
  5098.          user will be notified which error occurred.
  5099.  
  5100.  
  5101.                                                                              84
  5102.  
  5103.                                                          WBL FUNCTION REFERENCE
  5104.  
  5105.  
  5106.          @NOTIFY:  All runtime errors will be reported to the user, and the
  5107.          user can choose to continue if it isn't fatal.
  5108.  
  5109.          @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  5110.          errors will be reported to the user.  User has the option of
  5111.          continuing if the error is not fatal.
  5112.  
  5113.          In general, we suggest the normal state of the program should be
  5114.          ErrorMode(@CANCEL), especially if you are writing a batch file for
  5115.          others to use.  You can always suppress errors you expect will occur
  5116.          and then re-enable ErrorMode (@CANCEL).
  5117.  
  5118.          Example:
  5119.  
  5120.            ; Delete xxxtest.xyz.  If file doesn't exist,
  5121.            ; continue execution; don't stop
  5122.            prevmode = ErrorMode(@OFF)
  5123.            FileDelete("c:\xxxtest.xyz")
  5124.            ErrorMode(prevmode)
  5125.  
  5126.          See Also:
  5127.  
  5128.            Debug, LastError
  5129.  
  5130.  
  5131.  
  5132.                                         Execute
  5133.  
  5134.          Executes a statement in a protected environment.  Any errors
  5135.          encountered are recoverable.
  5136.  
  5137.          Syntax:
  5138.  
  5139.            Execute statement
  5140.  
  5141.          Parameters:
  5142.  
  5143.            "statement" =  is (hopefully) an executable statement.
  5144.  
  5145.          Use this command to execute computed or user-entered statements.  Due
  5146.          to the built-in error recovery associated with Execute, it is ideal
  5147.          for interactive execution of user-entered commands.
  5148.  
  5149.          Note that the Execute command doesn't operate on a string, per se, but
  5150.          rather on a direct statement.  If you want to put a code segment into
  5151.          a string variable, you must use the substitution feature of the
  5152.          language, as in the example below.
  5153.  
  5154.  
  5155.  
  5156.                                                                              85
  5157.  
  5158.                                                          WBL FUNCTION REFERENCE
  5159.  
  5160.  
  5161.          Example:
  5162.  
  5163.            cmd = ""
  5164.            cmd = AskLine("WBL Interactive", "Command:", cmd)
  5165.            Execute %cmd%
  5166.  
  5167.  
  5168.  
  5169.                                           Exit
  5170.  
  5171.          Terminates the batch file being interpreted.
  5172.  
  5173.          Syntax:
  5174.  
  5175.            Exit
  5176.  
  5177.          Use this command to prematurely exit a batch file process.  An exit is
  5178.          implied at the end of each batch file.
  5179.  
  5180.          Example:
  5181.  
  5182.            a = 100
  5183.            Message("The value of a is", a)
  5184.            Exit
  5185.  
  5186.          See Also:
  5187.  
  5188.            Pause
  5189.  
  5190.  
  5191.  
  5192.                                        Exclusive
  5193.  
  5194.          Controls whether or not other Windows programs will get any time to
  5195.          execute.
  5196.  
  5197.          Syntax:
  5198.  
  5199.            Exclusive (mode)
  5200.  
  5201.          Parameters:
  5202.  
  5203.            mode =       @ON or @OFF.
  5204.  
  5205.          Returns:
  5206.  
  5207.            (integer)    previous Exclusive mode.
  5208.  
  5209.  
  5210.  
  5211.                                                                              86
  5212.  
  5213.                                                          WBL FUNCTION REFERENCE
  5214.  
  5215.  
  5216.          Exclusive(@OFF) is the default mode.  In this mode,WinBatch is well-
  5217.          behaved toward other Windows applications.
  5218.  
  5219.          Exclusive(@ON) allows WinBatch files to run somewhat faster, but
  5220.          causes WinBatch to be "greedier" about sharing processing time with
  5221.          other active Windows applications.  For the most part, this mode is
  5222.          useful only when you have a series of WinBatch statements which must
  5223.          be executed in quick succession.
  5224.  
  5225.          Example:
  5226.  
  5227.            Exclusive(@ON)
  5228.            x = 0
  5229.            start = DateTime()
  5230.            :add
  5231.            x = x + 1
  5232.            If x < 1000 Then Goto add
  5233.            stop = DateTime()
  5234.            crlf = StrCat(Num2Char(13), Num2Char(10))
  5235.            Message("Times", "Start: %start%%crlf%Stop:  %stop%")
  5236.            Exclusive(@OFF)
  5237.  
  5238.  
  5239.  
  5240.                                        FileAppend
  5241.  
  5242.          Appends one or more files to another file.
  5243.  
  5244.          Syntax:
  5245.  
  5246.            FileAppend (source-list, destination)
  5247.  
  5248.          Parameters:
  5249.  
  5250.            "source-list" =  a string containing one or more filenames, which
  5251.                             may be wildcarded.
  5252.            "destination" =  target file name.
  5253.  
  5254.          Returns:
  5255.  
  5256.            (integer)        @TRUE if all files were appended successfully;
  5257.                             @FALSE if at least one file wasn't appended.
  5258.  
  5259.          Use this function to append an individual file or a group of files to
  5260.          the end of an existing file.  If "destination" does not exist, it will
  5261.          be created.
  5262.  
  5263.  
  5264.  
  5265.  
  5266.                                                                              87
  5267.  
  5268.                                                          WBL FUNCTION REFERENCE
  5269.  
  5270.  
  5271.          The file(s) specified in "source-list" will not be modified by this
  5272.          function.
  5273.  
  5274.          "Source-list" may contain * and ? wildcards.  "Destination" may not
  5275.          contain wildcards of any type; it must be a single file name.
  5276.  
  5277.          Examples:
  5278.  
  5279.            FileAppend("c:\config.sys", "c:\misc\config.sav")
  5280.  
  5281.            DirChange("c:\batch")
  5282.            FileDelete("allbats.fil")
  5283.            FileAppend("*.bat", "allbats.fil")
  5284.  
  5285.          See Also:
  5286.  
  5287.            FileCopy, FileDelete, FileExist
  5288.  
  5289.  
  5290.  
  5291.                                        FileClose
  5292.  
  5293.          Closes a file.
  5294.  
  5295.          Syntax:
  5296.  
  5297.            FileClose (filehandle)
  5298.  
  5299.          Parameters:
  5300.  
  5301.            filehandle = same integer that was returned by FileOpen.
  5302.  
  5303.          Returns:
  5304.  
  5305.            (integer)    always 0.
  5306.  
  5307.          Example:
  5308.  
  5309.            ; the hard way to copy an ASCII file
  5310.            old = FileOpen("config.sys", "READ")
  5311.            new = FileOpen("sample.txt", "WRITE")
  5312.            :top
  5313.            x = FileRead(old)
  5314.            If x != "*EOF*" Then FileWrite(new, x)
  5315.            If x != "*EOF*" Then Goto top
  5316.            FileClose(new)
  5317.            FileClose(old)
  5318.  
  5319.  
  5320.  
  5321.                                                                              88
  5322.  
  5323.                                                          WBL FUNCTION REFERENCE
  5324.  
  5325.  
  5326.          See Also:
  5327.  
  5328.            FileOpen, FileRead, FileWrite
  5329.  
  5330.  
  5331.  
  5332.                                         FileCopy
  5333.  
  5334.          Copies files.
  5335.  
  5336.          Syntax:
  5337.  
  5338.            FileCopy (source-list, destination, warning)
  5339.  
  5340.          Parameters:
  5341.  
  5342.            "source-list" =  a string containing one or more filenames, which
  5343.                             may be wildcarded.
  5344.  
  5345.            "destination" =  target file name.
  5346.  
  5347.            warning =        @TRUE if you want a warning before overwriting
  5348.                             existing files;
  5349.                             @FALSE if no warning desired.
  5350.  
  5351.          Returns:
  5352.  
  5353.            (integer)        @TRUE if all files were copied successfully;
  5354.                             @FALSE if at least one file wasn't copied.
  5355.  
  5356.          Use this function to copy an individual file, a group of files using
  5357.          wildcards, or several groups of files by separating the names with
  5358.          spaces.
  5359.  
  5360.          You can also copy files to any COM or LPT device.
  5361.  
  5362.          "Source-list" may contain * and ? wildcards.  "Destination" may
  5363.          contain the * wildcard only.
  5364.  
  5365.          Examples:
  5366.  
  5367.            FileCopy("c:\config.sys", "d:", @FALSE)
  5368.  
  5369.            FileCopy("c:\*.sys", "d:devices\*.sys", @TRUE)
  5370.  
  5371.            FileCopy("c:\config.sys", "LPT1:", @FALSE)
  5372.  
  5373.  
  5374.  
  5375.  
  5376.                                                                              89
  5377.  
  5378.                                                          WBL FUNCTION REFERENCE
  5379.  
  5380.  
  5381.          See Also:
  5382.  
  5383.            FileDelete, FileExist, FileLocate, FileMove, FileRename
  5384.  
  5385.  
  5386.  
  5387.                                        FileDelete
  5388.  
  5389.          Deletes files.
  5390.  
  5391.          Syntax:
  5392.  
  5393.            FileDelete (file-list)
  5394.  
  5395.          Parameters:
  5396.  
  5397.            "file-list" = a string containing one or more filenames, which
  5398.                          may be wildcarded.
  5399.  
  5400.          Returns:
  5401.  
  5402.            (integer)     @TRUE if all the files were deleted;
  5403.                          @FALSE if a file didn't exist or is marked with the
  5404.                          READ-ONLY attribute.
  5405.  
  5406.          Use this function to delete an individual file, a group of files using
  5407.          wildcards, or several groups of files by separating the names with
  5408.          spaces.
  5409.  
  5410.          Example:
  5411.  
  5412.            FileDelete("*.bak temp???.fil")
  5413.  
  5414.          See Also:
  5415.  
  5416.            FileExist, FileLocate, FileMove, FileRename
  5417.  
  5418.  
  5419.  
  5420.                                        FileExist
  5421.  
  5422.          Tests for the existence of files.
  5423.  
  5424.          Syntax:
  5425.  
  5426.            FileExist (filename)
  5427.  
  5428.  
  5429.  
  5430.  
  5431.                                                                              90
  5432.  
  5433.                                                          WBL FUNCTION REFERENCE
  5434.  
  5435.  
  5436.          Parameters:
  5437.  
  5438.            "filename" = either a fully qualified filename with drive and path,
  5439.                         or just a filename and extension.
  5440.  
  5441.          Returns:
  5442.  
  5443.            (integer)    @TRUE if the file exists;
  5444.                         @FALSE if it doesn't or if the pathname is invalid.
  5445.  
  5446.          This function is used to test whether or not a specified file exists.
  5447.  
  5448.          If a fully-qualified file name is used, only the specified drive and
  5449.          directory will be checked for the desired file.  If only the root and
  5450.          extension are specified, then first the current directory is checked
  5451.          for the file, and then, if the file is not found in the current
  5452.          directory, all directories in the DOS path are searched.
  5453.  
  5454.          Examples:
  5455.  
  5456.            ; check for file in current directory
  5457.            fex = FileExist(StrCat(DirGet(), "myfile.txt"))
  5458.            tex = StrSub("NOT", 1, StrLen("NOT") * fex)
  5459.            Message("MyFile.Txt"," Is %tex%in the current directory")
  5460.  
  5461.            ; check for file someplace along path
  5462.            fex = FileExist("myfile.txt")
  5463.            tex = StrSub("NOT", 1, StrLen("NOT") * fex)
  5464.            Message("MyFile.Txt", " Is %tex% in the DOS path")
  5465.  
  5466.          See Also:
  5467.  
  5468.            FileLocate
  5469.  
  5470.  
  5471.  
  5472.                                      FileExtension
  5473.  
  5474.          Returns extension of file.
  5475.  
  5476.          Syntax:
  5477.  
  5478.            FileExtension (filename)
  5479.  
  5480.          Parameters:
  5481.  
  5482.            "filename" = [optional path]complete file name, with extension.
  5483.  
  5484.  
  5485.  
  5486.                                                                              91
  5487.  
  5488.                                                          WBL FUNCTION REFERENCE
  5489.  
  5490.  
  5491.          Returns:
  5492.  
  5493.            (string)     file extension.
  5494.  
  5495.          FileExtension parses the passed filename and returns the extension
  5496.          part of the filename.
  5497.  
  5498.          Example:
  5499.  
  5500.            ; prevent the user from editing a COM or EXE file
  5501.            allfiles = FileItemize("*.*")
  5502.            editfile = ItemSelect("Select file to edit", allfiles, " ")
  5503.            ext = FileExtension(editfile)
  5504.            If (ext == "com") || (ext == "exe") Then Goto noedit
  5505.            run("notepad.exe", editfile)
  5506.            exit
  5507.            :noedit
  5508.            Message ("Sorry", "You may not edit a program file")
  5509.  
  5510.  
  5511.  
  5512.          See Also:
  5513.  
  5514.            FileRoot, FilePath
  5515.  
  5516.  
  5517.  
  5518.                                       FileItemize
  5519.  
  5520.          Returns a space-delimited list of files.
  5521.  
  5522.          Syntax:
  5523.  
  5524.            FileItemize (file-list)
  5525.  
  5526.          Parameters:
  5527.  
  5528.            "file-list" = a string containing a list of filenames, which may
  5529.                          be wildcarded.
  5530.  
  5531.          Returns:
  5532.  
  5533.            (string)      space-delimited list of files.
  5534.  
  5535.          This function compiles a list of filenames and separates the names
  5536.          with spaces.
  5537.  
  5538.  
  5539.  
  5540.  
  5541.                                                                              92
  5542.  
  5543.                                                          WBL FUNCTION REFERENCE
  5544.  
  5545.  
  5546.          This is especially useful in conjunction with the ItemSelect function,
  5547.          which lets the user choose an item from such a space-delimited list.
  5548.  
  5549.          Examples:
  5550.  
  5551.            FileItemize("*.bak")                ; all BAK files
  5552.  
  5553.            FileItemize("*.arc *.zip *.lzh")    ; compressed files
  5554.  
  5555.            ; Get which .INI file to edit
  5556.            ifiles = FileItemize("c:\windows\*.ini")
  5557.            ifile = ItemSelect(".INI Files", ifiles, " ")
  5558.            RunZoom("notepad", ifile)
  5559.            Drop(ifiles, ifile)
  5560.  
  5561.          See Also:
  5562.  
  5563.            DirItemize, WinItemize, ItemSelect
  5564.  
  5565.  
  5566.  
  5567.                                        FileLocate
  5568.  
  5569.          Finds file in current directory or along the DOS path.
  5570.  
  5571.          Syntax:
  5572.  
  5573.            FileLocate (filename)
  5574.  
  5575.          Parameters:
  5576.  
  5577.            "filename" = root name, ".", and extension.
  5578.  
  5579.          Returns:
  5580.  
  5581.            (string)     fully-qualified path name.
  5582.  
  5583.          This function is used to obtain the fully qualified path name of a
  5584.          file.  The current directory is checked first, and if the file is not
  5585.          found, the DOS path is searched.  The first occurrence of the file is
  5586.          returned.
  5587.  
  5588.  
  5589.  
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.                                                                              93
  5597.  
  5598.                                                          WBL FUNCTION REFERENCE
  5599.  
  5600.  
  5601.          Example:
  5602.  
  5603.            ; Edit WIN.INI
  5604.            winini = FileLocate("win.ini")
  5605.            If winini == "" Then Goto notfound
  5606.            Run("notepad.exe", winini)
  5607.            Exit
  5608.            :notfound
  5609.            Message("???", "WIN.INI not found")
  5610.  
  5611.          See Also:
  5612.  
  5613.            FileExist
  5614.  
  5615.  
  5616.  
  5617.                                         FileMove
  5618.  
  5619.          Moves files.
  5620.  
  5621.          Syntax:
  5622.  
  5623.            FileMove (source-list, destination, warning)
  5624.  
  5625.          Parameters:
  5626.  
  5627.            "source-list" =  one or more filenames separated by spaces.
  5628.            "destination" =  target filename.
  5629.            warning =        @TRUE if you want a warning before overwriting
  5630.                             existing files;
  5631.                             @FALSE if no warning desired.
  5632.  
  5633.          Returns:
  5634.  
  5635.            (integer)        @TRUE if the file was moved;
  5636.                             @FALSE if the source file was not found or had the
  5637.                             READ-ONLY attribute, or target filename is invalid.
  5638.  
  5639.          Use this function to move an individual file, a group of files using
  5640.          wildcards, or several groups of files by separating the names with
  5641.          spaces.
  5642.  
  5643.          You can also move files to another drive, or to any COM or LPT device.
  5644.  
  5645.          "Source-list" may contain * and ? wildcards.  "Destination" may
  5646.          contain the * wildcard only.
  5647.  
  5648.  
  5649.  
  5650.  
  5651.                                                                              94
  5652.  
  5653.                                                          WBL FUNCTION REFERENCE
  5654.  
  5655.  
  5656.          Examples:
  5657.  
  5658.            FileMove("c:\config.sys", "d:", @FALSE)
  5659.  
  5660.            FileMove("c:\*.sys", "d:*.sys", @TRUE)
  5661.  
  5662.          See Also:
  5663.  
  5664.            FileCopy, FileDelete, FileExist, FileLocate, FileRename
  5665.  
  5666.  
  5667.  
  5668.                                         FileOpen
  5669.  
  5670.          Opens a STANDARD ASCII (only) file for reading or writing.
  5671.  
  5672.          Syntax:
  5673.  
  5674.            FileOpen (filename, open-type)
  5675.  
  5676.          Parameters:
  5677.  
  5678.            "filename" =       name of the file to open.
  5679.            open-type =        READ or WRITE.
  5680.  
  5681.          Returns:
  5682.  
  5683.            (special integer)  filehandle
  5684.  
  5685.          The "filehandle" returned by the FileOpen function is subsequently
  5686.          used by the FileRead, FileWrite, and FileClose functions.
  5687.  
  5688.          Examples:
  5689.  
  5690.            ; To open for reading:
  5691.            FileOpen("stuff.txt", "READ")
  5692.  
  5693.            ; To open for writing:
  5694.            FileOpen("stuff.txt", "WRITE")
  5695.  
  5696.          See Also:
  5697.  
  5698.            FileClose, FileRead, FileWrite
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.  
  5705.  
  5706.                                                                              95
  5707.  
  5708.                                                          WBL FUNCTION REFERENCE
  5709.  
  5710.  
  5711.                                         FilePath
  5712.  
  5713.          Returns path of file.
  5714.  
  5715.          Syntax:
  5716.  
  5717.            FilePath (filename)
  5718.  
  5719.          Parameters:
  5720.  
  5721.            "filename" = fully qualified file name, including path.
  5722.  
  5723.          Returns:
  5724.  
  5725.            (string)     fully qualified path name.
  5726.  
  5727.          FilePath parses the passed filename and returns the drive and path of
  5728.          the file specification, if any.
  5729.  
  5730.          Example:
  5731.  
  5732.            coms = Environment("COMSPEC")
  5733.            compath = FilePath(coms)
  5734.            Message("", "Your command processor is located in the %compath%
  5735.               directory")
  5736.  
  5737.          See Also:
  5738.  
  5739.            FileRoot, FileExtension
  5740.  
  5741.  
  5742.  
  5743.                                         FileRead
  5744.  
  5745.          Reads data from a file.
  5746.  
  5747.          Syntax:
  5748.  
  5749.            FileRead (filehandle)
  5750.  
  5751.          Parameters:
  5752.  
  5753.            filehandle = same integer that was returned by FileOpen.
  5754.  
  5755.          Returns:
  5756.  
  5757.            (string)     line of data read from file.
  5758.  
  5759.  
  5760.  
  5761.                                                                              96
  5762.  
  5763.                                                          WBL FUNCTION REFERENCE
  5764.  
  5765.  
  5766.          When the end of the file is reached, the string *EOF* will be
  5767.          returned.
  5768.  
  5769.          Example:
  5770.  
  5771.            handle = FileOpen("autoexec.bat", "READ")
  5772.            :top
  5773.            line = FileRead(handle)
  5774.            Display(4, "AUTOEXEC DATA", line)
  5775.            If line != "*EOF*" Then Goto top
  5776.            FileClose(handle)
  5777.  
  5778.          See Also:
  5779.  
  5780.            FileOpen, FileClose, FileWrite
  5781.  
  5782.  
  5783.  
  5784.                                        FileRename
  5785.  
  5786.          Renames files.
  5787.  
  5788.          Syntax:
  5789.  
  5790.            FileRename (source-list, destination)
  5791.  
  5792.          Parameters:
  5793.  
  5794.            "source-list" =  one or more filenames, separated by spaces.
  5795.            "destination" =  target filename.
  5796.  
  5797.          Returns:
  5798.  
  5799.            (integer)        @TRUE if the file was renamed;
  5800.                             @FALSE if the source file was not found or had the
  5801.                             READ-ONLY attribute, or target filename is invalid.
  5802.  
  5803.          Use this function to rename an individual file, a group of files using
  5804.          wildcards, or several groups of files by separating the names with
  5805.          spaces.
  5806.  
  5807.          Note: Unlike FileMove, you cannot make a file change its resident disk
  5808.          drive with FileRename.
  5809.  
  5810.          "Source-list" may contain * and ? wildcards.  "Destination" may
  5811.          contain the * wildcard only.
  5812.  
  5813.  
  5814.  
  5815.  
  5816.                                                                              97
  5817.  
  5818.                                                          WBL FUNCTION REFERENCE
  5819.  
  5820.  
  5821.          Examples:
  5822.  
  5823.            FileRename("c:\config.sys", "config.old")
  5824.  
  5825.            FileRename("c:\*.txt", "*.bak")
  5826.  
  5827.          See Also:
  5828.  
  5829.            FileCopy, FileExist, FileLocate, FileMove
  5830.  
  5831.  
  5832.  
  5833.                                         FileRoot
  5834.  
  5835.          Returns root of file.
  5836.  
  5837.          Syntax:
  5838.  
  5839.            FileRoot (filename)
  5840.  
  5841.          Parameters:
  5842.  
  5843.            "filename" = [optional path]complete file name, with extension.
  5844.  
  5845.          Returns:
  5846.  
  5847.            (string)     file root.
  5848.  
  5849.          FileRoot parses the passed filename and returns the root part of the
  5850.          filename.
  5851.  
  5852.          Example:
  5853.  
  5854.            allfiles = FileItemize("*.*")
  5855.            editfile = ItemSelect("Select file to edit", allfiles, " ")
  5856.            root = FileRoot(editfile)
  5857.            ext = FileExtension(editfile)
  5858.            lowerext = StrLower(ext)
  5859.            nicefile = StrCat(root, ".", lowerext)
  5860.            Message("", "You are about to edit %nicefile%.")
  5861.            Run("notepad.exe", editfile)
  5862.  
  5863.          See Also:
  5864.  
  5865.            FileExtension, FilePath
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.                                                                              98
  5872.  
  5873.                                                          WBL FUNCTION REFERENCE
  5874.  
  5875.  
  5876.                                         FileSize
  5877.  
  5878.          Finds the total size of a group of files.
  5879.  
  5880.          Syntax:
  5881.  
  5882.            FileSize (file-list)
  5883.  
  5884.          Parameters:
  5885.  
  5886.            "file-list" =   zero or more filenames, separated by spaces.
  5887.  
  5888.          Returns:
  5889.  
  5890.            (integer)       total bytes taken up by the specified files.
  5891.  
  5892.          This function returns the total size of the specified files.  Note
  5893.          that it doesn't handle wildcarded filenames.  You can, however, use
  5894.          FileItemize on a wildcarded filename and use the resulting string as a
  5895.          FileSize parameter.
  5896.  
  5897.          Example:
  5898.  
  5899.            size = FileSize(FileItemize("*.*"))
  5900.            Message("Size of All Files in Directory", size)
  5901.  
  5902.          See Also:
  5903.  
  5904.            DiskFree
  5905.  
  5906.  
  5907.  
  5908.                                        FileWrite
  5909.  
  5910.          Writes data to a file.
  5911.  
  5912.          Syntax:
  5913.  
  5914.            FileWrite(filehandle, output-data)
  5915.  
  5916.          Parameters:
  5917.  
  5918.            filehandle =     same integer that was returned by FileOpen.
  5919.  
  5920.            "output-data" =  data to write to file.
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.                                                                              99
  5927.  
  5928.                                                          WBL FUNCTION REFERENCE
  5929.  
  5930.  
  5931.          Returns:
  5932.  
  5933.            (integer)        always 0.
  5934.  
  5935.          Example:
  5936.  
  5937.            handle = FileOpen("stuff.txt", "WRITE")
  5938.            FileWrite(handle, "Gobbledygook")
  5939.            FileClose(handle)
  5940.  
  5941.          See Also:
  5942.  
  5943.            FileOpen, FileClose, FileRead
  5944.  
  5945.  
  5946.  
  5947.                                           Goto
  5948.  
  5949.          Changes the flow of control in a batch file.
  5950.  
  5951.          Syntax:
  5952.  
  5953.            Goto label
  5954.  
  5955.          Parameters:
  5956.  
  5957.            "label" =    user-defined identifier.
  5958.  
  5959.          Goto label causes an unconditional branch to the batch file line
  5960.          marked :label, where the identifier is preceded by a colon (:).
  5961.  
  5962.          Example:
  5963.  
  5964.            If WinExist("Solitaire") == @FALSE Then Goto open
  5965.            WinActivate("Solitaire")
  5966.            Goto loaded
  5967.            :open
  5968.            Run("sol.exe", "")
  5969.            :loaded
  5970.  
  5971.          See Also:
  5972.  
  5973.            If ... Then
  5974.  
  5975.  
  5976.  
  5977.  
  5978.  
  5979.  
  5980.  
  5981.                                                                             100
  5982.  
  5983.                                                          WBL FUNCTION REFERENCE
  5984.  
  5985.  
  5986.                                        If...Then
  5987.  
  5988.          Conditionally performs a function.
  5989.  
  5990.          Syntax:
  5991.  
  5992.            If condition Then statement
  5993.  
  5994.          Parameters:
  5995.  
  5996.            "condition" =   an expression to be evaluated.
  5997.            "statement" =   any valid WinBatch function or command.
  5998.  
  5999.          If the condition following the If keyword is true, the statement
  6000.          following the Then keyword is executed.  If the condition following
  6001.          the If keyword is false, the statement following the Then keyword is
  6002.          ignored.
  6003.  
  6004.          Example:
  6005.  
  6006.            sure = AskYesNo("End Session", "Really quit Windows?")
  6007.            If sure == @YES Then EndSession()
  6008.  
  6009.          See Also:
  6010.  
  6011.            Goto
  6012.  
  6013.  
  6014.  
  6015.                                       IgnoreInput
  6016.  
  6017.          Turns off hardware input to windows.
  6018.  
  6019.          Syntax:
  6020.  
  6021.            IgnoreInput(mode)
  6022.  
  6023.          Parameters:
  6024.  
  6025.            mode =       @TRUE or @FALSE.
  6026.  
  6027.          Returns:
  6028.  
  6029.            (integer)    previous IgnoreInput mode.
  6030.  
  6031.          IgnoreInput causes mouse movements, clicks and keyboard entry to be
  6032.          completely ignored.  Good for self-running demos.
  6033.  
  6034.  
  6035.  
  6036.                                                                             101
  6037.  
  6038.                                                          WBL FUNCTION REFERENCE
  6039.  
  6040.  
  6041.          Warning: If you are not careful with the use of IgnoreInput, you can
  6042.          lock up your computer!
  6043.  
  6044.          Example:
  6045.  
  6046.            username = AskLine("Hello", "Please enter your name","")
  6047.            IgnoreInput(@TRUE)
  6048.            Call("demo.wbt", username)
  6049.            IgnoreInput(@FALSE)
  6050.  
  6051.  
  6052.  
  6053.                                         IniRead
  6054.  
  6055.          Reads data from the WIN.INI file.
  6056.  
  6057.          Syntax:
  6058.  
  6059.            IniRead (section, keyname, default)
  6060.  
  6061.          Parameters:
  6062.  
  6063.            "section" =  the major heading to read the data from.
  6064.            "keyname =   the name of the item to read.
  6065.            "default" =  string to return if the desired item is not found.
  6066.  
  6067.          Returns:
  6068.  
  6069.            (string)     data from WIN.INI file.
  6070.  
  6071.          This function allows a program to read data from the WIN.INI file.
  6072.  
  6073.          The WIN.INI file has the form:
  6074.  
  6075.            [section]
  6076.            keyname=settings
  6077.  
  6078.  
  6079.          Most of the entries in WIN.INI are set from the Windows Control Panel
  6080.          program, but individual applications can also use it to store option
  6081.          settings in their own sections.
  6082.  
  6083.          Example:
  6084.  
  6085.            ; Find the default output device
  6086.            a = IniRead("windows", "device", "No Default")
  6087.            Message("Default Output Device", a)
  6088.  
  6089.  
  6090.  
  6091.                                                                             102
  6092.  
  6093.                                                          WBL FUNCTION REFERENCE
  6094.  
  6095.  
  6096.          See Also:
  6097.  
  6098.            IniWrite, IniReadPvt, IniWritePvt, Environment
  6099.  
  6100.  
  6101.  
  6102.                                        IniReadPvt
  6103.  
  6104.          Reads data from a private INI file.
  6105.  
  6106.          Syntax:
  6107.  
  6108.            IniReadPvt (section, keyname, default, filename)
  6109.  
  6110.          Parameters:
  6111.  
  6112.            "section" =  the major heading to read the data from.
  6113.            "keyname =   the name of the item to read.
  6114.            "default" =  string to return if the desired item is not found.
  6115.            "filename" = name of the INI file.
  6116.  
  6117.          Returns:
  6118.  
  6119.            (string)     data from the INI file.
  6120.  
  6121.          Looks up a value in the "filename".INI file.  If the value is not
  6122.          found, the "default" will be returned.
  6123.  
  6124.          Example:
  6125.  
  6126.            IniReadPvt("Main", "Lang", "English", "WB.INI")
  6127.  
  6128.          Given the following segment from WB.INI:
  6129.  
  6130.            [Main]
  6131.            Lang=French
  6132.  
  6133.          The batch file line above would return:
  6134.  
  6135.            French
  6136.  
  6137.          See Also:
  6138.  
  6139.            IniWritePvt, IniRead, IniWrite
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.                                                                             103
  6147.  
  6148.                                                          WBL FUNCTION REFERENCE
  6149.  
  6150.  
  6151.                                         IniWrite
  6152.  
  6153.          Writes data to the WIN.INI file.
  6154.  
  6155.          Syntax:
  6156.  
  6157.            IniWrite (section, keyname, data)
  6158.  
  6159.          Parameters:
  6160.  
  6161.            "section" =  major heading to write the data to.
  6162.            "keyname =   name of the data item to write.
  6163.            "data" =     string to write to the WIN.INI file.
  6164.  
  6165.          Returns:
  6166.  
  6167.            (integer)    always @TRUE.
  6168.  
  6169.          This command allows a program to write data to the WIN.INI file.  The
  6170.          "section" is added to the file if it doesn't already exist.
  6171.  
  6172.          Example:
  6173.  
  6174.            ; Change the list of pgms to load upon Windows
  6175.            ; startup
  6176.            loadprogs = IniRead("windows", "load", "")
  6177.            newprogs = AskLine("Add Pgm To LOAD= Line", "Add:",  loadprogs)
  6178.            IniWrite("windows", "load", newprogs)
  6179.  
  6180.          See Also:
  6181.  
  6182.            IniRead, IniReadPvt, IniWritePvt
  6183.  
  6184.  
  6185.  
  6186.                                       IniWritePvt
  6187.  
  6188.          Writes data to a private INI file.
  6189.  
  6190.          Syntax:
  6191.  
  6192.            IniWritePvt (section, keyname, data, filename)
  6193.  
  6194.          Parameters:
  6195.  
  6196.            "section" =  major heading to write the data to.
  6197.            "keyname =   name of the data item to write.
  6198.            "data" =     string to write to the INI file.
  6199.  
  6200.  
  6201.                                                                             104
  6202.  
  6203.                                                          WBL FUNCTION REFERENCE
  6204.  
  6205.  
  6206.            "filename" = name of the INI file.
  6207.  
  6208.          Writes a value in the "filename".INI file.
  6209.  
  6210.          Example:
  6211.  
  6212.            IniWritePvt("Main", "Lang", "French, "WB.INI")
  6213.  
  6214.          This would create the following entry in WB.INI:
  6215.  
  6216.            [Main]
  6217.            Lang=French
  6218.  
  6219.          See Also:
  6220.  
  6221.            IniReadPvt, IniRead, IniWrite
  6222.  
  6223.  
  6224.  
  6225.                                        IsDefined
  6226.  
  6227.          Determines if a variable name is currently defined.
  6228.  
  6229.          Syntax:
  6230.  
  6231.            IsDefined (var)
  6232.  
  6233.          Parameters:
  6234.  
  6235.            "var" =      a variable name.
  6236.  
  6237.          Returns:
  6238.  
  6239.            (integer)    @YES if the variable is currently defined;
  6240.                         @NO if it was never defined or has been dropped.
  6241.  
  6242.          A variable is defined the first time it appears at the left of an
  6243.          equal sign in a statement.  It stays defined until it is explicitly
  6244.          dropped with the Drop function, or until the batch file ends.
  6245.  
  6246.          Example:
  6247.  
  6248.            def = IsDefined(thisvar)
  6249.            If def == @FALSE Then Message("ERROR!", "Variable not defined")
  6250.  
  6251.          See Also:
  6252.  
  6253.            Drop
  6254.  
  6255.  
  6256.                                                                             105
  6257.  
  6258.                                                          WBL FUNCTION REFERENCE
  6259.  
  6260.  
  6261.                                        IsKeyDown
  6262.  
  6263.          Tells about keys/mouse.
  6264.  
  6265.          Syntax:
  6266.  
  6267.            IsKeyDown(keycodes)
  6268.  
  6269.          Parameters:
  6270.  
  6271.            keycodes =   @SHIFT and/or @CTRL
  6272.  
  6273.          Returns:
  6274.  
  6275.            (integer)    @YES if the key is down.
  6276.                         @NO if the key is not down.
  6277.  
  6278.          Determines if the Shift key or the Ctrl key is currently down.
  6279.  
  6280.          Note: The right mouse button is the same as Shift, and the middle
  6281.          mouse button is the same as Ctrl.
  6282.  
  6283.          Examples:
  6284.  
  6285.            IsKeyDown(@SHIFT)
  6286.  
  6287.            IsKeyDown(@CTRL)
  6288.  
  6289.            IsKeyDown(@CTRL | @SHIFT)
  6290.  
  6291.            IsKeyDown(@CTRL & @SHIFT)
  6292.  
  6293.  
  6294.  
  6295.                                        IsLicensed
  6296.  
  6297.          Tells if WinBatch is licensed.
  6298.  
  6299.          Syntax:
  6300.  
  6301.            IsLicensed()
  6302.  
  6303.          Parameters:
  6304.  
  6305.            (none)
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.                                                                             106
  6312.  
  6313.                                                          WBL FUNCTION REFERENCE
  6314.  
  6315.  
  6316.          Returns:
  6317.  
  6318.            (integer)    @YES if current version of WinBatch is licensed.
  6319.                         @NO if current version of WinBatch is not licensed.
  6320.  
  6321.          Returns information on whether or not the current version of WinBatch
  6322.          is a licensed copy.
  6323.  
  6324.          Example:
  6325.  
  6326.            IsLicensed()
  6327.  
  6328.  
  6329.  
  6330.                                         IsNumber
  6331.  
  6332.          Determines whether a variable contains a valid number.
  6333.  
  6334.          Syntax:
  6335.  
  6336.            IsNumber (string)
  6337.  
  6338.          Parameters:
  6339.  
  6340.            "string" =   string to test to see if it represents a valid number.
  6341.  
  6342.          Returns:
  6343.  
  6344.            (integer)    @YES if it contains a valid number;
  6345.                         @NO if it doesn't.
  6346.  
  6347.          This function determines if a string variable contains a valid
  6348.          integer.  Useful for checking user input prior to using it in
  6349.          computations.
  6350.  
  6351.          Example:
  6352.  
  6353.            a = AskLine("ISNUMBER", "Enter a number", "0")
  6354.            If IsNumber(a) == @NO Then Message("", "You didn't enter a
  6355.               number")
  6356.  
  6357.          See Also:
  6358.  
  6359.            Abs, Char2Num
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.                                                                             107
  6367.  
  6368.                                                          WBL FUNCTION REFERENCE
  6369.  
  6370.  
  6371.                                        ItemCount
  6372.  
  6373.          Returns the number of items in a list.
  6374.  
  6375.          Syntax:
  6376.  
  6377.            ItemCount (list, delimiter)
  6378.  
  6379.          Parameters:
  6380.  
  6381.            "list" =       a string containing a list of items to choose from.
  6382.            "delimiter" =  a string containing the character to act as
  6383.                           delimiter between items in the list.
  6384.  
  6385.          Returns:
  6386.  
  6387.            (integer)      the number of items in the list.
  6388.  
  6389.          If you create the list with the FileItemize or DirItemize functions
  6390.          you will be using a space-delimited list.  WinItemize, however,
  6391.          creates a tab-delimited list of window titles since titles can have
  6392.          embedded blanks.
  6393.  
  6394.          Example:
  6395.  
  6396.            a = FileItemize("*.*")
  6397.            n = ItemCount(a, " ")
  6398.            Message("Note", "There are %n% files")
  6399.  
  6400.          See Also:
  6401.  
  6402.            DirItemize, FileItemize, WinItemize, ItemExtract, ItemSelect
  6403.  
  6404.  
  6405.  
  6406.                                       ItemExtract
  6407.  
  6408.          Returns the selected item from a list.
  6409.  
  6410.          Syntax:
  6411.  
  6412.            ItemExtract (select, list, delimiter)
  6413.  
  6414.          Parameters:
  6415.  
  6416.            select =       the position in "list" of the item to be selected.
  6417.            "list" =       a string containing a list of items to choose from.
  6418.  
  6419.  
  6420.  
  6421.                                                                             108
  6422.  
  6423.                                                          WBL FUNCTION REFERENCE
  6424.  
  6425.  
  6426.            "delimiter" =  a string containing the character to act as
  6427.                           delimiter between items in the list.
  6428.  
  6429.          Returns:
  6430.  
  6431.            (string)       the selected item.
  6432.  
  6433.          If you create the list with the FileItemize or DirItemize functions
  6434.          you will be using a space-delimited list.  WinItemize, however,
  6435.          creates a tab-delimited list of window titles since titles can have
  6436.          embedded blanks.
  6437.  
  6438.          Example:
  6439.  
  6440.            bmpfiles = FileItemize("*.bmp")
  6441.            bmpcount = ItemCount(bmpfiles, " ")
  6442.            pos = (Random(bmpcount - 1)) + 1
  6443.            paper = ItemExtract(pos, bmpfiles, " ")
  6444.            Wallpaper(paper, @FALSE)
  6445.  
  6446.          See Also:
  6447.  
  6448.            DirItemize, FileItemize, WinItemize, ItemExtract, ItemSelect
  6449.  
  6450.  
  6451.  
  6452.                                        ItemSelect
  6453.  
  6454.          Allows the user to choose an item from a listbox.
  6455.  
  6456.          Syntax:
  6457.  
  6458.            ItemSelect (title, list, delimiter)
  6459.  
  6460.          Parameters:
  6461.  
  6462.            "title" =      the title of dialog box to display.
  6463.            "list" =       a string containing a list of items to choose from.
  6464.            "delimiter" =  a string containing the character to act as
  6465.                           delimiter between items in the list.
  6466.  
  6467.          Returns:
  6468.  
  6469.            (string)       the selected item.
  6470.  
  6471.          This function displays a dialog box with a listbox inside.  This
  6472.          listbox is filled with a sorted list of items taken from a string you
  6473.          provide to the function.
  6474.  
  6475.  
  6476.                                                                             109
  6477.  
  6478.                                                          WBL FUNCTION REFERENCE
  6479.  
  6480.  
  6481.          Each item in the string must be separated ("delimited") by a
  6482.          character, which you also pass to the function.
  6483.  
  6484.          The user selects one of the items by either doubleclicking on it, or
  6485.          single-clicking and pressing OK.  The item is returned as a string.
  6486.  
  6487.          If you create the list with the FileItemize or DirItemize functions
  6488.          you will be using a space-delimited list.  WinItemize, however,
  6489.          creates a tab-delimited list of window titles since titles can have
  6490.          embedded blanks.
  6491.  
  6492.          Example:
  6493.  
  6494.            DirChange("c:\winword")
  6495.            alldotfiles = FileItemize("*.dot")
  6496.            dotfile = ItemSelect("W4W Templates", alldotfiles, " ")
  6497.            Run("winword.exe", dotfile)
  6498.  
  6499.          See Also:
  6500.  
  6501.            AskYesNo, Display,  DirItemize, FileItemize, WinItemize, Message,
  6502.            Pause, TextBox, ItemCount, ItemExtract
  6503.  
  6504.  
  6505.  
  6506.                                        LastError
  6507.  
  6508.          Returns the most-recent error encountered during the current batch
  6509.          file.
  6510.  
  6511.          Syntax:
  6512.  
  6513.            LastError ( )
  6514.  
  6515.          Parameters:
  6516.  
  6517.            (none)
  6518.  
  6519.          Returns:
  6520.  
  6521.            (integer)    most-recent WBL error code encountered.
  6522.  
  6523.          WBL errors are numbered according to their severity.  "Minor" errors
  6524.          go from 1000 through 1999.  Moderate errors are 2000 through 2999.
  6525.          Fatal errors are numbered 3000 to 3999.
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.                                                                             110
  6532.  
  6533.                                                          WBL FUNCTION REFERENCE
  6534.  
  6535.  
  6536.          Depending on which error mode is active when an error occurs, you may
  6537.          not get a chance to check the error code.  See ErrorMode for a
  6538.          discussion of default error handling.
  6539.  
  6540.          Don't bother checking for "fatal" error codes.  When a fatal error
  6541.          occurs, the batch file is canceled before the next WBL statement gets
  6542.          to execute (regardless of which error mode is active).
  6543.  
  6544.          Every time the LastError function is called, the "last error"
  6545.          indicator is reset to zero.
  6546.  
  6547.          A full listing of possible errors you can encounter in processing a
  6548.          batch file is in Appendix B (pg. 152).
  6549.  
  6550.          Example:
  6551.  
  6552.            ErrorMode(@OFF)
  6553.            FileCopy("data.dat", "c:\backups", @FALSE)
  6554.            ErrorMode(@CANCEL)
  6555.            If LastError() == 1006 Then Message("Error", "Please call      Tech
  6556.            Support at 555-9999.")
  6557.  
  6558.          See Also:
  6559.  
  6560.            Debug, ErrorMode
  6561.  
  6562.  
  6563.  
  6564.                                         LogDisk
  6565.  
  6566.          Logs (activates) a disk drive.
  6567.  
  6568.          Syntax:
  6569.  
  6570.            LogDisk (drive-letter)
  6571.  
  6572.          Parameters:
  6573.  
  6574.            "drive-letter" =  the disk drive to log into.
  6575.  
  6576.          Returns:
  6577.  
  6578.            (integer)         @TRUE if the current drive was changed;
  6579.                              @FALSE if the drive doesn't exist.
  6580.  
  6581.          Use this function to change the logged disk drive.
  6582.  
  6583.  
  6584.  
  6585.  
  6586.                                                                             111
  6587.  
  6588.                                                          WBL FUNCTION REFERENCE
  6589.  
  6590.  
  6591.          This command produces the same effect as if you typed the drive name
  6592.          from the DOS command prompt.
  6593.  
  6594.          Example:
  6595.  
  6596.            LogDisk("c:")
  6597.  
  6598.          See Also:
  6599.  
  6600.            DirChange
  6601.  
  6602.  
  6603.  
  6604.                                           Max
  6605.  
  6606.          Returns largest number in a list of numbers.
  6607.  
  6608.          Syntax:
  6609.  
  6610.            Max (integer [, integer]...)
  6611.  
  6612.          Parameters:
  6613.  
  6614.            integer =    an integer number.
  6615.  
  6616.          Returns:
  6617.  
  6618.            (integer)    largest parameter.
  6619.  
  6620.          Use this function to determine the largest of a set of comma-delimited
  6621.          integers.
  6622.  
  6623.          Example:
  6624.  
  6625.            a = Max(5, -37, 125, 34, 2345, -32767)
  6626.            Message("Largest number is", a)
  6627.  
  6628.          See Also:
  6629.  
  6630.            Abs, Average, Min
  6631.  
  6632.  
  6633.  
  6634.                                         Message
  6635.  
  6636.          Displays a message to the user.
  6637.  
  6638.  
  6639.  
  6640.  
  6641.                                                                             112
  6642.  
  6643.                                                          WBL FUNCTION REFERENCE
  6644.  
  6645.  
  6646.          Syntax:
  6647.  
  6648.            Message (title, text)
  6649.  
  6650.          Parameters:
  6651.  
  6652.            "title" =    title of the message box.
  6653.            "text" =     text to display in the message box.
  6654.  
  6655.          Returns:
  6656.  
  6657.            (integer)    always @TRUE.
  6658.  
  6659.          Use this function to display a message to the user.  The user must
  6660.          respond by selecting the OK button before processing will continue.
  6661.  
  6662.          Example:
  6663.  
  6664.            Message("Current directory is", DirGet())
  6665.  
  6666.  
  6667.  
  6668.          See Also:
  6669.  
  6670.            Display, Pause
  6671.  
  6672.  
  6673.  
  6674.                                           Min
  6675.  
  6676.          Returns lowest number in a list of numbers.
  6677.  
  6678.          Syntax:
  6679.  
  6680.            Min (integer [, integer]...)
  6681.  
  6682.          Parameters:
  6683.  
  6684.            integer =    an integer number.
  6685.  
  6686.          Returns:
  6687.  
  6688.            (integer)    lowest parameter.
  6689.  
  6690.          Use this function to determine the lowest of a set of comma-delimited
  6691.          integers.
  6692.  
  6693.  
  6694.  
  6695.  
  6696.                                                                             113
  6697.  
  6698.                                                          WBL FUNCTION REFERENCE
  6699.  
  6700.  
  6701.          Example:
  6702.  
  6703.            a = Min( 5, -37, 125, 34, 2345, -32767)
  6704.            Message("Smallest number is", a)
  6705.  
  6706.          See Also:
  6707.  
  6708.            Abs, Average, Max
  6709.  
  6710.  
  6711.  
  6712.                                         Num2Char
  6713.  
  6714.          Converts a number to its character equivalent.
  6715.  
  6716.          Syntax:
  6717.  
  6718.            Num2Char (integer)
  6719.  
  6720.          Parameters:
  6721.  
  6722.            number =     any number from 0 to 255.
  6723.  
  6724.          Returns:
  6725.  
  6726.            (string)     one-byte string containing the character the number
  6727.                         represents.
  6728.  
  6729.          Use this function to convert a number to its ASCII equivalent.
  6730.  
  6731.          Example:
  6732.  
  6733.            ; Build a variable containing a CRLF combo
  6734.            crlf = StrCat(Num2Char(13), Num2Char(10))
  6735.            Message("NUM2CHAR", StrCat("line1", crlf, "line2"))
  6736.  
  6737.          See Also:
  6738.  
  6739.            Char2Num
  6740.  
  6741.  
  6742.  
  6743.                                        ParseData
  6744.  
  6745.          Parses the passed string, just like passed parameters are parsed.
  6746.  
  6747.  
  6748.  
  6749.  
  6750.  
  6751.                                                                             114
  6752.  
  6753.                                                          WBL FUNCTION REFERENCE
  6754.  
  6755.  
  6756.          Syntax:
  6757.  
  6758.            ParseData (string)
  6759.  
  6760.          Parameters:
  6761.  
  6762.            "string" =   string to be parsed.
  6763.  
  6764.          Returns:
  6765.  
  6766.            (integer)    number of parameters in "string".
  6767.  
  6768.          This function breaks a string constant or string variable into new
  6769.          sub-string variables named param1, param2, etc.  Blank spaces in the
  6770.          original string are used as delimiters to create the new variables.
  6771.  
  6772.          Param0 is the count of how many sub-strings are found in "string".
  6773.  
  6774.          Example:
  6775.  
  6776.            username = AskLine("Hello", "Please enter your name","")
  6777.            ParseData(username)
  6778.  
  6779.          If the user enters:
  6780.  
  6781.            Joe Q. User
  6782.  
  6783.          ParseData would create the following variables:
  6784.  
  6785.            param1 == Joe
  6786.            param2 == Q.
  6787.            param3 == User
  6788.            param0 == 3
  6789.  
  6790.  
  6791.  
  6792.                                          Pause
  6793.  
  6794.          Provides a message to user.  User may cancel processing.
  6795.  
  6796.          Syntax:
  6797.  
  6798.            Pause (title, text)
  6799.  
  6800.          Parameters:
  6801.  
  6802.            "title" =    title of pause box.
  6803.            "text" =     text of the message to be displayed.
  6804.  
  6805.  
  6806.                                                                             115
  6807.  
  6808.                                                          WBL FUNCTION REFERENCE
  6809.  
  6810.  
  6811.          Returns:
  6812.  
  6813.            (integer)    always @TRUE.
  6814.  
  6815.          This function displays a message to the user with an exclamation point
  6816.          icon.  The user may respond by selecting the OK button, or may cancel
  6817.          the processing by selecting Cancel.
  6818.  
  6819.          The Pause function is similar to the Message function, except for the
  6820.          addition of the Cancel button and icon.
  6821.  
  6822.          Example:
  6823.  
  6824.            Pause("Change Disks", "Insert new disk into Drive A:")
  6825.  
  6826.          See Also:
  6827.  
  6828.            Display, Message
  6829.  
  6830.  
  6831.  
  6832.                                          Random
  6833.  
  6834.          Computes a pseudo-random number.
  6835.  
  6836.          Syntax:
  6837.  
  6838.            Random (max)
  6839.  
  6840.          Parameters:
  6841.  
  6842.            max =        largest desired integer number.
  6843.  
  6844.          Returns:
  6845.  
  6846.            (integer)    unpredictable positive number.
  6847.  
  6848.          This function will return a random integer between 0 and "max".
  6849.  
  6850.          Example:
  6851.  
  6852.            a = Random(79)
  6853.            Message("Random number between 0 and 79", a)
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.                                                                             116
  6862.  
  6863.                                                          WBL FUNCTION REFERENCE
  6864.  
  6865.  
  6866.                                          Return
  6867.  
  6868.          Used to return from a Call or a CallExt to the calling program.
  6869.  
  6870.          Syntax:
  6871.  
  6872.            Return
  6873.  
  6874.          If the program was not called, then an Exit is assumed.
  6875.  
  6876.          Example:
  6877.  
  6878.            Display(2, "End of subroutine", "Returning to MAIN.WBT")
  6879.            Return
  6880.  
  6881.          See Also:
  6882.  
  6883.            Call, CallExt, Exit
  6884.  
  6885.  
  6886.  
  6887.                                           Run
  6888.  
  6889.          Runs a program as a normal window.
  6890.  
  6891.          Syntax:
  6892.  
  6893.            Run (program-name, parameters)
  6894.  
  6895.          Parameters:
  6896.  
  6897.            "program-name" = the name of the desired .EXE, .COM, .PIF, .BAT
  6898.                             file, or a data file.
  6899.            "parameters" =   optional parameters as required by the
  6900.                             application.
  6901.  
  6902.          Returns:
  6903.  
  6904.            (integer)        @TRUE if the program was found;
  6905.                             @FALSE if it wasn't.
  6906.  
  6907.          Use this command to run an application.
  6908.  
  6909.          If the drive and path are not part of the program name, the current
  6910.          directory will be examined first, and then the DOS path will be
  6911.          searched to find the desired executable file.
  6912.  
  6913.  
  6914.  
  6915.  
  6916.                                                                             117
  6917.  
  6918.                                                          WBL FUNCTION REFERENCE
  6919.  
  6920.  
  6921.          If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  6922.          or .BAT, it will be run in accordance with whatever is in the
  6923.          [extensions] section of the WIN.INI file.  When this happens, any
  6924.          "parameters" you specified are ignored.
  6925.  
  6926.          Examples:
  6927.  
  6928.            Run("notepad.exe", "abc.txt")
  6929.  
  6930.            Run("clock.exe", "")
  6931.  
  6932.            Run("paint.exe", "pict.msp")
  6933.  
  6934.          See Also:
  6935.  
  6936.            RunHide, RunIcon, RunZoom, WinClose, WinWaitClose
  6937.  
  6938.  
  6939.  
  6940.                                         RunHide
  6941.  
  6942.          Runs a program as a hidden window.
  6943.  
  6944.          Syntax:
  6945.  
  6946.            RunHide (program-name, parameters)
  6947.  
  6948.          Parameters:
  6949.  
  6950.            "program-name" = the name of the desired .EXE, .COM, .PIF, .BAT
  6951.                             file, or a data file.
  6952.            "parameters" =   optional parameters as required by the
  6953.                             application.
  6954.  
  6955.          Returns:
  6956.  
  6957.            (integer)        @TRUE if the program was found;
  6958.                             @FALSE if it wasn't.
  6959.  
  6960.          Use this command to run an application as a hidden window.
  6961.  
  6962.          If the drive and path are not part of the program name, the current
  6963.          directory will be examined first, and then the DOS path will be
  6964.          searched to find the desired executable file.
  6965.  
  6966.          If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  6967.          or .BAT, it will be run in accordance with whatever is in the
  6968.  
  6969.  
  6970.  
  6971.                                                                             118
  6972.  
  6973.                                                          WBL FUNCTION REFERENCE
  6974.  
  6975.  
  6976.          [extensions] section of the WIN.INI file.  When this happens, any
  6977.          "parameters" you specified are ignored.
  6978.  
  6979.          Note:  When this command launches an application, it informs it that
  6980.          you want it to run as a hidden window.  Whether or not the application
  6981.          honors your wish is beyond RunHide's control.
  6982.  
  6983.          Examples:
  6984.  
  6985.            RunHide("notepad.exe", "abc.txt")
  6986.  
  6987.            RunHide("clock.exe", "")
  6988.  
  6989.            RunHide("paint.exe", "pict.msp")
  6990.  
  6991.          See Also:
  6992.  
  6993.            Run, RunIcon, RunZoom, WinHide, WinClose, WinWaitClose
  6994.  
  6995.  
  6996.  
  6997.                                         RunIcon
  6998.  
  6999.          Runs a program as an iconic (minimized) window.
  7000.  
  7001.          Syntax:
  7002.  
  7003.            RunIcon (program-name, parameters)
  7004.  
  7005.          Parameters:
  7006.  
  7007.            "program-name" = the name of the desired .EXE, .COM, .PIF, .BAT
  7008.                             file, or a data file.
  7009.            "parameters" =   optional parameters as required by the
  7010.                             application.
  7011.  
  7012.          Returns:
  7013.  
  7014.            (integer)        @TRUE if the program was found;
  7015.                             @FALSE if it wasn't.
  7016.  
  7017.          Use this command to run an application as an icon.
  7018.  
  7019.          If the drive and path are not part of the program name, the current
  7020.          directory will be examined first, and then the DOS path will be
  7021.          searched to find the desired executable file.
  7022.  
  7023.  
  7024.  
  7025.  
  7026.                                                                             119
  7027.  
  7028.                                                          WBL FUNCTION REFERENCE
  7029.  
  7030.  
  7031.          If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  7032.          or .BAT, it will be run in accordance with whatever is in the
  7033.          [extensions] section of the WIN.INI file.  When this happens, any
  7034.          "parameters" you specified are ignored.
  7035.  
  7036.          Note:  When this command launches an application, it merely informs it
  7037.          that you want it to begin as an icon.  Whether or not the application
  7038.          honors your wish is beyond RunIcon's control.
  7039.  
  7040.          Examples:
  7041.  
  7042.            RunIcon("notepad.exe", "abc.txt")
  7043.  
  7044.            RunIcon("clock.exe", "")
  7045.  
  7046.            RunIcon("paint.exe", "pict.msp")
  7047.  
  7048.          See Also:
  7049.  
  7050.            Run, RunHide, RunZoom, WinIconize, WinClose, WinWaitClose
  7051.  
  7052.  
  7053.  
  7054.                                         RunZoom
  7055.  
  7056.          Runs a program as a full-screen (maximized) window.
  7057.  
  7058.          Syntax:
  7059.  
  7060.            RunZoom (program-name, parameters)
  7061.  
  7062.          Parameters:
  7063.  
  7064.            "program-name" = the name of the desired .EXE, .COM, .PIF, .BAT
  7065.                             file, or a data file.
  7066.            "parameters" =   optional parameters as required by the
  7067.                             application.
  7068.  
  7069.          Returns:
  7070.  
  7071.            (integer)        @TRUE if the program was found;
  7072.                             @FALSE if it wasn't.
  7073.  
  7074.          Use this command to run an application as a full-screen window.
  7075.  
  7076.          If the drive and path are not part of the program name, the current
  7077.          directory will be examined first, and then the DOS path will be
  7078.          searched to find the desired executable file.
  7079.  
  7080.  
  7081.                                                                             120
  7082.  
  7083.                                                          WBL FUNCTION REFERENCE
  7084.  
  7085.  
  7086.          If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  7087.          or .BAT, it will be run in accordance with whatever is in the
  7088.          [extensions] section of the WIN.INI file.  When this happens, any
  7089.          "parameters" you specified are ignored.
  7090.  
  7091.          Note:  When this command launches an application, it merely informs it
  7092.          that you want it to be maximized to full-screen.  Whether or not the
  7093.          application honors your wish is beyond RunZoom's control.
  7094.  
  7095.          Examples:
  7096.  
  7097.            RunZoom("notepad.exe", "abc.txt")
  7098.  
  7099.            RunZoom("clock.exe", "")
  7100.  
  7101.            RunZoom("paint.exe", "pict.msp")
  7102.  
  7103.          See Also:
  7104.  
  7105.            Run, RunHide, RunIcon, WinZoom, WinClose, WinWaitClose
  7106.  
  7107.  
  7108.  
  7109.                                         SendKey
  7110.  
  7111.          Sends keystrokes to the active application.
  7112.  
  7113.          Syntax:
  7114.  
  7115.            SendKey (char-string)
  7116.  
  7117.          Parameters:
  7118.  
  7119.            "char-string" =  string of regular and/or special characters.
  7120.  
  7121.          Returns:
  7122.  
  7123.            (integer)        always 0.
  7124.  
  7125.          This function is used to send keystrokes to the current window, just
  7126.          as if they had been entered from the keyboard.  Any alphanumeric
  7127.          character, and most punctuation marks and other symbols which appear
  7128.          on the keyboard, may be sent simply by placing it in the "char-
  7129.          string."  In addition, the following special characters, enclosed in
  7130.          "curly" braces, may be placed in "char-string" to send the
  7131.          corresponding special characters:
  7132.  
  7133.  
  7134.  
  7135.  
  7136.                                                                             121
  7137.  
  7138.                                                          WBL FUNCTION REFERENCE
  7139.  
  7140.  
  7141.            Key            SendKey equivalent
  7142.  
  7143.            ~              {~}
  7144.            !              {!}
  7145.            ^              {^}
  7146.            +              {+}
  7147.  
  7148.            Backspace      {BACKSPACE} or {BS}
  7149.            Break          {BREAK}
  7150.            Clear          {CLEAR}
  7151.            Delete         {DELETE} or {DEL}
  7152.            Down Arrow     {DOWN}
  7153.            End            {END}
  7154.            Enter          {ENTER} or ~
  7155.            Escape         {ESCAPE} or {ESC}
  7156.            F1 through F16 {F1} through {F16}
  7157.            Help           {HELP}
  7158.            Home           {HOME}
  7159.            Insert         {INSERT}
  7160.            Left Arrow     {LEFT}
  7161.            Page Down      {PGDN}
  7162.            Page Up        {PGUP}
  7163.            Print Screen   {PRTSC}
  7164.            Right Arrow    {RIGHT}
  7165.            Space          {SPACE} or {SP}
  7166.            Tab            {TAB}
  7167.            Up Arrow       {UP}
  7168.  
  7169.          To enter an Alt, Control, or Shift key combination, precede the
  7170.          desired character with one or more of the following symbols:
  7171.  
  7172.            Alt            !
  7173.            Control        ^
  7174.            Shift          +
  7175.  
  7176.          To enter Alt-S:
  7177.  
  7178.            SendKey("!S")
  7179.  
  7180.          To enter Ctrl-Shift-F7:
  7181.  
  7182.            SendKey("^+{F7}")
  7183.  
  7184.          You may also repeat a key by enclosing it in braces, followed by a
  7185.          space and the total number of repetitions desired.
  7186.  
  7187.          To type 20 asterisks:
  7188.  
  7189.  
  7190.  
  7191.                                                                             122
  7192.  
  7193.                                                          WBL FUNCTION REFERENCE
  7194.  
  7195.  
  7196.            SendKey("{* 20}")
  7197.  
  7198.          To move the cursor down 8 lines:
  7199.  
  7200.            SendKey("{DOWN 8}")
  7201.  
  7202.          It is possible to use SendKey to send keystrokes to a DOS application,
  7203.          but only if you are running Windows in 386 Enhanced mode.  You would
  7204.          then transfer the keystrokes to the DOS application via the Clipboard.
  7205.  
  7206.          Examples:
  7207.  
  7208.            ; Start Notepad, and use *.* for filenames
  7209.            Run("notepad.exe", "")
  7210.            SendKey("!FO*.*~")
  7211.  
  7212.  
  7213.            ; run DOS batch file which starts our editor
  7214.            Run("edit.bat", "")
  7215.            ; wait 15 seconds for editor to load
  7216.            Delay(15)
  7217.            ; send Alt-F N to the clipboard
  7218.            ClipPut("!FN")
  7219.            ; paste contents of clipboard to DOS window
  7220.            SendKey("!{SP}EP")
  7221.  
  7222.          See Also:
  7223.  
  7224.            SKDebug
  7225.  
  7226.  
  7227.  
  7228.                                         SKDebug
  7229.  
  7230.          Controls how SendKey works
  7231.  
  7232.          Syntax:
  7233.  
  7234.            SKDebug(mode)
  7235.  
  7236.          Parameters:
  7237.  
  7238.            mode =       @OFF  Keystrokes sent to application.  No debug file
  7239.                         written.  Default mode.
  7240.                         @ON  Keystrokes sent to application.  Debug file
  7241.                         written.
  7242.                         @PARSEONLY  Keystrokes not sent to application.  Debug
  7243.                         file written.
  7244.  
  7245.  
  7246.                                                                             123
  7247.  
  7248.                                                          WBL FUNCTION REFERENCE
  7249.  
  7250.  
  7251.          Returns:
  7252.  
  7253.            (integer)    previous SKDebug mode.
  7254.  
  7255.          This function allows you to direct the keystrokes generated by your
  7256.          SendKey statements to a disk file in addition to, or instead of, the
  7257.          application window.  Normally, keystrokes are sent only to the
  7258.          application.  If you specify SKDebug (@ON), keystrokes are sent to a
  7259.          disk file as well as to the application.  If you specify SKDebug
  7260.          (@PARSEONLY), keystrokes are sent only to the disk file, and not to
  7261.          the application.  SKDebug (@OFF) returns to the default mode.
  7262.  
  7263.          By default, the file which will receive the parsed keystrokes is named
  7264.          C:\@@SKDBUG.TXT.  You can override this by making an entry in your
  7265.          WIN.INI file, under the heading [WinBatch]:
  7266.  
  7267.            [WinBatch]
  7268.            SKDFile=debug.fil
  7269.  
  7270.          where "debug.fil" is the filename, including complete path
  7271.          specification, that you want to receive the keystrokes.
  7272.  
  7273.          Example:
  7274.  
  7275.            Run("notepad.exe", "")
  7276.            SKDebug(@ON)
  7277.            SendKey("!FO*.*~")
  7278.            SKDebug(@OFF)
  7279.  
  7280.          See Also:
  7281.  
  7282.            SendKey
  7283.  
  7284.  
  7285.  
  7286.                                          StrCat
  7287.  
  7288.          Concatenates two or more strings.
  7289.  
  7290.          Syntax:
  7291.  
  7292.            StrCat (string1, string2[, stringN]...)
  7293.  
  7294.          Parameters:
  7295.  
  7296.            "string1", etc = at least two strings you want to "string" together
  7297.                             (so to speak).
  7298.  
  7299.  
  7300.  
  7301.                                                                             124
  7302.  
  7303.                                                          WBL FUNCTION REFERENCE
  7304.  
  7305.  
  7306.          Returns:
  7307.  
  7308.            (string)         concatenation of the entire list of input strings.
  7309.  
  7310.          Use this command to stick character strings together, or to format
  7311.          display messages.
  7312.  
  7313.          Example:
  7314.  
  7315.            user = AskLine("Login", "Your Name:", "")
  7316.            Message("Login", StrCat("Hi, ", user))
  7317.            ; note that this will do the same:
  7318.            Message("Login", "Hi, %user%")
  7319.  
  7320.          See Also:
  7321.  
  7322.            StrFill, StrFix, StrTrim
  7323.  
  7324.  
  7325.  
  7326.                                          StrCmp
  7327.  
  7328.          Compares two strings.
  7329.  
  7330.          Syntax:
  7331.  
  7332.            StrCmp (string1, string2)
  7333.  
  7334.          Parameters:
  7335.  
  7336.            "string1", "string2" = strings to compare.
  7337.  
  7338.          Returns:
  7339.  
  7340.            (integer)    -1, 0, or 1; depending on whether string1 is less than,
  7341.                         equal to, or greater than string2, respectively.
  7342.  
  7343.          Use this command to determine whether two strings are equal, or which
  7344.          precedes the other in an ANSI sorting sequence.
  7345.  
  7346.          Note:  This command has been included for semantic completeness.  The
  7347.          relational operators >, >=, ==, !=, <=, and < provide the same
  7348.          capability.
  7349.  
  7350.  
  7351.  
  7352.  
  7353.  
  7354.  
  7355.  
  7356.                                                                             125
  7357.  
  7358.                                                          WBL FUNCTION REFERENCE
  7359.  
  7360.  
  7361.          Example:
  7362.  
  7363.            a = AskLine("STRCMP", "Enter a test line", "")
  7364.            b = AskLine("STRCMP", "Enter another test line", "")
  7365.            c = StrCmp(a, b)
  7366.            c = c + 1
  7367.            d = StrSub("less than   equal to    greater     than", c * 12, 12)
  7368.            ; Note that above string is grouped into 12-character
  7369.            ; chunks.
  7370.            ; Desired chunk is removed with the StrSub statement.
  7371.            Message("STRCMP", "%a% is %d% %b%")
  7372.  
  7373.          See Also:
  7374.  
  7375.            StriCmp, StrIndex, StrLen, StrScan, StrSub
  7376.  
  7377.  
  7378.  
  7379.                                         StrFill
  7380.  
  7381.          Creates a string filled with a series of characters.
  7382.  
  7383.          Syntax:
  7384.  
  7385.            StrFill (filler, length)
  7386.  
  7387.          Parameters:
  7388.  
  7389.            "filler" =   a string to be repeated to create the return string.
  7390.                         If the filler string is null, spaces will be used
  7391.                         instead.
  7392.            length =     the length of the desired string.
  7393.  
  7394.          Returns:
  7395.  
  7396.            (string)     character string.
  7397.  
  7398.          Use this function to create a string consisting of multiple copies of
  7399.          the filler string concatenated together.
  7400.  
  7401.          Example:
  7402.  
  7403.            Message("My Stars", StrFill("*", 30))
  7404.  
  7405.          See Also:
  7406.  
  7407.            StrCat, StrFix, StrLen, StrTrim
  7408.  
  7409.  
  7410.  
  7411.                                                                             126
  7412.  
  7413.                                                          WBL FUNCTION REFERENCE
  7414.  
  7415.  
  7416.                                          StrFix
  7417.  
  7418.          Pads or truncates a string to a fixed length.
  7419.  
  7420.          Syntax:
  7421.  
  7422.            StrFix (base-string, pad-string, length)
  7423.  
  7424.          Parameters:
  7425.  
  7426.            "base-string" =  string to be adjusted to a fixed length.
  7427.            "pad-string" =   appended to "base-string" if needed to fill out
  7428.                             the desired length.  If "pad-string" is null,
  7429.                             spaces are used instead.
  7430.            length =         length of the desired string.
  7431.  
  7432.          Returns:
  7433.  
  7434.            (string)         fixed size string.
  7435.  
  7436.          This function "fixes" the length of a string, either by truncating it
  7437.          on the right, or by appending enough copies of pad-string to achieve
  7438.          the desired length.
  7439.  
  7440.          Example:
  7441.  
  7442.            a = StrFix("Henry", " ", 15)
  7443.            b = StrFix("Betty", " ", 15)
  7444.            c = StrFix("George", " ", 15)
  7445.            Message("Spaced Names", StrCat(a, b, c))
  7446.  
  7447.          See Also:
  7448.  
  7449.            StrFill, StrLen, StrTrim
  7450.  
  7451.  
  7452.  
  7453.                                         StriCmp
  7454.  
  7455.          Compares two strings without regard to case.
  7456.  
  7457.          Syntax:
  7458.  
  7459.            StriCmp (string1, string2)
  7460.  
  7461.          Parameters:
  7462.  
  7463.            "string1", "string2" = strings to compare.
  7464.  
  7465.  
  7466.                                                                             127
  7467.  
  7468.                                                          WBL FUNCTION REFERENCE
  7469.  
  7470.  
  7471.          Returns:
  7472.  
  7473.            (integer)    -1, 0, or 1; depending on whether string1 is less than,
  7474.                         equal to, or greater than string2, respectively.
  7475.  
  7476.          Use this command to determine whether two strings are equal, or which
  7477.          precedes the other in an ANSI sorting sequence, when case is ignored.
  7478.  
  7479.          Example:
  7480.  
  7481.            a = AskLine("STRICMP", "Enter a test line", "")
  7482.            b = AskLine("STRICMP", "Enter another test line", "")
  7483.            c = StriCmp(a, b)
  7484.            c = c + 1
  7485.            d = StrSub("less than   equal to    greater than", c * 12, 12)
  7486.            ; Note that above string is grouped into 12-character
  7487.            ; chunks.
  7488.            ; Desired chunk is removed with the StrSub statement.
  7489.            Message("STRICMP", "%a% is %d% %b%")
  7490.  
  7491.          See Also:
  7492.  
  7493.            StrCmp, StrIndex, StrLen, StrScan, StrSub
  7494.  
  7495.  
  7496.  
  7497.                                         StrIndex
  7498.  
  7499.          Searches a string for a substring.
  7500.  
  7501.          Syntax:
  7502.  
  7503.            StrIndex (string, sub-string, start, direction)
  7504.  
  7505.          Parameters:
  7506.  
  7507.            "string" =    the string to be searched for a substring.
  7508.            "substring" = the string to look for within the main string.
  7509.            start =       the position in the main string to begin search.  The
  7510.                          first character of a string is position 1.
  7511.            direction =   the search direction.  @FWDSCAN searches forward,
  7512.                          while @BACKSCAN searches backwards.
  7513.  
  7514.          Returns:
  7515.  
  7516.            (integer)     position of "sub-string" within "string";
  7517.                          0 if not found.
  7518.  
  7519.  
  7520.  
  7521.                                                                             128
  7522.  
  7523.                                                          WBL FUNCTION REFERENCE
  7524.  
  7525.  
  7526.          This function searches for a substring within a "target" string.
  7527.          Starting at the "start" position, it goes forward or backward
  7528.          depending on the value of the "direction" parameter.  It stops when it
  7529.          finds the "substring" within the "target" string, and returns its
  7530.          position.
  7531.  
  7532.          A start position of 0 has special meaning depending on which direction
  7533.          you are scanning.  For forward searches, zero indicates the search
  7534.          should start at the beginning of the string.  For reverse searches,
  7535.          zero causes it to start at the end of the string.
  7536.  
  7537.          Example:
  7538.  
  7539.            instr = AskLine("STRINDEX", "Type a sentence:", "")
  7540.            start = 1
  7541.            end = StrIndex(instr, " ", start, @FWDSCAN)
  7542.            If end == 0 Then Goto error
  7543.            Message("STRINDEX", StrCat("The first word is: ", StrSub(instr,
  7544.               start, end - 1))
  7545.            Exit
  7546.            :error
  7547.            Message("Sorry...", "No spaces found")
  7548.  
  7549.          See Also:
  7550.  
  7551.            StrLen, StrScan, StrSub
  7552.  
  7553.  
  7554.  
  7555.                                          StrLen
  7556.  
  7557.          Provides the length of a string.
  7558.  
  7559.          Syntax:
  7560.  
  7561.            StrLen (string)
  7562.  
  7563.          Parameters:
  7564.  
  7565.            "string" =   any text string.
  7566.  
  7567.          Returns:
  7568.  
  7569.            (integer)    length of string.
  7570.  
  7571.          Use this command to determine the length of a string variable or
  7572.          expression.
  7573.  
  7574.  
  7575.  
  7576.                                                                             129
  7577.  
  7578.                                                          WBL FUNCTION REFERENCE
  7579.  
  7580.  
  7581.          Example:
  7582.  
  7583.            myfile = AskLine("Filename", "File to process:", "")
  7584.            namlen = StrLen(myfile)
  7585.            If namlen > 13 Then Message("", "Filename too long!")
  7586.  
  7587.          See Also:
  7588.  
  7589.            StrFill, StrFix, StrIndex, StrScan, StrTrim
  7590.  
  7591.  
  7592.  
  7593.                                         StrLower
  7594.  
  7595.          Converts a string to lowercase.
  7596.  
  7597.          Syntax:
  7598.  
  7599.            StrLower (string)
  7600.  
  7601.          Parameters:
  7602.  
  7603.            "string" =   any text string.
  7604.  
  7605.          Returns:
  7606.  
  7607.            (string)     lowercase string.
  7608.  
  7609.          Use this command to convert a text string to lower case.
  7610.  
  7611.          Example:
  7612.  
  7613.            a = AskLine("STRLOWER", "Enter text", "")
  7614.            b = StrLower(a)
  7615.            Message(a, b)
  7616.  
  7617.          See Also:
  7618.  
  7619.            StriCmp, StrUpper
  7620.  
  7621.  
  7622.  
  7623.                                        StrReplace
  7624.  
  7625.          Replaces all occurances of a substring with another.
  7626.  
  7627.  
  7628.  
  7629.  
  7630.  
  7631.                                                                             130
  7632.  
  7633.                                                          WBL FUNCTION REFERENCE
  7634.  
  7635.  
  7636.          Syntax:
  7637.  
  7638.            StrReplace (string, old, new)
  7639.  
  7640.          Parameters:
  7641.  
  7642.            "string" =   string in which to search.
  7643.            "old" =      target substring.
  7644.            "new" =      replacement substring.
  7645.  
  7646.          Returns:
  7647.  
  7648.            (string)     updated "string" with "old" replaced by "new"
  7649.  
  7650.          StrReplace scans the "string", searching for occurrences of "old" and
  7651.          replacing each occurrence with "new".
  7652.  
  7653.          Example:
  7654.  
  7655.            ; Copy all INI files to clipboard
  7656.            a = FileItemize("*.ini")
  7657.            crlf = StrCat(Num2Char(13), Num2Char(10))
  7658.            b = StrReplace(a, " ", crlf)
  7659.            ClipPut(b)
  7660.  
  7661.  
  7662.  
  7663.                                         StrScan
  7664.  
  7665.          Searches string for occurrence of delimiters.
  7666.  
  7667.          Syntax:
  7668.  
  7669.            StrScan (string, delimiters, start, direction)
  7670.  
  7671.          Parameters:
  7672.  
  7673.            "string" =     the string that is to be searched.
  7674.            "delimiters" = a string of delimiters to search for within
  7675.                           "string".
  7676.            start =        the position in the main string to begin search.  The
  7677.                           first character of a string is position 1.
  7678.            direction =    the search direction.  @FWDSCAN searches forward,
  7679.                           while @BACKSCAN searches backwards.
  7680.  
  7681.          Returns:
  7682.  
  7683.            (integer)      position of delimiter in string, or 0 if not found.
  7684.  
  7685.  
  7686.                                                                             131
  7687.  
  7688.                                                          WBL FUNCTION REFERENCE
  7689.  
  7690.  
  7691.          This function searches for delimiters within a target "string".
  7692.          Starting at the "start" position, it goes forward or backward
  7693.          depending on the value of the "direction" parameter.  It stops when it
  7694.          finds any one of the characters in the "delimiters" string within the
  7695.          target "string".
  7696.  
  7697.          Example:
  7698.  
  7699.            thestr = "123,456.789:abc"
  7700.            start = 1
  7701.            end = StrScan(thestr, ",.:", start, @FWDSCAN)
  7702.            If end == 0 Then Goto error
  7703.            Message("The first parameter", StrSub(thestr, start, end - start
  7704.               + 1))
  7705.            Exit
  7706.            :error
  7707.            Message("Sorry...", "No delimiters found")
  7708.  
  7709.          See Also:
  7710.  
  7711.            StrLen, StrSub
  7712.  
  7713.  
  7714.  
  7715.                                          StrSub
  7716.  
  7717.          Extracts a substring out of an existing string.
  7718.  
  7719.          Syntax:
  7720.  
  7721.            StrSub (string, start, length)
  7722.  
  7723.          Parameters:
  7724.  
  7725.            "string" =   the string from which the substring is to be extracted.
  7726.            start =      character position within "string" where the sub-string
  7727.                         starts.  (The first character of the string is at
  7728.                         position 1).
  7729.            length =     length of desired substring.  If you specify a length
  7730.                         of zero it will return a null string.
  7731.  
  7732.          Returns:
  7733.  
  7734.            (string)     substring of parameter string.
  7735.  
  7736.          This function extracts a substring from within a "target" string.
  7737.          Starting at the "start" position, it copies up to "length" characters
  7738.          into the substring.
  7739.  
  7740.  
  7741.                                                                             132
  7742.  
  7743.                                                          WBL FUNCTION REFERENCE
  7744.  
  7745.  
  7746.          Example:
  7747.  
  7748.            a = "My dog has fleas"
  7749.            animal = StrSub(a, 4, 3)
  7750.            Message("STRSUB", "My animal is a %animal%")
  7751.  
  7752.          See Also:
  7753.  
  7754.            StrLen, StrScan
  7755.  
  7756.  
  7757.  
  7758.                                         StrTrim
  7759.  
  7760.          Removes leading and trailing spaces from a character string.
  7761.  
  7762.          Syntax:
  7763.  
  7764.            StrTrim (string)
  7765.  
  7766.          Parameters:
  7767.  
  7768.            "string" =   a string with unwanted spaces at the beginning and/or
  7769.                         the end.
  7770.  
  7771.          Returns:
  7772.  
  7773.            (string)     string devoid of leading and trailing spaces.
  7774.  
  7775.          Use this function to remove unwanted spaces from the beginning and end
  7776.          of text data.
  7777.  
  7778.          Example:
  7779.  
  7780.            myfile = AskLine("STRTRIM", "Filename ('exit' cancels)", "")
  7781.            tstexit = StrTrim(StrLower(myfile))
  7782.            If tstexit == "exit" Then Goto cancel
  7783.            ; processing of myfile continues...
  7784.            : cancel
  7785.            Message("Canceled", "...by user request")
  7786.  
  7787.          See Also:
  7788.  
  7789.            StrFill, StrFix, StrLen
  7790.  
  7791.  
  7792.  
  7793.  
  7794.  
  7795.  
  7796.                                                                             133
  7797.  
  7798.                                                          WBL FUNCTION REFERENCE
  7799.  
  7800.  
  7801.                                         StrUpper
  7802.  
  7803.          Converts a string to uppercase.
  7804.  
  7805.          Syntax:
  7806.  
  7807.            StrUpper (string)
  7808.  
  7809.          Parameters:
  7810.  
  7811.            "string" =   any text string.
  7812.  
  7813.          Returns:
  7814.  
  7815.            (string)     uppercase string.
  7816.  
  7817.          Use this function to convert a text string to upper case.
  7818.  
  7819.          Example:
  7820.  
  7821.            a = AskLine("STRUPPER", "Enter text","")
  7822.            b = StrUpper(a)
  7823.            Message(a, b)
  7824.  
  7825.          See Also:
  7826.  
  7827.            StriCmp, StrLower
  7828.  
  7829.  
  7830.  
  7831.                                         TextBox
  7832.  
  7833.          Displays a file in a listbox on the screen and returns selected line,
  7834.          if any.
  7835.  
  7836.          Syntax:
  7837.  
  7838.            TextBox (title, filename)
  7839.  
  7840.          Parameters:
  7841.  
  7842.            "title" =    listbox title.
  7843.            "filename" = file containing contents of listbox.
  7844.  
  7845.          Returns:
  7846.  
  7847.            (string) =   highlighted string, if any.
  7848.  
  7849.  
  7850.  
  7851.                                                                             134
  7852.  
  7853.                                                          WBL FUNCTION REFERENCE
  7854.  
  7855.  
  7856.          This function loads a file into a Windows listbox and displays the
  7857.          listbox to the user.  TextBox has two primary uses:  First, it can be
  7858.          used to display multi-line messages to the user.  In addition, because
  7859.          of its ability to return a selected line, it may be used as a multiple
  7860.          choice question box.  The line highlighted by the user (if any) will
  7861.          be returned to the program.
  7862.  
  7863.          If disk drive and path not are part of the filename, the current
  7864.          directory will be examined first, and then the DOS path will be
  7865.          searched to find the desired file.
  7866.  
  7867.          Example:
  7868.  
  7869.            ; Display WIN.INI
  7870.            a = TextBox("Choose a line", "c:\windows\win.ini")
  7871.            Display(3, "Chosen line", a)
  7872.  
  7873.          See Also:
  7874.  
  7875.            ItemSelect
  7876.  
  7877.  
  7878.  
  7879.                                         Version
  7880.  
  7881.          Returns the version number of the currently-running WinBatch language
  7882.          processor.
  7883.  
  7884.          Syntax:
  7885.  
  7886.            Version ( )
  7887.  
  7888.          Parameters:
  7889.  
  7890.            (none)
  7891.  
  7892.          Returns:
  7893.  
  7894.            (string) =   WinBatch version number.
  7895.  
  7896.          Use this function to determine the version of WinBatch that is
  7897.          running.  It is useful to verify that a batch file generated with the
  7898.          latest version of the language will operate properly on what may be a
  7899.          different machine with a different version of WinBatch installed.
  7900.  
  7901.          Example:
  7902.  
  7903.            a = Version()
  7904.  
  7905.  
  7906.                                                                             135
  7907.  
  7908.                                                          WBL FUNCTION REFERENCE
  7909.  
  7910.  
  7911.          See Also:
  7912.  
  7913.            Environment, DOSVersion, WinVersion
  7914.  
  7915.  
  7916.  
  7917.                                        WallPaper
  7918.  
  7919.          Changes the Windows wallpaper.
  7920.  
  7921.          Syntax:
  7922.  
  7923.            WallPaper (bmp-name, tile)
  7924.  
  7925.          Parameters:
  7926.  
  7927.            "bmp-name" = Name of the BMP wallpaper file.
  7928.  
  7929.            tile =       @TRUE if wallpaper should be tiled.
  7930.                         @FALSE if wallpaper should not be tiled.
  7931.  
  7932.          Returns:
  7933.  
  7934.            (integer)    always 0.
  7935.  
  7936.          This function immediately changes the Windows wallpaper.  It can even
  7937.          be used for wallpaper "slide shows."
  7938.  
  7939.          Example:
  7940.  
  7941.            DirChange("c:\windows")
  7942.            a = FileItemize("*.bmp")
  7943.            a = ItemSelect("Select New paper", a, " ")
  7944.            tile = @FALSE
  7945.            If FileSize(a) < 40000 Then tile = @TRUE
  7946.            Wallpaper(a, tile)
  7947.  
  7948.  
  7949.  
  7950.                                       WinActivate
  7951.  
  7952.          Activates a previously running window.
  7953.  
  7954.          Syntax:
  7955.  
  7956.            WinActivate (partial-windowname)
  7957.  
  7958.  
  7959.  
  7960.  
  7961.                                                                             136
  7962.  
  7963.                                                          WBL FUNCTION REFERENCE
  7964.  
  7965.  
  7966.          Parameters:
  7967.  
  7968.            "partial-windowname" =
  7969.                         either an initial portion of, or an entire window name.
  7970.                         The most-recently used window whose title matches the
  7971.                         name will be activated.
  7972.  
  7973.          Returns:
  7974.  
  7975.            (integer)    @TRUE if a window was found to activate;
  7976.                         @FALSE if no windows were found.
  7977.  
  7978.          Use this function to activate windows for user input.
  7979.  
  7980.          Example:
  7981.  
  7982.            Run("notepad.exe", "")
  7983.            Run("clock.exe", "")
  7984.            WinActivate("Notepad")
  7985.  
  7986.          See Also:
  7987.  
  7988.            WinCloseNot, WinGetActive, WinShow
  7989.  
  7990.  
  7991.  
  7992.                                        WinArrange
  7993.  
  7994.          Arranges, tiles, and/or stacks application windows.
  7995.  
  7996.          Syntax:
  7997.  
  7998.            WinArrange (style)
  7999.  
  8000.          Parameters:
  8001.  
  8002.            style =      one of the following:  @STACK, @TILE (or @ARRANGE),
  8003.                         @ROWS, or @COLUMNS.
  8004.  
  8005.          Returns:
  8006.  
  8007.            (integer)    always @TRUE.
  8008.  
  8009.          Use this function to rearrange the open windows on the screen.  (Any
  8010.          iconized programs are unaffected.)
  8011.  
  8012.  
  8013.  
  8014.  
  8015.  
  8016.                                                                             137
  8017.  
  8018.                                                          WBL FUNCTION REFERENCE
  8019.  
  8020.  
  8021.          When you specify @ROWS and you have more than four open windows, or if
  8022.          you specify @COLUMNS and you have more than three open windows,
  8023.          WinBatch will revert to @TILE.
  8024.  
  8025.          Example:
  8026.  
  8027.            ; Reveal all windows
  8028.            WinArrange(@TILE)
  8029.  
  8030.          See Also:
  8031.  
  8032.            WinItemize, WinHide, WinIconize, WinPlace, WinShow, WinZoom
  8033.  
  8034.  
  8035.  
  8036.                                         WinClose
  8037.  
  8038.          Closes an open window.
  8039.  
  8040.          Syntax:
  8041.  
  8042.            WinClose (partial-windowname)
  8043.  
  8044.          Parameters:
  8045.  
  8046.            "partial-windowname" =
  8047.                         either an initial portion of, or an entire window name.
  8048.                         The most-recently used window whose title matches the
  8049.                         name will be closed.
  8050.  
  8051.          Returns:
  8052.  
  8053.            (integer)    @TRUE if a window was found to close;
  8054.                         @FALSE if no windows were found.
  8055.  
  8056.          Use this function to close windows.
  8057.  
  8058.          WinClose will not close the window which contains the currently-
  8059.          executing WinBatch file.  You can, however, use EndSession to end the
  8060.          current Windows session.
  8061.  
  8062.          Example:
  8063.  
  8064.            Run("notepad.exe", "")
  8065.            WinClose("Notepad")
  8066.  
  8067.  
  8068.  
  8069.  
  8070.  
  8071.                                                                             138
  8072.  
  8073.                                                          WBL FUNCTION REFERENCE
  8074.  
  8075.  
  8076.          See Also:
  8077.  
  8078.            WinCloseNot, WinHide, WinIconize, WinWaitClose
  8079.  
  8080.  
  8081.  
  8082.                                       WinCloseNot
  8083.  
  8084.          Closes all windows, except those provided as parameters.
  8085.  
  8086.          Syntax:
  8087.  
  8088.            WinCloseNot (partial-windowname [, partial-windowname]...)
  8089.  
  8090.          Parameters:
  8091.  
  8092.            "partial-windowname" =
  8093.                         either an initial portion of, or an entire window name.
  8094.                         Any windows whose titles match the partial names will
  8095.                         stay open.
  8096.  
  8097.          Returns:
  8098.  
  8099.            (integer)    always @TRUE.
  8100.  
  8101.          Use this function to close all windows except those specifically
  8102.          listed in the parameter strings.
  8103.  
  8104.          At least one partial windowname must be given.  A null-string
  8105.          parameter would match all windows, or, in other words, close nothing.
  8106.  
  8107.          Example:
  8108.  
  8109.            ; The statement below will close all windows except:
  8110.            ; 1) Program Manager (starts with 'Program')
  8111.            ; 2) Clock  (starts with 'Clo' )
  8112.            WinCloseNot("Program", "Clo")
  8113.  
  8114.          See Also:
  8115.  
  8116.            WinItemize, WinClose, WinHide, WinIconize, WinWaitClose
  8117.  
  8118.  
  8119.  
  8120.                                        WinConfig
  8121.  
  8122.          Returns WIN3 mode flags.
  8123.  
  8124.  
  8125.  
  8126.                                                                             139
  8127.  
  8128.                                                          WBL FUNCTION REFERENCE
  8129.  
  8130.  
  8131.          Syntax:
  8132.  
  8133.            WinConfig ( )
  8134.  
  8135.          Parameters:
  8136.  
  8137.            (none)
  8138.  
  8139.          Returns:
  8140.  
  8141.            (integer)    sum of windows configuration bits.
  8142.  
  8143.          Returns Windows configuration information as a number, which is the
  8144.          sum of the following individual bits:
  8145.  
  8146.            1       Protected Mode
  8147.            2       80286 CPU
  8148.            4       80386 CPU
  8149.            8       80486 CPU
  8150.            16      Standard Mode
  8151.            32      Enhanced Mode
  8152.            64      8086 CPU
  8153.            128     80186 CPU
  8154.            256     Large PageFrame
  8155.            512     Small PageFrame
  8156.            1024    80x87 Installed
  8157.  
  8158.          You will need to use bitwise operators to extract the individual bits.
  8159.  
  8160.          Examples:
  8161.  
  8162.            cfg = WinConfig()
  8163.            If cfg & 32 Then Display(2, "Windows Mode", "Enhanced Mode")
  8164.            If cfg & 16 Then Display(2, "Windows Mode", "Standard Mode")
  8165.            If !(cfg & 1) Then Display(2, "Windows Mode", "Real Mode")
  8166.  
  8167.            cfg = WinConfig()
  8168.            If cfg & 1024 Then Display(2, "Math co-processor", "Yes")
  8169.            If !(cfg & 1024) Then Display(2, "Math co-processor", "No")
  8170.  
  8171.  
  8172.  
  8173.                                         WinExist
  8174.  
  8175.          Tells if Window exists.
  8176.  
  8177.  
  8178.  
  8179.  
  8180.  
  8181.                                                                             140
  8182.  
  8183.                                                          WBL FUNCTION REFERENCE
  8184.  
  8185.  
  8186.          Syntax:
  8187.  
  8188.            WinExist (partial-windowname)
  8189.  
  8190.          Parameters:
  8191.  
  8192.            "partial-windowname" =
  8193.                         either an initial portion of, or an entire window name.
  8194.  
  8195.          Returns:
  8196.  
  8197.            (integer)    @TRUE if a matching window is found.
  8198.                         @FALSE if a matching window is not found.
  8199.  
  8200.          Note: The partial window name you give must match the initial portion
  8201.          of the window name (as appears in the title bar) exactly, including
  8202.          proper case (upper or lower) and punctuation.
  8203.  
  8204.          Example:
  8205.  
  8206.            If WinExist("Clock") == @FALSE Then RunIcon("Clock", "")
  8207.  
  8208.  
  8209.  
  8210.                                       WinGetActive
  8211.  
  8212.          Gets the title of the active window.
  8213.  
  8214.          Syntax:
  8215.  
  8216.            WinGetActive ( )
  8217.  
  8218.          Returns:
  8219.  
  8220.            (string)     title of active window.
  8221.  
  8222.          Use this function to determine which window is currently active.
  8223.  
  8224.          Example:
  8225.  
  8226.            currentwin = WinGetActive()
  8227.  
  8228.          See Also:
  8229.  
  8230.            WinItemize, WinActivate
  8231.  
  8232.  
  8233.  
  8234.  
  8235.  
  8236.                                                                             141
  8237.  
  8238.                                                          WBL FUNCTION REFERENCE
  8239.  
  8240.  
  8241.                                         WinHide
  8242.  
  8243.          Hides a window.
  8244.  
  8245.          Syntax:
  8246.  
  8247.            WinHide (partial-windowname)
  8248.  
  8249.          Parameters:
  8250.  
  8251.            "partial-windowname" =
  8252.                         either an initial portion of, or an entire window name.
  8253.                         The most-recently used window whose title matches the
  8254.                         name will be hidden.
  8255.  
  8256.          Returns:
  8257.  
  8258.            (integer)    @TRUE if a window was found to hide;
  8259.                         @FALSE if no windows were found.
  8260.  
  8261.          Use this function to hide windows.  The programs are still running
  8262.          when they are hidden.
  8263.  
  8264.          A "partial-windowname" of "" (null string) hides the current WinBatch
  8265.          window.
  8266.  
  8267.          Example:
  8268.  
  8269.            Run("notepad.exe", "")
  8270.            WinHide("Notepad")
  8271.            Delay(3)
  8272.            WinShow("Notepad")
  8273.  
  8274.          See Also:
  8275.  
  8276.            WinClose, WinIconize, WinPlace
  8277.  
  8278.  
  8279.  
  8280.                                        WinIconize
  8281.  
  8282.          Iconizes a window.
  8283.  
  8284.          Syntax:
  8285.  
  8286.            WinIconize (partial-windowname)
  8287.  
  8288.  
  8289.  
  8290.  
  8291.                                                                             142
  8292.  
  8293.                                                          WBL FUNCTION REFERENCE
  8294.  
  8295.  
  8296.          Parameters:
  8297.  
  8298.            "partial-windowname" =
  8299.                         either an initial portion of, or an entire window name.
  8300.                         The most-recently used window whose title matches the
  8301.                         name will be iconized.
  8302.  
  8303.          Returns:
  8304.  
  8305.            (integer)    @TRUE if a window was found to iconize;
  8306.                         @FALSE if no windows were found.
  8307.  
  8308.          Use this function to turn a window into an icon at the bottom of the
  8309.          screen.
  8310.  
  8311.          A "partial-windowname" of "" (null string) iconizes the current
  8312.          WinBatch window.
  8313.  
  8314.          Example:
  8315.  
  8316.            Run("clock.exe", "")
  8317.            WinIconize("Clo")      ; partial window name used here
  8318.  
  8319.          See Also:
  8320.  
  8321.            WinClose, WinHide, WinPlace, WinShow, WinZoom
  8322.  
  8323.  
  8324.  
  8325.                                        WinItemize
  8326.  
  8327.          Returns a tab-delimited list of all open windows.
  8328.  
  8329.          Syntax:
  8330.  
  8331.            WinItemize ( )
  8332.  
  8333.          Parameters:
  8334.  
  8335.            (none)
  8336.  
  8337.          Returns:
  8338.  
  8339.            (string)     list of the titles of all open windows.
  8340.  
  8341.          This function compiles a list of all the open application windows'
  8342.          titles and separates the titles by tabs.  This is especially useful in
  8343.  
  8344.  
  8345.  
  8346.                                                                             143
  8347.  
  8348.                                                          WBL FUNCTION REFERENCE
  8349.  
  8350.  
  8351.          conjunction with the ItemSelect function, which enables the user to
  8352.          choose an item from such a tab-delimited list.
  8353.  
  8354.          Note this behaves somewhat differently than FileItemize and
  8355.          DirItemize, which create space-delimited lists.  This is because
  8356.          window titles regularly contain embedded spaces.
  8357.  
  8358.          Example:
  8359.  
  8360.            ; Find a window
  8361.            allwins = WinItemize()
  8362.            htab = Num2Char(9)
  8363.            mywind = ItemSelect("Windows", allwins, htab)
  8364.            WinActivate(mywind)
  8365.  
  8366.          See Also:
  8367.  
  8368.            DirItemize, FileItemize, ItemSelect
  8369.  
  8370.  
  8371.  
  8372.                                         WinPlace
  8373.  
  8374.          Places a window anywhere on the screen.
  8375.  
  8376.          Syntax:
  8377.  
  8378.            WinPlace (x-ulc, y-ulc, x-brc, y-brc, partial-windowname)
  8379.  
  8380.          Parameters:
  8381.  
  8382.            x-ulc =      how far from the left of the screen to place the upper-
  8383.                         left corner (0-1000).
  8384.            y-ulc =      how far from the top of the screen to place the upper-
  8385.                         left corner (0-1000).
  8386.            x-brc =      how far from the left of the screen to place the
  8387.                         bottom-right corner (10-1000) or @NORESIZE.
  8388.            y-brc =      how far from the top of the screen to place the bottom-
  8389.                         right corner (10-1000) or @NORESIZE or @ABOVEICONS.
  8390.            "partial-windowname" =
  8391.                         either an initial portion of, or an entire window name.
  8392.                         The most-recently used window whose title matches the
  8393.                         name will be moved to the new position.
  8394.  
  8395.          Returns:
  8396.  
  8397.            (integer)    @TRUE if a window was found to move;
  8398.                         @FALSE if no windows were found.
  8399.  
  8400.  
  8401.                                                                             144
  8402.  
  8403.                                                          WBL FUNCTION REFERENCE
  8404.  
  8405.  
  8406.          Use this function to move windows on the screen.  (You cannot,
  8407.          however, move icons or windows that have been maximized to full
  8408.          screen.)
  8409.  
  8410.          The "x-ulc", "y-ulc", "x-brc", and "y-brc" parameters are based on a
  8411.          logical screen that is 1000 points wide by 1000 points high.
  8412.  
  8413.          You can move the window without changing the width and/or height by
  8414.          specifying @NORESIZE for the "x-brc" and/or "y-brc" parameters,
  8415.          respectively.
  8416.  
  8417.          You can fix the bottom of the window to sit just above the line of
  8418.          icons along the bottom of the screen by specifying a "y-brc" of
  8419.          @ABOVEICONS.
  8420.  
  8421.          Some sample parameters:
  8422.  
  8423.            Upper left quarter of the screen:  0, 0, 500, 500
  8424.            Upper right quarter:  500, 0, 500, 1000
  8425.            Center quarter:  250, 250, 750, 750
  8426.            Lower left eighth:  0, 750, 500, 1000
  8427.  
  8428.          A handy utility program is included with WinBatch, called WININFO.EXE.
  8429.          This program lets you take an open window that is sized and positioned
  8430.          the way you like it, and automatically create the proper WinPlace
  8431.          statement for you.  It puts the text into the Clipboard, from which
  8432.          you can paste it into your batch code:
  8433.  
  8434.          You'll need a mouse to use WinInfo.  While WinInfo is the active
  8435.          window, place the mouse over the window you wish to create the
  8436.          WinPlace statement for, and press the spacebar.  The new statement
  8437.          will be placed into the Clipboard.  Then press the Esc key to close
  8438.          WinInfo.
  8439.  
  8440.          Example:
  8441.  
  8442.            WinPlace(0, 0, 200, 200, "Clock")
  8443.  
  8444.          See Also:
  8445.  
  8446.            WinArrange, WinHide, WinIconize, WinShow, WinZoom
  8447.  
  8448.  
  8449.  
  8450.                                       WinPosition
  8451.  
  8452.          Returns Window position.
  8453.  
  8454.  
  8455.  
  8456.                                                                             145
  8457.  
  8458.                                                          WBL FUNCTION REFERENCE
  8459.  
  8460.  
  8461.          Syntax:
  8462.  
  8463.            WinPosition (partial-windowname)
  8464.  
  8465.          Parameters:
  8466.  
  8467.            "partial-windowname" =
  8468.                         either an initial portion of, or an entire window name.
  8469.  
  8470.          Returns:
  8471.  
  8472.            (string)     window coordinates, delimited by commas.
  8473.  
  8474.          Returns the current Window position information for the selected
  8475.          Window.  It returns 4 comma-separated numbers (see WinPlace for
  8476.          details).
  8477.  
  8478.          Example:
  8479.  
  8480.            Run("clock.exe", "")                  ; start Clock
  8481.            WinPlace(0,0,300,300, "Clock")        ; place Clock
  8482.            pos = WinPosition("Clock")            ; save position
  8483.            delay(2)
  8484.            WinPlace(200,200,300,300, "Clock")    ; move Clock
  8485.            delay(2)
  8486.            WinPlace(%pos%, "Clock")              ; restore Clock
  8487.  
  8488.          See Also:
  8489.  
  8490.            WinPlace
  8491.  
  8492.  
  8493.  
  8494.                                         WinShow
  8495.  
  8496.          Shows a window in its "normal" state.
  8497.  
  8498.          Syntax:
  8499.  
  8500.            WinShow (partial-windowname)
  8501.  
  8502.          Parameters:
  8503.  
  8504.            "partial-windowname" =
  8505.                         either an initial portion of, or an entire window name.
  8506.                         The most-recently used window whose title matches the
  8507.                         name will be shown.
  8508.  
  8509.  
  8510.  
  8511.                                                                             146
  8512.  
  8513.                                                          WBL FUNCTION REFERENCE
  8514.  
  8515.  
  8516.          Returns:
  8517.  
  8518.            (integer)    @TRUE if a window was found to show;
  8519.                         @FALSE if no windows were found.
  8520.  
  8521.          Use this function to restore a window to its "normal" size and
  8522.          position.
  8523.  
  8524.          A "partial-windowname" of "" (null string) restores the current
  8525.          WinBatch window.
  8526.  
  8527.          Example:
  8528.  
  8529.            RunZoom("notepad.exe", "")
  8530.            ; other processing...
  8531.            WinShow("Notepad")
  8532.  
  8533.          See Also:
  8534.  
  8535.            WinArrange, WinHide, WinIconize, WinZoom
  8536.  
  8537.  
  8538.  
  8539.                                         WinTitle
  8540.  
  8541.          Changes the title of a window.
  8542.  
  8543.          Syntax:
  8544.  
  8545.            WinTitle (partial-windowname, new-name)
  8546.  
  8547.          Parameters:
  8548.  
  8549.            "partial-windowname" =
  8550.                         either an initial portion of, or an entire window name.
  8551.                         The most-recently used window whose title matches the
  8552.                         name will be shown.
  8553.            "new-name" = the new name of the window.
  8554.  
  8555.          Returns:
  8556.  
  8557.            (integer)    @TRUE if a window was found to rename;
  8558.                         @FALSE if no windows were found.
  8559.  
  8560.          Use this function to change a window's title.
  8561.  
  8562.          A "partial-windowname" of "" (null string) refers to the current
  8563.          WinBatch window.
  8564.  
  8565.  
  8566.                                                                             147
  8567.  
  8568.                                                          WBL FUNCTION REFERENCE
  8569.  
  8570.  
  8571.          Warning:  Some applications may rely upon their window's title staying
  8572.          the same!  Therefore, the WinTitle function should be used with
  8573.          caution and adequate testing.
  8574.  
  8575.          Example:
  8576.  
  8577.            ; Capitalize title of window
  8578.            htab = Num2Char(9)
  8579.            allwinds = WinItemize()
  8580.            mywin = ItemSelect("Uppercase Windows", allwinds, htab)
  8581.            WinTitle(mywin, StrUpper(mywin))
  8582.            Drop(htab, allwinds, mywin)
  8583.  
  8584.          See Also:
  8585.  
  8586.            WinItemize
  8587.  
  8588.  
  8589.  
  8590.                                        WinVersion
  8591.  
  8592.          Provides the version number of the current Windows system.
  8593.  
  8594.          Syntax:
  8595.  
  8596.            WinVersion (level)
  8597.  
  8598.          Parameters:
  8599.  
  8600.            level =      either @MAJOR or @MINOR.
  8601.  
  8602.          Returns:
  8603.  
  8604.            (integer)    either major or minor part of the Windows version
  8605.                         number.
  8606.  
  8607.          Use this command to determine which version of Windows is currently
  8608.          running.
  8609.  
  8610.          @MAJOR returns the integer part of the Windows version number; i.e.
  8611.          1.0, 2.11, 3.0, etc.
  8612.  
  8613.          @MINOR returns the decimal part of the Windows version number; i.e.
  8614.          1.0, 2.11, 3.0, etc.
  8615.  
  8616.  
  8617.  
  8618.  
  8619.  
  8620.  
  8621.                                                                             148
  8622.  
  8623.                                                          WBL FUNCTION REFERENCE
  8624.  
  8625.  
  8626.          Example:
  8627.  
  8628.            minorver = WinVersion(@MINOR)
  8629.            majorver = WinVersion(@MAJOR)
  8630.            Message("Windows Version", StrCat(majorver, ".", minorver))
  8631.  
  8632.          See Also:
  8633.  
  8634.            Version, DOSVersion
  8635.  
  8636.  
  8637.  
  8638.                                       WinWaitClose
  8639.  
  8640.          Suspends the batch file execution until a specified window has been
  8641.          closed.
  8642.  
  8643.          Syntax:
  8644.  
  8645.            WinWaitClose (partial-windowname)
  8646.  
  8647.          Parameters:
  8648.  
  8649.            "partial-windowname" =
  8650.                         either an initial portion of, or an entire window name.
  8651.                         WinWaitClose suspends execution until all matching
  8652.                         windows have been closed.
  8653.  
  8654.          Returns:
  8655.  
  8656.            (integer)    @TRUE if at least one window was found to wait for;
  8657.                         @FALSE if no windows were found.
  8658.  
  8659.          Use this function to suspend the batch file's execution until the user
  8660.          has finished using a given window and has manually closed it.
  8661.  
  8662.          Example:
  8663.  
  8664.            Run("clock.exe", "")
  8665.            Display(4, "Note", "Close Clock to continue")
  8666.            WinWaitClose("Clock")
  8667.            Message("Continuing...", "Clock closed")
  8668.  
  8669.  
  8670.  
  8671.          See Also:
  8672.  
  8673.            Delay, Yield
  8674.  
  8675.  
  8676.                                                                             149
  8677.  
  8678.                                                          WBL FUNCTION REFERENCE
  8679.  
  8680.  
  8681.                                         WinZoom
  8682.  
  8683.          Maximizes a window to full-screen.
  8684.  
  8685.          Syntax:
  8686.  
  8687.            WinZoom (partial-windowname)
  8688.  
  8689.          Parameters:
  8690.  
  8691.            "partial-windowname" =
  8692.                         either an initial portion of, or an entire window name.
  8693.                         The most-recently used window whose title matches the
  8694.                         name will be shown.
  8695.  
  8696.          Returns:
  8697.  
  8698.            (integer)    @TRUE if a window was found to zoom;
  8699.                         @FALSE if no windows were found.
  8700.  
  8701.          Use this function to "zoom" windows to full screen size.
  8702.  
  8703.          A partial-windowname of "" (null string) zooms the current WinBatch
  8704.          window.
  8705.  
  8706.          Example:
  8707.  
  8708.            Run("notepad.exe", "")
  8709.            WinZoom("Notepad")
  8710.            Delay(3)
  8711.            WinShow("Notepad")
  8712.  
  8713.          See Also:
  8714.  
  8715.            WinHide, WinIconize, WinPlace, WinShow
  8716.  
  8717.  
  8718.  
  8719.                                          Yield
  8720.  
  8721.          Provides time for other windows to do processing.
  8722.  
  8723.          Syntax:
  8724.  
  8725.            Yield
  8726.  
  8727.          Use this command to give other running windows time to process.  This
  8728.          command will allow each open window to process 20 or more messages.
  8729.  
  8730.  
  8731.                                                                             150
  8732.  
  8733.                                                          WBL FUNCTION REFERENCE
  8734.  
  8735.  
  8736.          Example:
  8737.  
  8738.            ; run Excel and give it some time to start up
  8739.            sheet = AskLine ("Excel", "File to run:", "")
  8740.            Run("excel.exe", sheet)
  8741.            Yield
  8742.            Yield
  8743.            Yield
  8744.  
  8745.          See Also:
  8746.  
  8747.            Delay
  8748.  
  8749.  
  8750.  
  8751.  
  8752.  
  8753.  
  8754.  
  8755.  
  8756.  
  8757.  
  8758.  
  8759.  
  8760.  
  8761.  
  8762.  
  8763.  
  8764.  
  8765.  
  8766.  
  8767.  
  8768.  
  8769.  
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.  
  8776.  
  8777.  
  8778.  
  8779.  
  8780.  
  8781.  
  8782.  
  8783.  
  8784.  
  8785.  
  8786.                                                                             151
  8787.  
  8788.                                              APPENDIX A    Predefined Constants
  8789.  
  8790.  
  8791.  
  8792.                                        APPENDIX A
  8793.  
  8794.                                   Predefined Constants
  8795.  
  8796.          WBL provides you with a number of predefined integer constants to help
  8797.          make your batch files more mnemonic:
  8798.  
  8799.          Logical Conditions                   String Handling
  8800.  
  8801.          @FALSE                               @FWDSCAN
  8802.          @NO                                  @BACKSCAN
  8803.          @OFF
  8804.          @TRUE                                System Control
  8805.          @YES
  8806.          @ON                                  @MAJOR
  8807.                                               @MINOR
  8808.          Window Arranging                     Error Handling
  8809.  
  8810.          @NORESIZE                            @CANCEL
  8811.          @ABOVEICONS                          @NOTIFY
  8812.          @STACK                               @OFF
  8813.          @ARRANGE
  8814.          @TITLE                               Keyboard Status
  8815.          @ROWS
  8816.          @COLUMNS                             @SHIFT
  8817.                                               @CTRL
  8818.                                               Debug Control
  8819.  
  8820.                                               @PARSEONLY
  8821.  
  8822.  
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.  
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.  
  8836.  
  8837.  
  8838.  
  8839.  
  8840.  
  8841.                                                                             152
  8842.  
  8843.                                                            APPENDIX B    Errors
  8844.  
  8845.  
  8846.  
  8847.                                        APPENDIX B
  8848.  
  8849.                                          Errors
  8850.  
  8851.          If the current error mode is @CANCEL (the default), any WBL errors
  8852.          encountered while processing a batch file cause the item to be
  8853.          canceled with an error message.
  8854.  
  8855.  
  8856.  
  8857.                                       Minor Errors
  8858.  
  8859.          Minor errors are ignored if the current error mode has been set to
  8860.          @OFF.  If the error mode is @NOTIFY the user has the option of
  8861.          continuing with the batch file or canceling it.
  8862.  
  8863.          1006 File Copy/Move: No matching files found
  8864.          1017 File Delete: No matching files found
  8865.          1018 File Delete: Delete Failed
  8866.          1024 File Rename: No matching files found
  8867.          1025 File Rename: Rename failed
  8868.          1028 LogDisk: Requested drive not online
  8869.          1029 DirMake: Dir not created
  8870.          1030 DirRemove: Dir not removed
  8871.          1031 DirChange: Dir not found/changed
  8872.          1039 WinClose: Window not found
  8873.          1040 WinHide: Window not found
  8874.          1041 WinIconize: Window not found
  8875.          1042 WinZoom: Window not found
  8876.          1043 WinShow: Window not found
  8877.          1044 WinPlace: Window not found
  8878.          1045 WinActivate: Window not found
  8879.          1119 WinPosition: Window not found
  8880.          1121 WinTitle: Window not found
  8881.          1100 StrIndex/StrScan 3rd parameter out of bounds
  8882.  
  8883.  
  8884.  
  8885.  
  8886.  
  8887.  
  8888.  
  8889.  
  8890.  
  8891.  
  8892.  
  8893.  
  8894.  
  8895.  
  8896.                                                                             153
  8897.  
  8898.                                                            APPENDIX B    Errors
  8899.  
  8900.  
  8901.          1900 WinExec 0: Out of Memory
  8902.          1902 WinExec 2: File Not Found
  8903.          1903 WinExec 3: Path Not Found
  8904.          1905 WinExec 5: Attempt to dynlink to a task
  8905.          1906 WinExec 6: Lib requires data segs for each task
  8906.          1910 WinExec 10: Incorrect Windows Version
  8907.          1911 WinExec 11: Invalid EXE file
  8908.          1912 WinExec 12: Cannot run OS/2 application
  8909.          1913 WinExec 12: Cannot run DOS4.0 application
  8910.          1914 WinExec 14: Unknown EXE type
  8911.          1915 WinExec 15: Attempt to run old EXE in protect mode
  8912.          1916 WinExec 16: Attempted 2nd EXE with multiple writeable datasegs
  8913.          1917 WinExec 17: Nonshareable DLLs already in use
  8914.          1918 WinExec 18: App marked for protected mode only
  8915.          1932 WinExec: Undefined Error
  8916.  
  8917.  
  8918.  
  8919.                                     Moderate Errors
  8920.  
  8921.          If the error mode is @NOTIFY or @OFF, the user has the option of
  8922.          continuing with the batch file or canceling it.
  8923.  
  8924.          2001 SendKey: Illegal Parameters
  8925.          2002 File Copy/Move: 'From' file illegal
  8926.          2003 File Copy/Move: 'To'   file illegal
  8927.          2004 File Copy/Move: Cannot copy/move wildcards into fixed root
  8928.          2005 File Copy/Move: Cannot copy/move wildcards into fixed extension
  8929.          2007 File Move: Unable to rename source file
  8930.          2015 File Move:  Unable to remove source file
  8931.          2016 File Delete: File name illegal
  8932.          2019 File Rename: 'From' file illegal
  8933.          2020 File Rename: 'To' file illegal
  8934.          2021 File Rename: Attempt to rename across drive boundary. - Use MOVE
  8935.               instead.
  8936.          2022 File Rename: Cannot rename wildcards into a fixed filename root
  8937.          2023 File Rename: Cannot rename wildcards into a fixed filename
  8938.               extension
  8939.          2038 WinCloseNot Function Syntax error
  8940.          2045 WinActivate: Window not found
  8941.          2058 StrCat function syntax error
  8942.          2060 Average function syntax error
  8943.  
  8944.  
  8945.  
  8946.  
  8947.  
  8948.  
  8949.  
  8950.  
  8951.                                                                             154
  8952.  
  8953.                                                            APPENDIX B    Errors
  8954.  
  8955.  
  8956.          2093 Dialog Box: Bad Filespec, using *.*
  8957.          2112 FileSize: File Not Found
  8958.          2118 FileCopy/Move: Destination file same as source
  8959.  
  8960.  
  8961.  
  8962.                                       Fatal Errors
  8963.  
  8964.          Fatal errors cause the current batch file to be canceled with an error
  8965.          message, regardless of the error mode in effect.  (We show the error
  8966.          codes here for consistency, but in practice you will never be able to
  8967.          call LastError after a fatal error.)
  8968.  
  8969.          3008 File Copy/Move: 'From' file open error
  8970.          3009 SendKey: Could not open DEBUG text file
  8971.          3010 SendKey: Could not install hook - Already Active??
  8972.          3011 File Copy/Move: 'From' file length error
  8973.          3012 File Copy/Move: No room left on disk.  Out of space??
  8974.          3013 File Copy/Move: 'To' file open error
  8975.          3014 File Copy/Move: I/O Error
  8976.          3015 File Move:  Unable to remove source file
  8977.          3026 LogDisk: Illegal disk drive
  8978.          3027 LogDisk: DOS reports no disks!!  ???
  8979.          3032 GoTo unable to lock memory for batch file
  8980.          3033 GoTo label not found
  8981.          3034 Clipboard owned by another app.  Cannot open.
  8982.          3035 Clipboard does not contain text for ClipAppend.
  8983.          3036 Clipboard cannot hold that much text (>64000 bytes)
  8984.          3037 Unable to allocate memory for clipboard.  Close some applications
  8985.          3046 Internal Error 3046. Function not defined
  8986.          3047 Variable name over 30 chars. Too Long
  8987.          3048 Substitution %Variable% not followed by % (Use %% for %)
  8988.          3049 No variables exist??!!
  8989.          3050 Undefined variable
  8990.          3051 Undefined variable or function
  8991.          3052 Uninitialized variable or undefined function
  8992.          3053 Character string too long (>256 chars??)
  8993.          3054 Unrecognizable item found on line
  8994.          3055 Variable name is over 30 chars. Too Long
  8995.          3056 Variable could not be converted to string
  8996.          3057 Variable could not be converted to integer
  8997.          3059 Illegal Bounds for StrSub function
  8998.          3061 Illegal Syntax
  8999.          3062 Attempt to divide by zero
  9000.          3063 Internal Error 3063. Binary op not found
  9001.          3064 Internal Error 3064. Unary op not found
  9002.          3065 Unbalanced Parenthesis
  9003.          3066 Wrong Number of Arguments in Function
  9004.  
  9005.  
  9006.                                                                             155
  9007.  
  9008.                                                            APPENDIX B    Errors
  9009.  
  9010.  
  9011.          3067 Function Syntax. Opening parenthesis missing.
  9012.          3068 Function Syntax. Illegal delimiter found.
  9013.          3069 Illegal assignment statement. (Use == for equality testing)
  9014.          3070 Internal error 3070.  Too many arguments defined.
  9015.          3071 Missing or incomplete statement
  9016.          3072 THEN not found in IF statement
  9017.          3073 Goto Label not specified
  9018.          3074 Expression continues past expected end.
  9019.          3075 Call: Parse of file/parameter line failed
  9020.          3076 FileOpen: READ or WRITE not properly specified
  9021.          3077 FileOpen: Open failed
  9022.          3078 FileOpen: Too many (>5) files open
  9023.          3079 FileClose: Invalid file handle
  9024.          3080 FileClose: File not currently open
  9025.          3081 FileRead: Invalid file handle
  9026.          3082 FileRead: File not currently open
  9027.          3084 FileWrite: Invalid file handle
  9028.          3085 FileWrite: File not currently open
  9029.          3087 FileRead:  File not open for reading
  9030.          3088 FileRead: Attempt to read past end of file
  9031.          3089 FileWrite: File not open for writing
  9032.          3090 Dialog Box: File open error
  9033.          3091 Dialog Box: Box too large
  9034.          3092 Dialog Box: Non-text control used w/filebox.
  9035.          3094 Dialog Box: Window Registration Failed
  9036.          3095 Compare could not be resolved into a integer or string compare
  9037.          3096 Memory allocation failure.  Out of memory for string storage
  9038.          3097 Memory allocation failure.  Out of memory for variable storage
  9039.          3098 Internal error, NULL pointer passed to xstrxxx subroutines
  9040.          3099 CallExt function disabled.  Not currently available.
  9041.          3101 Substituted line too long. (> 256 characters)
  9042.          3102 Drop: Can only drop variables
  9043.          3103 IsDefined: Attempting to test non-variables item
  9044.          3104 Dialog Box: Window Creation Failed
  9045.          3105 Batch Compiler:  CALL and CALLEXT not supported in compiled EXE
  9046.               versions
  9047.          3107 Run: Filetype is not COM, EXE, PIF or BAT
  9048.          3108 FileItemize: Unable to lock file info segment
  9049.          3109 FileItemize: Unable to unlock file info segment
  9050.          3110 FileItemize: Unable to lock file index segment
  9051.          3111 FileItemize: Unable to unlock file index segment
  9052.          3113 FileSize: Filelength I/O Error
  9053.          3114 FileSize: Buffer Overrun Error
  9054.          3115 FileDelete: Buffer Overrun Error
  9055.          3116 FileRename: Buffer Overrun Error
  9056.          3117 FileCopyMove: Buffer Overrun Error
  9057.  
  9058.  
  9059.  
  9060.  
  9061.                                                                             156
  9062.  
  9063.                                                                           Index
  9064.  
  9065.  
  9066.  
  9067.                                          Index
  9068.  
  9069.                                               Display  13,51,81
  9070.          A                                    DOSVersion  59,81-82
  9071.                                               Drop  59,81-83
  9072.          Abs  58,63
  9073.          AskLine  14,51,63-64                 E
  9074.          AskYesNo  14,51,64-65
  9075.          Average  58,65                       EndSession  19,59,83
  9076.                                               Environment  28,59,83-84
  9077.          B                                    ErrorMode  21,59,84-85
  9078.                                               Errors  49-51,152-157
  9079.          batch files                            fatal  155-157
  9080.           error handling  49-51                 minor  153-154
  9081.           statement summary  51-61              moderate  154-155
  9082.           statements  61-151                    see also   Debug, ErrorMode,
  9083.           WBL language components  44-49        LastError
  9084.          Beep  14,51                          Exclusive  59,86-87
  9085.                                               Execute  59,85-86
  9086.          C                                    Exit  59,86
  9087.  
  9088.          Call  58,66-67                       F
  9089.          CallExt  59,67-68
  9090.          Char2Num  56,66-69                   File Management  19
  9091.          ClipAppend  58,69-70                   in WBL  52-53
  9092.          ClipGet  58,70                       FileAppend  52,87-88
  9093.          ClipPut  58,70-71                    FileClose  52,88-89
  9094.          Command Line  49-50                  FileCopy  20,52,86-90
  9095.          Comments  47-48                      FileDelete  20,52,90
  9096.          Constants  44-45                     FileExist  20,52,90-91
  9097.           predefined  45                      FileExtension  52,91-92
  9098.                                               FileItemize  23,52,91-93
  9099.          D                                    FileLocate  52,93-94
  9100.                                               FileMove  52,94-95
  9101.          DateTime  59,71-72                   FileOpen  52,95-96
  9102.          Debug  59,72-73                      FilePath  53,96
  9103.          Delay  15,59,73-74                   FileRead  53,96-97
  9104.          DialogBox  31-38,51,74-75            FileRename  20,53,95-98
  9105.          DirChange  19,53,74-76               FileRoot  53,98
  9106.          Directory Management                 FileSize  53,98-99
  9107.           in WBL  53-54                       FileWrite  53,99-100
  9108.          DirGet  19,54,76-77
  9109.          DirHome  54,77                       G
  9110.          DirItemize  24,54,77-78
  9111.          DirMake  54,78-79                    Goto  10,60,100-101
  9112.          DirRemove  54,79
  9113.          DirRename  54,79-80                  I
  9114.          DiskFree  54,79-81
  9115.  
  9116.                                                                             157
  9117.  
  9118.  
  9119.                                                                           Index
  9120.  
  9121.          Identifiers  45                        command-line  49-50
  9122.          If ... Then  8,60,101                  function  49
  9123.          IgnoreInput  60,101-102              ParseData  56,114-115
  9124.          IniRead  53,99-103                   Pause  13,52,114-116
  9125.          IniReadPvt  53,103-104
  9126.          IniWrite  53,103-104                 R
  9127.          IniWritePvt  53,104-105
  9128.          IsDefined  60,104-106                Random  58,116-117
  9129.          IsKeyDown  60,106                    Registration  159-161
  9130.          IsLicensed  60,106-107               Return  60,117
  9131.          IsNumber  56,106-108                 Run  12,56,117-118
  9132.          ItemCount  51,108                    RunHide  56,118-119
  9133.          ItemExtract  51,108-109              RunIcon  13,56,119-120
  9134.          ItemSelect  24,51,109-110            Running programs  12
  9135.                                                 DOS programs  28
  9136.          K                                      in WBL  56
  9137.                                               RunZoom  12,56,120-121
  9138.          Keywords  46
  9139.                                               S
  9140.          L
  9141.                                               Sample WBT file  30
  9142.          LastError  60,108-111                SendKey  29,60,121-123
  9143.          LogDisk  54,111-112                  SKDebug  60,123-124
  9144.                                               Statements  48
  9145.          M                                      reference  61-151
  9146.                                               StrCat  27,57,121-125
  9147.          Max  58,112                          StrCmp  57,125-126
  9148.          Message  13,51,112-113               StrFill  57,126-127
  9149.          Microsoft Windows                    StrFix  57,127
  9150.           date & time formatting  72          StriCmp  57,127-128
  9151.           determining the version             StrIndex  57,128-129
  9152.           61,148-149                          StrLen  57,129-130
  9153.           ending the session  83              StrLower  57,130
  9154.          Min  58,113-114                      StrReplace  57,130-131
  9155.                                               StrScan  57,130-132
  9156.          N                                    StrSub  57,132-133
  9157.                                               StrTrim  57,133-134
  9158.          Num2Char  26,56,113-114              StrUpper  58,134
  9159.                                               Substitution  48-49
  9160.          O                                      and StrCat  121-125
  9161.  
  9162.          Operators  46-47                     T
  9163.           Precedence  47
  9164.                                               TextBox  51,134-135
  9165.          P
  9166.                                               V
  9167.          Parameters
  9168.  
  9169.                                                                             158
  9170.  
  9171.  
  9172.                                                                           Index
  9173.  
  9174.          Variables  7,45-46
  9175.          Version  60,135-136
  9176.  
  9177.          W
  9178.  
  9179.          WallPaper  60,136
  9180.          WinActivate  16,54,136-137
  9181.          WinArrange  54,137-138
  9182.          WinClose  16,55,138-139
  9183.          WinCloseNot  17,55,139
  9184.          WinConfig  55,139-140
  9185.          Window Management  15
  9186.           in WBL  54-56
  9187.          WinExist  17,55,140-141
  9188.          WinGetActive  55,139-142
  9189.          WinHide  55,142
  9190.          WinIconize  15,55,142-143
  9191.          WININFO  145
  9192.          WinItemize  55,143-144
  9193.          WinMacro  39-43
  9194.          WinPlace  55,144-145
  9195.          WinPosition  55,145-146
  9196.          WinShow  15,55,145-147
  9197.          WinTitle  55,147-148
  9198.          WinVersion  61,148-149
  9199.          WinWaitClose  17,56,149-150
  9200.          WinZoom  15,56,150
  9201.  
  9202.          Y
  9203.  
  9204.          Yield  61,150-151
  9205.  
  9206.  
  9207.  
  9208.  
  9209.  
  9210.  
  9211.  
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.                                                                             159
  9223.  
  9224.  
  9225.  
  9226.  
  9227.                            I want my OWN copy of WinBatch!
  9228.  
  9229.                                   Please send it to:
  9230.  
  9231.  
  9232.          Company: _____________________________________________________________
  9233.  
  9234.             Name: _____________________________________________________________
  9235.  
  9236.          Address: _____________________________________________________________
  9237.  
  9238.             City: _______________________________ State: ________ Zip: ________
  9239.  
  9240.  
  9241.            Phone: (_____)___________________  Country: ________________________
  9242.  
  9243.  
  9244.                         ____WinBatch(es) at $69.95 ea.: _________.___
  9245.  
  9246.          Foreign air shipping (except Canada) at $9.50: _________.___
  9247.  
  9248.                                                  Total: _________.___
  9249.  
  9250.          Disk Size (circle one):     5.25" okay     3.5" required
  9251.  
  9252.          Please enclose a check payable to Wilson WindowWare, Inc.; or you may
  9253.          use Visa, Master Card, EuroCard, or American Express.  For charge
  9254.          cards, please enter the information below:
  9255.  
  9256.          Card number:   __ __ __ __-__ __ __ __-__ __ __ __-__ __ __ __
  9257.  
  9258.          Expiration date: _______/______
  9259.  
  9260.          Signature:_________________________________________________________
  9261.  
  9262.  
  9263.               Send to:  Wilson WindowWare
  9264.                         2701 California Ave SW #212
  9265.                         Seattle, WA 98116
  9266.                         USA
  9267.  
  9268.               or call:  (800) 762-8383
  9269.                         (206) 935-7129  (fax)
  9270.  
  9271.                         (Please allow 1 to 2 weeks for delivery)
  9272.