Changes from Scripit 1.10 to 1.20: This file describes all the major changes done to Scripit since version 1.10. It will refer to to other docs files if necessary. Bug Fixes: ---------- 1. #version and $version were broken. $version now reports "1.20" and #version reports 120. 2. #argcount was always off by +1. This is now fixed. 3. Some unwanted debug text was getting displayed when the GADGET command was used. 4. $args[] that were not used had random garbage in them. This made tests like IF $arg[5] on an unused user argument invalid. Now all args (from $arg[1] to $arg[9]) are cleared except for those containing valid arguments. (the same goes for #arg[]) 5. Using $window and $screen without selecting a window was dangerous. Scripit now automatically selects the active window if either no window was selected or if the currently selected window suddenly went away. 6. Major change in parser now correctly identifies and allows for null arguments. Previous version used to consider a null argument as the last argument for a command. This is now fixed. 7. XitLoadWB is now totally rewritten. The major differences between this and the older version are: a) XitLoadWB no longer loads WB itself. So, you must modify your startup sequence to become: ... XitLoadWB LoadWB ... I.E. You must have both XitLoadWB and LoadWB in your startup-sequence with XitLoadWB first. b) XitLoadWB will now not allow you to run multiple copies of itself. c) These changes should fix the 2 major problems that XitLoadWB had: 1. In some cases it would not load correctly. 2. Paths for shells or CLIs loaded from WB didn't correctly inherit the paths in the startup-sequence. d) XitLoadWB will now show a brief (1 second) window that will inform you that it has worked. This will not come up until after Workbench itself has loaded and started to display its icons. e) XitLoadWB will wait a maximum of 60 seconds for WB to load, otherwise it will complain. f) Extended error messages. 8. The KEY \n keystroke would sometimes not produce a correct 'return' in programs. This has been fixed along with the following: \n Return Key \e Enter Key (on numeric keypad) \t Tab \b Backspace \d Delete \x Escape All those had problems with some programs (notably Uedit). They are now fixed and produce the correct key code. New Features: ------------- 1. Shorthand LABEL format: To use the shorthand version of the LABEL command just use the label name and a colon. e.g.: EndlessLoop: con echo "aaaa" GOTO EndlessLoop 2. GOSUB/RETURN: GOSUB and RETURN work exactly as in BASIC. GOSUB transfers execution to a subroutine while perserving a return pointer to the next line after the GOBSUB statement. A RETURN statement picks up the last return pointer stored on the return 'stack' and continues execution there. For example: IF #a > 100 CON ECHO "WARNING: Value is too high" GOSUB Complain END Complain: CON ECHO "A = " #a RETURN You can nest upto 24 levels of GOSUBS. Scripit will abort with an error message if you pass that level. 3. New System Variables: (These all apply to the currently selected window and/or screen) #win.width The window's width. #win.height The window's height. #win.top The window's top edge. #win.left The window's left edge. #scr.width The screen's width. #scr.height The screen's height. #scr.top The screen's top edge. #scr.left The screen's left edge. #win.pen0 The window's front pen color. #win.pen1 The window's back pen color. #win.mx The x position of the mouse pointer relative to the window. #win.my The y position of the mouse pointer relative to the window. $scr.fontname The name of the current font in the screen. #scr.fontsize The point size of the current font in the screen. #win.fontsize The point size of the current font in the window. #win.x The x position of the gfx write pointer in the window. (This is the one set with GFX MOVE) #win.y The y position of the gfx write pointer in the window. #mousex The pointer x position relative to the actual monitor. #mousey The pointer y position relative to the actual monitor. $currentdir The full pathname of the current directory. The next variables are only for people that know what to do with them: #win.flags These are the window flags as per the Window structure. #scr.flags These are the screen flags as per the Screen structure. 4. New string assignment operator: ?= (Immediate resolve assignment) The ?= operator is the same as the = operator when using string variables except that the ?= operator resolves integer variable names in the string immediately. For example: $test = #date Using this $test will contain "#date". $test ?= #date Using this $test will contain the current date "19890926". (Note: this only effect assigning integer variables to string variables. String variable to string variable assign is always immediately resolved. i.e. $t = $date and $t ?= $date both result in $t containing "1989.09.26") Another note: The ?= operator makes no difference when assigning to integer variables since such assignments are always immediately resolved. (I hope this made some sense to you! :-) For example: The following will open a console window the size of the front screen: begin select active $console ?= "CON:0/0/" #scr.width "/" #scr.height "/ConsoleTitle" con open $console Note: you should always have the integer variable name as a seperate agrument. This is because Scripit has no way of telling where the variable name ends and the rest of the text begins. 5. Two new demo scripts are included. 'DL' and 'QB'. They are examples of real-life uses for Scripit. Read the scripts before trying to run them. They are well commented. 6. A new plot.script (by Brian) is also included. This one uses many of the new facilities in 1.20. 7. System variables: $result, $result2, $result3 #result, #result2, #result3 These return result integers and strings based on the success or failure of the command executed. Read 'Result Codes' in Reference.DOC for more details. The Reference.DOC file has been updated to show the results returned by each command. There are many commands that return a result. 8. GETGADGET command: This is identical to the GADGET command, except that it doesn't actually trigger or do anything to the gadget. It will just check the gadget's status and fill in the corresponding result variables as per the GADGET command's return results. 9. 'Xit' program is included. It is totally compatible with Scripit 1.20 except that it doesn't support ARexx, cannot run normal files nor compile them, and it doesn't have a file requester. (So the REQUEST command will do nothing.) Xit will only run scripts compiled by Scripit. All compiled Scripit files contain a signature. The first 4 bytes of the file are 'XIT2'. Note: Scripts compiled with the old Scripit are no longer supported. You have to recompile them with Scripit 1.20. The main (and only) advantage in using Xit is in its size. It is 20k smaller than Scripit. 10. New shorthand version of the 'EXECUTE' command: 'X'. 11. New shorthand version of the 'SHOWVARS' command: '?'. Both these 2 new shorthand versions were added for use in the interactive mode of Scripit. (i.e. when using Scripit *) 12. The EXECUTE, RUN, and RUNBACK commands now interpret any arguments added after the command and these arguments are correctly passed to the command being executed/run. For example: RUN list df0: To give null arguments to a program, just use "". e.g.: X Lister "" workbench Of course, any program name or argument that contains spaces or commas needs to be in double quotes. 13. The SCREEN MOVE and SCREEN MOVETO commands are now implemented. Check out Reference.DOC for details. 14. New Command: WB FIND. Allows you to search for a icon on the Workbench screen without actually doing anything to it. Check out Reference.DOC for details. 15. SHOWVARS now shows the result variables as well as the user arguments. It also now allows you to see specific variables. e.g.: SHOWVARS var_1 var_2 .. var_n 16. The \v and \w options in the KEY command. \v is the mouse button qualifier and allows you to simulate holding down the left, right, or even middle mouse button with any other key sequence. The \w simulates a mouse click while pressing any other qualifiers. (for example right- shift and left mouse button: \rs\lw) 17. Updated description of CON STYLE in Reference.DOC to show all possible codes. 18. The Reference.DOC file was reformatted to 78 columns. (This was requested by Brian.) 19. New command: FORMAT. This is a powerful command that allows for string and integer output text formatting based on the C language sprintf(). Look at its description in Reference.DOC. 20. Also, based on the above command, PRINTF, a new command does the same function, except that it prints to the console immediately. Another new command: PRINT, which is a shorthand form of the CON TEXT command. 21. Big change in parser now allows for string variables, integer variables and formulas to be used as arguments for _any_ command. Read 'Command Arguments' in Reference.DOC. 22. The Recorder will now automatically generate a 'SCREEN FRONT' statement after every SELECT command. 23. The Recorder now generates many comments about some SELECT commands. It also generates 3 lines at the beginning of each line with the script name and the recorder version. 24. Scripit will no longer allow you to run it in ARexx mode more than once using the same port name. 25. Small change to Lister now allows you to stop its output while it is printing to the console by hitting any key. This was not possible before. 26. AutoScript has been rewritten in order to allow for CLI arguments to be passed on to Scripit correctly when using autoexecute scripts. For example: This is a sample script called "showargs": BEGIN SHOWVARS Using AutoScript, we make it into an auto executing script in S: by the following command: AutoScript showargs s: This generates the following script as "s:showargs" : .key arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9 Scripit -w s:showargs "" "" "" "" "" "" "" "" "" ;BEGIN ;SHOWVARS The first line gets all the arguments passed to s:showargs which are then passed over to Scripit in the second line. The -w flag is used so that Scripit won't complain on unknown commands. There is only one known problem with this technique: #argcount is always 9 no matter how many arguments you provide via this method. 27. The CON TEXT, CON ECHO, PRINTF, and PRINT command now support special codes in the text passed to them: \n Return + Line feed \e Return (no line feed) \r Same as \e \t Tab \b Backspace These codes are only translated into actual returns, etc. when the string is about to be printed, so if you store such codes in a string variable, the code is stored, not the actual ASCII character. 28. You can now use the double quote character (") as part of any argument. To use it as part of the argument string, you should use the alternate double quote character: (~). For example: PRINT ~This is a "test" of using double quotes (").\n~ You will get: This is a "test" of using double quotes ("). NOTE: You can use the Scripit package (Scripit and Lister, specifically) in order to remotely control another Amiga via the serial port (or modem) Just issue a 'newcli aux:' command on the Amiga to be controlled, and then use a terminal program on the other Amiga. Use Lister to find out what screens or windows (and menus, gadgets) are on the remote Amiga, and use Scripit itself to drive the programs on the remote Amiga. If you need more details on how to do this, leave me a msg in Compuserve.