






                             

                                    CHOOSER

                                      v4.4

                                 4th March 1992

                             (c) Anthony J. Clarke

                             

















 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke



                               Table of Contents


        DESCRIPTION......................................................  1
        CONFIGURATION FILE...............................................  2
           CREATING STANDALONE EXE FILES.................................  5
           ADVANCED USE OF CHOOSER.......................................  6
        EXAMPLE PROGRAM USAGE............................................  8
           SLMR/OLX......................................................  8
           QUOTE OF THE DAY..............................................  8
           BATCH MESSAGE SYSTEM..........................................  9
        CREDITS/COMMENTS................................................. 11
           OTHER AVAILABLE UTILITIES..................................... 11
              CRYPTIC1  (CRYPTIC1.ZIP)................................... 11
              POOLS1  (POOLS1.ZIP)....................................... 11
        REGISTRATION..................................................... 12
           CONTACTING THE AUTHOR......................................... 12





































                                     i

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke



     Description
     

      Output   to   STDOUT   a   random   signature  (string)  from  the
      configuration file CHOOSER.FIL (Default - but  can  be  changed  -
      See Usage).    Its  primary use is to make messages generated from
      my offline mail reader a little more varied by choosing  a  random
      signature,  but  it  can  be  put to many more varied uses, like a
      Message quoter to place in your AUTOEXEC.BAT ?

      CHOOSER.FIL must exist in  the  PATH  or  in  the  directory  that
      CHOOSER.EXE  is called, otherwise the CHOOSER Environment variable
      must be used.

      CHOOSER works by allocating  an  array  in  memory  based  on  the
      number  of  signatures (-nXXX command line option) and the size of
      each signature (-zYYY command line option), there are  also  three
      automatic  modes - 'S'mall/'M'edium/'L'arge (-s -m -l command line
      options) which sets three run-time sizes  of  CHOOSER.    For  the
      exact specification  on each size see the Usage section.  Then the
      configuration file is read into  memory  and  a  random  selection
      chosen and  output to STDOUT.  There are options to allow specific
      selection to be displayed, say for Error Message handling in  .BAT
      files (as an example).

      Because  CHOOSER works by reading the array into memory first, its
      speed  of  operation  can  be  vastly  enhanced  by  placing   the
      Signature file on a Ram/Virtual Disk.

      The maximum size of each signature is dependant on the ammount  of
      memory  - if you plan to run SIG from a 'Shelled' DOS window then,
      depending on the number of signature selections in your  signature
      file,  try  the  Small/Medium/Large options first then if you need
      to fine tune the memory usage right down to  the  'n'th  byte  use
      the manual  -nXXX  and  -zYYY  options.   Use the -i option to get
      statistics on the memory used and choices available.

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                                     Page   1

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


     Configuration File
     

      Format for Signature file is -

      Control   characters   are  :-  [Header-End],  [Footer-End]  and
      [Quote-End], These must exist as the start of the line.

      The configuration allows a Header string  followed  by  a  quote
      and then  a  Footer string.  Obviously, at a minimum a number of
      Quotes are required in  the  configuration  file.    However  by
      adding  a  string,  followed  by [Header-End], it will be output
      before a randomly selected Quote.  And as you would expect if  a
      Footer string is found this would be output after the Quote.

      Headers  and Footer strings have a maximum size of 256 bytes (ie
      3 full lines.)

      As  a   rule   format   your   string,   be   them   quotes   or
      headers/footers,  using a text editor (or EDLIN if you must!) as
      you want the quote to appear on the screen,  do  not  allow  for
      any  line  wrap, only 80 characters per line are read in and the
      rest truncated.

      Some examples of configuration files follow -

            Eg 1.            Eg 2.              Eg 3.

          --------------- Example of Signature File ---------------
            Regards,         Bye Bye!         This preceeds the Quote
            [Header-End]                      [Header-End]
            Anthony 1        [Footer-End]     This follows the Quote
            [Quote-End]      Hello! 1         [Footer-End]
            Anthony 2        [Quote-End]      Anthony J. Clarke
            [Quote-End]      Hello! 2         [Quote-End]
            Anthony 3        [Quote-End]      A.j.Clarke
            [Quote-End]                       [Quote-End]
          ---------------------- END of File ----------------------

Usage


      CHOOSER -i -nX -zY -s -m -l -tZ -a -h -b -d -y -fFILENAME
              (Case is ignored)

      Where,                                              Memory Usage
                                                          
      -s  = SMALL size operation
            Maximum number of Signatures = 50                 35k
            Signature size = 256 bytes

      -m  = MEDIUM size operation
            Maximum number of Signatures = 256                200k
            Signature size = 512 bytes

                                                                     Page   2

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke



      -l  = LARGE size operation
            Maximum number of Signatures = 512                400k
            Signature size = 768 bytes

      -nX = Set 'X' Maximum number of Signatures

      -zY = Set 'Y' Maximum number of Signatures

      -tZ = Manually select number Z - only a max is checked for so beware.

      -a  = Author information

-? or -h  = Help Screen

      -b  = Create Stand-alone exeutable file containing current Signatures.
            Will be names RUNME.EXE unless a filename is specified with the
            -f option.

-fFILENAME = Filename for standalone EXE File.

      -d  = Create diagnostic dump file CHOOSER.DMP

      -y  = Force 'yes' in answer to ovewrite EXE generated file

      -i  = Program/Status information e.g.

            Environment variable 'CHOOSER' used   : No
            Signature data file currently active  : 'C:\CHOOSER\CHOOSER.FIL'
            Header line used : Yes, Footer line used : Yes
            Number of Signatures to choose from   : 33
            Largest Signature was number     1, size  2000 bytes.
            Model in use         : None.
            Number of Signatures : 256, size 512 bytes (Default)
            Memory after allocating Signature array  : 238512 bytes

      The  Signature  file  can be change from the default by the use of
      the environment variable CHOOSER, for example if you want to  keep
      your  signatures  in  a  file  CHS_FILE.001  then  you  would  SET
      CHOOSER=C:\SIG\CHS_FILE.001 and in which case the  result  of  the
      -i  option  would  confirm  its use and give statistics on the new
      signature file (ie Number of signatures and whether a  quote  line
      is being used), also this shows use of the Small model -

      Environment variable 'CHOOSER' used   : No
      Signature data file currently active  : 'C:\CHOOSER\CHS_FILE.001'
      Number of Signatures to choose from   : 33
      Largest Signature was number     1, size  2000 bytes.

      Header line used : Yes, Footer line used : Yes
      Model in use         : None.
      Number of Signatures : 50, size 256 bytes (Modified)
      Memory after allocating Signature array  : 360080 bytes


                                                                     Page   3

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


      An extract example of my CHOOSER.FIL is as follows -

             Ŀ
             Regards,              < Header Line used.
                                  
             [Header-End]          < End of Quote, Start of 1st
             ͻ     ɻ                  Signature.
             ͹ɻ̻ȼɻȹ       
                ͼ       
             [Quote-End]           < End of Signature.
             ɻ     ַ ȹ         
             ַ̹̻ӽַ         
              Ľ         
             [Quote-End]          
             ɻ       ͹         
             ַַַ̹̻         
              ӽĽ         
             [Quote-End]          
             y ck       
             [Quote-End]          
             hn rk       
             [Quote-End]          
             

      and an extract of the program information would show -

             Environment variable 'CHOOSER' used   : Yes
             Signature data file currently active  : 'C:\PE\CHOOSER.FIL'
             Number of Signatures to choose from   : 6
             Header line used : Yes, Footer line used : No

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                                     Page   4

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


     Creating standalone EXE files
     

      CHOOSER  has  the  ability to create standalone files that contain
      the currently configured Signature information.

      By default the name used is RUNME.EXE unless a filename is  passed
      on the command line with the -f option.

      As  a  guide as to how to use this option I would suggest tweaking
      CHOOSER so that it contains all the signatures as  if  running  in
      default mode,  then  confirm  this with the -i option.  When happy
      with this create the EXE file.

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                                     Page   5

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


     Advanced use of CHOOSER
     

      If  you  have  a  quote  file  that CHOOSER does not function with
      because of the MEMORY ALLOCATION Error then here is an example  of
      how to use the information provided from the -i option -

      The  other  reason that you may want to 'tune' chooser is thst you
      want to reduce its memory usage for when calling from a dos shell.


     Step1.


      The  environment  variable  has  been  set to point to a new file.
      Using the CHOOSER -h option ensure that CHOOSER  can  locate  this
      file.  See below -

      If  the  QUOTE.SIG  file  could  not be located then the following
      would have been displayed -


     ͻ
     Signature File in use  : QUOTE.SIG                                 
                              (** File not Found **)                    
                                                                        
     Usage  : CHOOSER -i -nX -zY -s -m -l -tZ -a -h -b -d -fFILENAME.EXE
                 (Case is ignored)                                 
     ͼ


      So after resolving this, try again  and  hopefully  the  resulting
      screen should look like this -


     ͻ
     Signature File in use  : QUOTE.SIG                                 
                                                                        
     Usage  : CHOOSER -i -nX -zY -s -m -l -tZ -a -h -b -d -fFILENAME.EXE
                 (Case is ignored)                                 
     ͼ

 
 
 
 
 
 
 
 
 
 
 
 

                                                                     Page   6

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


     Step2.

      Run CHOOSER -i and, say, the following is displayed -

     ͻ
     Program Run-time information :-                                    
                                            
                                                                        
     Environment variable 'CHOOSER' used   : Yes                        
     Signature data file currently active  : 'QUOTE.SIG'                
     Header line used : Yes, Footer line used : Yes                     
     Number of Signatures to choose from   : 106                        
  Largest Signature was number     4, size   788 bytes.              
                                                                       
    Model in use         : None.                                       
    Number of Signatures : 256, size 512 bytes (Default)               
                                                                       
  A number of signatures had to be truncated from the file of which  
   the only four are -   4, 5, 8, 45.                                 
                                                                      
   Memory after allocating Signature array  : 280416 bytes free       
   ͼ
 
    There  are a number of pieces of information that can be used from
    here -
 
 
   Firstly, there are 4 signatures that exceeded the size set by  the
     settings on  the  line  above.    Resolve  this by either manually
     changing the Signature size, using the -z  option  or  trying  the
     next model  size  up,  -l  in  this  case.
 
   This is the largest signature, up to the Maximum number  currently
      set, and  this information can be used to set the -z option.  Bear
      in mind that it would be wiser to establish  how  many  signatures
      exist in the file before 'tuning' the maximum size.

     Step3.

      Once you have set the Number and Size options, either manually  or
      by  simply  changing  the  Model  size, using this information the
      precise Number and size can be set and recorded as options  to  be
      used when called again to ensure minimum memory utilization.

 
 
 
 
 
 
 
 
 
 

                                                                     Page   7

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


     Example Program Usage
     

     SLMR/OLX
     

      The reason  CHOOSER  evolved  was  to  make  my  messages  in  the
      'Offline' BBS  world  a  little  more interesting.  This is how to
      integrate CHOOSER into your offline mailer :

      Edit  the  'Editor'  filename  to call a batch file containing the
      following :-

      set chooser=c:\pe\sig.fil       < My signature file
      chooser -s c:\pe\signat.ure     < Output to file
      c:\pe\pe.exe %1                 < Invoke Editor

      Then  using  your  editor  (mine is The pERFECT Editor, by choice)
      create a macro that will read in the contents  of  the  signat.ure
      file to your message.

      Alternatively,  you  could  have CHOOSER create a RUNtime EXE file
      with the following :-

      set chooser=c:\pe\sig.fil       < My signature file
      chooser -s -fsig_gen            < Create SIG_GEN.EXE

      then alter your batch file to :-

      sig_gen > signat.ure            < Choose random signature
      c:\pe\pe.exe %1                 < Invoke Editor

      and use as before.


     Quote of the Day
     

      Easy this!  You've seen all the places these are  used,  primarily
      in  network  logon sessions where you are greeted by the quote for
      the day, well howabout a random one, setup as follows :-

      QUOTE.BAT : SET CHOOSER=C:\Quotes.inf
                  CHOOSER

      where your quote file could look like this :-

      QUOTES.INF :  A Quote for the day -

                    [Header-End]
                    ----------------------------------------------------
                    [Footer-End]
                    FENDERBERG n.  The large glacial deposits that  form
                    on   the   insides   of   car  wheel  arches  during

                                                                     Page   8

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


                    snowstorms.
                    [Quote-End]
                    FLANNISTER n.    The  plastic  yoke  that  holds   a
                    six-pack of beer together.
                    [Quote-End]
                    FUNCH v.   The act of turning a pillow over and over
                    trying to find the cool spot.
                    [Quote-End]
                    FURBLING v.  Having to  wander  through  a  maze  of
                    ropes  at  an  airport or bank even when you are the
                    only person in line.
                    [Quote-End]

      Running QUOTE.BAT would then, for example produce the following :-

      A Quote for the day -

      FENDERBERG n.  The large glacial deposits that  form
      on   the   insides   of   car  wheel  arches  during
      snowstorms.

      ----------------------------------------------------

      Well, could you have fun with that ?   And  using  copies  of  all
      those  ESSEX  GIRLS  and  BLONDES  jokes, I certainly have a smile
      when I power my machine on!


     Batch Message System
     

      A little strange you may think but create  a  file  with,  say,  5
      error   messages   and   some  menu's/screens  ,  separated  by  a
      [Quote-End], and then with  the  -b  option  create  an  EXE  file
      called  TEXT.EXE  and  you  could have a simple message/menu/error
      system that can be called from a batch file.

      For example, create a file with the following :-

      TEXT.FIL  : Please select one of the following -       [1]
                  1 - Word Processor
                  2 - E-Mail
                  3 - Spreadsheet
                  [Quote-End]
                  1 - Wordperfect                            [2]
                  2 - Wordstar
                  [Quote-End]
                  Please select 1-3:                         [3]
                  [Quote-End]
                  Please select 1-2:                         [4]
                  [Quote-End]

       Then,


                                                                     Page   9

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


       SET CHOOSER=C:\TEXT.FIL
       CHOOSER -b -fTEXT

       Then, an example of a 'Pseudo' Batch file :-

       TEXT.BAT : TEXT -t1            < Output Initial Menu
                  TEXT -t3            < Ask for selection
                  Getkey (however you do it!)
                  IF '1' THEN GOTO WP:
                  IF '2' THEN GOTO EMAIL:
                  IF '3' THEN GOTO SS:

                  WP:
                  TEXT -t2            < Which Word Processor
                  TEXT -t4            < Ask for selection

                  etc etc etc

      Error messages could be  added  to  TEXT.FIL  so  that  you  could
      provide them as necessary.

      This  may seem a long winded way of doing this but it gives you an
      idea of how varied CHOOSER's uses may be put to.

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                                     Page  10

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


     Credits/Comments
     

      Any suggestions or comments then please write/call/email me.   How
      about a  small token of your appreciation if you use CHOOSER !  If
      you have problems then provide me with all the  details  including
      a  copy  of  your signature file on disk (preferably) and I *will*
      sort it out !

      I am always on the lookout for more ideas for little utilities  to
      write in C, so call me and let me know.

      Other of my Utilities to look out for :-


      CRYPTIC1  (CRYPTIC1.ZIP)
      

      Converts   any   ASCII/File   input   to   extended  IBM  graphics
      characters.  Have fun  with  Taglines  and  Messages  on  Bulletin
      Boards.   Configurable  data  file  with multiple options to allow
      use in Batch files.  UK Author.  (c) 1991.


      POOLS1  (POOLS1.ZIP)
      

      POOLS will provide a  range  of  random  numbers.    It  is  fully
      configurable  for  the  Base  number,  the  Range,  the  number of
      numbers per line and number of lines.  I wrote it to assist me  in
      choosing  my  numbers  for Littlewoods Pools, but I guess it could
      be used for all sorts of lotteries !

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                                     Page  11

 CHOOSER Version 4.4   March 1992                        (c) Anthony J Clarke


     Registration
     

      (This program  is  shareware.    REDISTRIBUTING  THIS  PROGRAM  AS
      INCENTIVE TO PURCHASE OR FOR PROFIT,  WITHOUT  THE  PRIOR  WRITTEN
      CONSENT OF  THE  AUTHOR  IS  STRICTLY  FORBIDDEN.   A $10.00/5.00
      registration fee is requested if you find this program of use.)

      There are reminders on the number of times that  you  use  CHOOSER
      if  you  are  running an Unregistered Copy, I cannot promise loads
      of hidden options that come with registration just removal of  the
      message  and  the  ability  to  make  use  of  Footers  from  your
      signature file.

      Go on - make a programmer  happy  contribute  a  little  and  keep
      shareware alive!


     Contacting the Author
     

      I  am happy to take any comments regarding CHOOSER or any other of
      my utilities, if you have any suggestions as to how they could  be
      enhanced  please  get  in  touch  with  me,  by  letter,  email or
      telephone.   I  guarantee   100%   replies   to   all   forms   of
      communication.


      Address :         Anthony J Clarke
                        5 Bowes-Lyon Mews,
                        Lower Dagnall Street,
                        St. Albans,
                        HERTS AL3 4PF
                        United Kingdom

      Telephone :       (0727) 837793
      Compuserve ID :   100034,1376


      Document Date : 3rd March 1992.
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                                     Page  12
