[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

2442.0. "Help with CLI ASK Command needed..." by NZOV01::MCKENZIE (Support your right to arm bears) Wed Apr 05 1989 17:27

    Can someone please explain how to use the ASK command from CLI
    
    According to the a500 manual ASK "text" will accept a one
    charcter symbol being either Y for yes or N for No (I think thats
    what it said...?)
    
    what I want to know is how I can set up a routine to action either
    choice within a startup-sequence file
    
    eg:
    
    Ask "Autoload Database (Y/N)"

    if ???? eq "Y" then
    ....
    ,,,,
    mmmm
    end if
    
    if ???? eq "N" then
    ....
    end if

    Can someone please give me an example that WORKS?? Ive just about
    run out of ideas.....
    
    
T.RTitleUserPersonal
Name
DateLines
2442.1 If you ask me... CRISTA::CAPRICCIOAm I getting enough Oat Bran?Thu Apr 06 1989 00:4524
    The ASK command sets the condition flag depending on the response received.
    A "Y" sets the flag to a 5 (WARN) and a "N" (or a RETURN) sets the flag to
    zero. You can then use the IF command to determine the flow of the script
    file. Here's an example that works (providing that FAILAT > 5):


                      ask "Autoload Database (Y/N)"
                      if Warn then
                         echo "Loading Database"
                         ; put the command(s) you want to be
                         ; executed on a true (Y) condition here
                      else
                         echo "Database must be loaded manually"
                         ; put the command(s) you want to be
                         ; executed on a false (N) condition here
                      endif

    This is a pretty basic example and there are plenty of variations on this
    idea. BTW, ask is not case sensitive, and will even accept responses that
    begin with either Y or N. If it doesn't like your response it prompts you
    again.

    Pete
2442.2greate - thanks!NZOV01::MCKENZIESupport your right to arm bearsThu Apr 06 1989 00:503
    Thanks Heaps Pete - your a lifesaver...
    
    Phil_whos_trying_to_meet_a_deadline_with_this_stuff