[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

1963.0. "Scripts" by GILBRT::BEAUREGARD (read manual as a last resort) Wed Dec 07 1988 11:34

    Ok, this week I've been playing around with scripts. Since I'm
    primarily a shell type user, I would like to make life easier
    with some custom commands. 
     I would like to write a script that sends files to the printer
    (I know about printfiles) but have it inquire about the desired
    printer setup. (font, perf skip, lpp h/v tabs, etc). There is
    the "ASK" command, but that only wants y/n for answers. There is
    also the .Key parameter assignment statement, but then I would
    have to memorize all the parameters to input and the command line
    would be large. What I'm looking for is the equivalent of the VMS
    inquire statement. Is there such a beast?
    
    
    Roger
    
    
T.RTitleUserPersonal
Name
DateLines
1963.1a handy thing...WAV14::HICKSFan mail from some flounder?Wed Dec 07 1988 13:244
    Hey, I've searched for a long time for just such a thing.  Haven't
    found it.  It would make scripts one heck-of-a-lot more powerful!
    
    <<Tim>>
1963.2Might I suggest......POLAR::GOSLINGThink KANATA INC.Wed Dec 07 1988 13:4915
       Not meaning to sound flippant, but AREXX (by William Hawes of
       Conman fame) could accommodate your need quite handily - along with
       just about anything else you would like to do with scripts.  There
       have been a couple of articles on AREXX lately - see V1/I3 of
       AMIGA Transactor, and AMIGA World of a couple of months ago.  If
       you are not aware of the features, strengths, and potential of
       this product you may want to look these articles over.
       
                  CAVEAT - ain't there always at least one :-)
       
       AREXX isn't free!  It's a commercial product so you have to buy
       it.  I personally have found the investment well worth it.
       
       Art
       
1963.3 It's at WJG::AMIGA:SHELL.ARC It's the C source code. I will download it and compile it then post the executable as well. John WJG::GUINEAUWed Dec 07 1988 14:269
The SHELL by Matt Dillon/Steve Drew I just posted does this and more.

It's at WJG::AMIGA:SHELL.ARC

It's the C source code. I will download it and compile it then post the
executable as well.


John
1963.4script terminationGILBRT::BEAUREGARDread manual as a last resortMon Dec 19 1988 12:1839
    well, I've decided to stay with a vanilla Amiga Dos Shell environment
    and try to write/run any scripts with the existing limitations.
    I wrote the following script to make life a little easier using
    the CLI. It works fine with the exception of causing the Drive XX
    is write protected requestor to appear if the drive I'm on is write
    protected. Why is this script causing the write protect requestor
    in the first place??
    
    
    .key directory
    if <directory> eq ""
       skip listdir
    endif
    if exists <directory>
       cd <directory>
       skip end
    endif      
    echo " "
    echo " can't find directory "
    echo " "
    lab listdir
    echo " "
    echo " possible choices are "
    echo " "
    dir opt d
    lab end
    
    The script will list possible directories if no argument is provided,
    and if a non-existent directory is given, I will get the "can't
    find directory" message and then the list. If a proper directory
    is given, then I will be CD'd to it. The requestor seem to be appearing
    after the completion of the script. Did I terminate the script
    incorrectly?
    
    
    Roger
    
    
    
1963.5Just a guess...VTHRAX::KIPMon Dec 19 1988 13:044
    Could it be due to the fact that you're using an argument, therefore
    EXECUTE is trying to create a T: directory for a temporary file
    in your current directory?  I don't think this explains why you
    would get the requester near the end of the script, though.
1963.6fixed but not forgottenGILBRT::BEAUREGARDread manual as a last resortWed Dec 21 1988 16:1912
    well, it appears that -1 is correct. I added a makedir and assign
    t: to ram:t in my startup-sequence and the script no longer causes 
    the write protect requestor to appear on disks that are write
    protected. I'm still confused as to why the requestor comes after
    completion of the script. I'm not executing the script via the execute
    command but rather I set the "S" field in the protection mask.
    Apparently, this executes the script thru some other mechanism?
    
    
    Roger
    
    
1963.7Same differenceFSDEV1::JBERNARDWed Dec 21 1988 18:123
    Using the "S" bit or Script bit actually invokes Execute without
    having to type > Execute filename.