Path: utzoo!attcan!uunet!convex!killer!tness7!bellcore!clyde!watmath!watdcsu!discat From: discat@watdcsu.waterloo.edu (G. Strachan Elec. Eng.) Newsgroups: comp.sys.amiga Subject: Re: FULLY INTERACTIVE SCRIPTS (A Tutorial) Summary: AmigaDos does have interactive scripts Message-ID: <4697@watdcsu.waterloo.edu> Date: 15 May 88 03:01:55 GMT References: <8922@oberon.USC.EDU> <9927@agate.BERKELEY.EDU> Reply-To: discat@watdcsu.waterloo.edu (G. Strachan Elec. Eng.) Organization: U. of Waterloo, Ontario Lines: 58 In article <9927@agate.BERKELEY.EDU> pete@violet.berkeley.edu.UUCP (Pete Goodeve) writes: > > >[Marco Papa writes (in <8922@oberon.USC.EDU>) about his program "getline" >to be used with XICON...] > >Yeah!! Many thanks, Marco! I've been meaning to to write a "stupid little >program" like that since I first wrote xicon, but somehow I never got to >it. As usual, the first person who REALLY needs it is the one who has >to write it... > >Anyhow, it nicely fills the "Interaction Void" in that area. I have never posted to the net before so I hope I am doing everything correct... A while back I discovered that you can in fact create interactive scripts from the CLI without the need for little programs to print the message and read in the input etc. I figured that it was fairly obvious and everyone else knew it too. Now I am not so sure because people still seem to use these input programs. If this is obvious I apologize. Anyway here is how it works. Ever wondered why Amigados scripts require you to specify the number and name of arguments the script needs? It needs this so the Execute program can tell the user what the required parameters are if he asks with the '?' command. Now once the Execute has printed out the required parameters it reads from standard input to get the parameters. So this can be used to build an interactive script. For example here is my startup sequence script. path sys:system add path sys:utilities add path sys:my_commands add BindDrivers mount pipe: Execute sys:s/loader ? where the script file loader is: .key "Load WorkBench (y/n)" if eq "y" LoadWb endcli >nil: else echo "Workbench not loaded" shell s:.login endif When the Amiga starts up it will print out the "Load Workbench (y/n)" prompt on the screen. If I type in y it will load the workbench any other responce and it will not. This method has the advantage over writing a simple program to get the input in that it is faster (no program to load) and is much more flexable. The disadvantage is that only one input can be obtained per script. If you need more than one responce from the user then you have to put it in different scripts. Hope this helps some people Gordon Strachan