*** Welcome to The Aurora Editor version 3.0! *** (C) Copyright 1993-1996 nuText Systems All rights reserved worldwide. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file highlights the New Features available in Aurora version 3.0. There's something new for everyone in version 3! For more information, see the User's Guide, Language Reference, and Function Reference. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ New Features in Aurora version 3.0 include: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ * Directory Tree: A new interactive Directory Tree lets you visually explore your computer. Just select 'Tree' from the File menu. * Hex View/Edit Mode: Edit windows can now be displayed and edited in Hex mode. You can turn on the Hex View setting on the Set menu to split the window into normal text and the Hex View. Use the and keys to switch the editing focus between normal text and the Hex View. The Hex View will be Syntax Highlighted and marked just like your normal text! * Windows/95 long file names are now supported throughout the editor! * Tired of Uppercase filenames? Filenames throughout the editor can now be displayed Capitalized, in Lowercase, in Uppercase, or As-is. This new option can be set from Miscellaneous Options dialog box. * Color Syntax Highlighting for over 20 new languages is now provided, including Syntax Highlighting for HTML Web pages and Java! Syntax Highlighting is now automatic. No need to configure Syntax.aml for these languages - just open the file. * Real Tab Support Aurora now provides support for automatically displaying real tabs (Ascii 9) as spaces. The Margins and Tabs configuration dialog box contains new options which allow tab characters to be displayed as-is, displayed as spaces, or displayed as spaces only if found in a quick search when the file is opened (the new default). The Margins and Tabs dialog box also contains a new option 'Use Real Tabs' which configures the tabright command to enter real tabs into your text (when tabs are displayed as spaces). * Global Multi-file Search and Replace A sophisticated new global search/replace macro allows you to search for and replace strings in multiple files on disk, with optional verification. It can be started from the Macro List on the Set menu. * International Configuration A new International Options dialog box can now be displayed from the main Configuration box, allowing International settings throughout the editor to be easily configured. Pre-defined date/time formats and day/month names for 11 languages are included. * Numerous File Manager enhancements: ù Directories can now be displayed in a new 'Variable' format as well as the old 'Fixed' format. You can turn variable format On or Off from the file manager configuration dialog box. In Variable format, file names are displayed on the right side of the listing, allowing long or fully qualified names to be displayed. Under Windows/95, long file names will now be displayed! ù File Lists can now be displayed in the file manager. A File List is simply a file containing a list of filenames or filespecs which may be located in various drives and directories on your computer. File lists are always displayed in Variable format, with each filename or directory fully-qualified. You can open, save, and edit file lists with new commands on the File and Command menus. ù New commands were added to the Command menu: Open File List - open a file list Remove Line - remove lines without deleting files/directories Statistics - show statistics for a file or directory ù Entire Directories and Subdirectories can now be copied, moved, and deleted. ù The file manager Run command will now also run macro language executable (.X) files. ù The Attributes command now displays a dialog box if prompts are configured as dialog boxes ù Dashes are now displayed for file attributes which are turned off. ù The file manager Scan Files command menu now only scans files listed in the file manager. This is handy when used with File Lists, the Remove Line command, or file manager listings generated from macros such as Where. The key has now been assigned to Scan Files. ù The entire file manager is no longer refreshed after executing a file manager command - only the affected files are updated. ù The Free Space is now displayed in megabytes (MB) when greater than 10MB. * Powerful New Macros: ù Alarm - Set up to four alarms to execute commands ù Bookauto - Save and restores bookmarks automatically ù Capital - Capitalize words ù Clipview - View clipboard contents ù Clock - Display a clock with large digits and long format date ù Fattr - Change file attributes ù Fcopy - Copy or move files ù Filestat - Display file or directory statistics ù Fillnum - Fill a block with a numeric sequence ù Findo - Find occurrences (previously in Ext.aml) ù Globrepl - Global multi-file search and replace ù Hilitewd - Highlight a word (previously in Ext.aml) ù Installs - Lite installation to a floppy drive ù Logevent - Log editor events ù Machine - Examples for calling 80x86 machine code ù Paragprh - Find next/prev paragraph ù Projopen - Open a project ù Projsave - Save a project ù Ruler - Insert a ruler line above the current line ù Saveall - Save all open files ù Scan - Scan files for a string (previously in Ext.aml) ù Sieve - Sieve of Eratosthenes Demo ù Sortstr - Sort a string ù Status - Custom status line example ù Stopwtch - Stopwatch and command timer ù Synch - Synchronized scrolling ù Tabauto - Expand tabs automatically when opening files ù Tree - Directory tree ù Trimline - Trim trailing blanks and tabs ù Vcursor - Vertical cursor line ù Winclock - Window border clock install/remove ù Zapem - Shoot'em-up game Other Enhancements include: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ * The Scan Files command and the Scan2 macro will now search subdirectories when the new option 'u' is specified. Subdirectories will not be searched if these commands are invoked from the file manager. * The Find Occurrences command and the Scan2 macro now both display found occurrences in a persistent window, allowing you to goto an occurrence and then return back to the occurrences window. A new menu is also displayed, allowing you to: ù Goto an occurrence and exit ù Goto an occurrence ù Edit all occurrences ù Print all occurrences If prompts are displayed as dialog boxes, both the Find Occurrences command and the Scan2 macro will now display a dialog box prompt. * Macro Help can now be displayed for each Macro by pressing from the Macro List, and can also be displayed from within most macros by pressing . * Pasting text from Windows now assumes that the text was marked as a 'stream' mark. Both stream and character marks are now copied correctly to the Windows clipboard. * The new ClipLine setting on the Edit Options 2 dialog box specifies whether or not the clipboard cut and copy commands should use the current line when no marked block exists. * Sorting is nearly twice as fast as in v2.x. * Popup windows are now resizable. * The cursor position is now highlighted before displaying a prompt. * The new Command Line Option -d forces the editor to use short file names under Windows/95. * The new Command Line Option -r runs external macros from the command line after A.x is loaded and all files are opened. Enhancements to Previous Macros include: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ * Changes to Maclist (the Macro List): - a menu is now displayed, allowing you to: ù Run a macro ù Display macro help ù Add a new macro to the list ù Remove a macro from the list ù Change the description for a macro - Deskopen and Desksave were moved from the Macro List to separate macro files. - The actual macro list data was moved from Maclist.aml to Maclist.dat. - The Macro List was updated to show new macros in this version. * The Install macro now uses files and directories listed in one of the following file list files in the main Aurora directory: Install.dat - full installation Installs.dat - lite installation A Lite Installation can be performed by running the Installs macro from the Macro List. Lite installation allows you to install Aurora on a 1.4MB floppy disk, since the total size of all files will be less than 1.4MB. Nearly all editor features will be retained in a Lite Installation. However, macro language documentation and most external macro source files will not be available. The Install macro now also displays a progress bar at the bottom of the main install window. * The Where macro has been completely rewritten to display output in a file manger window, allowing the full range of file manager commands to be used on the located files. The Where macro is also much faster. * The Booklist macro now displays a menu, allowing you to: ù Goto a bookmark ù Delete a bookmark ù Delete all bookmarks * The Fulldate macro was renamed to Longdate. * The following macros now use the options specified on the new International Options dialog box: Calen4, Calendar, Clock, Filestat, and Longdate. * The Drawbox macro now uses the current LineStyle to draw boxes, without prompting the user. * The Hilitewd macro now uses the color chart macro (Clrchart) for color selection. * The Template macro will no longer prompt for instructions on installation and uses a better template keyword search pattern. * New macro language features were added to most macros. New Macros for Internal Use: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The following new macros are for internal use only by other macros: Erroraml - get an error message for an AML error code Flopen - Open/replace a file list (fmgr only) Flsave - Save/edit a file list (fmgr only) Helpmac - Display .Dox help for a macro Scandlg - Scan dialog box/prompt Sweep - Traverse subdirectories Configuration File Changes: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Config.aml: ù Variable assignment statements now use the new 'public' variable assignment syntax (see 'Public vs. Private' below). ù The following options were added to FmgrOpt: f - show files v - displays file names on the right side of the directory listing ù The new TabOpt variable specifies how real tabs (Ascii 9) should be displayed, and configures the behaviour of tabright/tableft commands. The following options can be specified: display real tabs as: a - ascii 9 o - spaces, if found on open s - spaces tableft/tabright options: h - shift text in insert mode r - use real tabs ù TabShift has been removed (replaced by TabOpt option 'h'). ù The new ClipLine variable specifies whether or not the clipboard cut and copy commands should use the current line when no marked block exists. ù FormatOpt now includes option 'e' by default (format from cursor to end-of-paragraph only). ù The new option 't' (directory tree) is now available for BootOpt. ù The new NameStyle variable specifies the format to be used for displaying filenames and filespecs throughout the editor, including window title bars, window and file lists, file manager windows, and macros. One of the following options can be specified: c - capitalize l - lower case u - upper case null - as-is ù The following new International variables were added to Config.aml (see the end of Config.aml): Language - language DateOpt - date format DateSep - date separator LDateOpt - long date format TimeOpt - time format TimeSep - time separator ThousandSep - thousands separator Cfg\Cfgdesk.aml: ù Modified to accomodate BootOpt 't' (directory tree). Cfg\Cfgedit2.aml: ù The TabShift option has been removed (replaced by Tab Left/Right options on the Margins and Tabs dialog box). ù The ClipLine option was added. Cfg\Cfgfmgr.aml: ù Modified to accomodate the new FmgrOpt options 'f' and 'v', and to include settings from the old Confirmations dialog box (which has now been removed). Cfg\Cfgintnl.aml: ù This is the new International Options dialog box. Several macros call Cfgintnl.x: Calen4, Calendar, Clock, Filestat, and Longdate. Cfg\Cfgmarg.aml: ù Modified to accomodate the new TabOpt variable (real tab support). Cfg\Cfgmisc.aml: ù Modified to accomodate the new NameStyle variable. Cfg\Cfgupd.aml: ù Modified to accomodate the new public assignment syntax in Config.aml. Default.prj ù History.dat has been renamed to Default.prj Define.aml: ù The old define-end definitions have been changed to the new 'constant' statements (see 'Constant Statement' below). Ext.aml: ù Numerous minor changes were made to this file. The hiliteword, findo, and askscan/searchfile functions were moved to the external macros Hilitewd, Findo, and Scan in the Macro directory. Install.aml: ù Modified to accomodate the new Syn\ subdirectory, syntax highlighting files, new macros, Install.dat/Installs.dat, and the progress bar. Kbd.aml, Menu.aml (all emulation styles): ù Minor changes were made to these files. Main.aml: ù Tran.aml is no longer included by Main.aml. Tran.aml is now compiled independently and loaded on-demand by Ext.aml. Mouse.aml: ù Minor changes were made to this file. Startup.aml ù The new file Startup.aml is included in Main.aml, if it exists. Startup.aml is not shipped with the editor - it is an optional macro source file which can be be used to automatically run external macros when the editor is started. For example, the following lines could be added to Startup.aml: runmacro2 "tabauto" // run Tabauto before any files are opened queue "runmacro2" "calendar" // run Calendar after all files are opened Syn\ subdirectory: ù A new Syn\ subdirectory is added at installation. This directory contains all syntax highlighting objects used by the editor. ù The following syntax objects are included: Xada.aml - ADA Xaml.aml - AML macro language Xasm.aml - 80x86 assembly language Xbas.aml - Basic Xbat.aml - Dos .Bat files Xc.aml - C/C++ Xcbl.aml - Cobol Xcmd.aml - Rexx Xdox.aml - Aurora .Dox files Xfor.aml - FORTRAN Xhtm.aml - Hypertext Markup Language (HTML) Xipf.aml - IPF (GML) Xjav.aml - Java Xlsp.aml - Lisp Xmak.aml - Make files Xmod.aml - Modula2 Xpas.aml - Pascal Xpps.aml - PCBoard PPL Xprg.aml - dBase Xrc.aml - Windows Resource Files Xsql.aml - SQL Xsys.aml - Config.sys Xtex.aml - LaTex Xword.aml - Used by the hiliteword command Syntax.aml: ù The 'onsyntax' function has been modified to load syntax objects on-demand from the new Syn\ subdirectory. This eliminates the need to recompile the editor to install a new syntax object. ù All syntax objects now begin with an 'x' (xaml, xc, xdox, etc.) ù The 'syndef' object was renamed to 'xword'. ù Syntax2.aml is no longer needed and has been removed. ù Option 'c' in the 'syntax' function call now indicates that the cursor line should be syntax highlighted (in version 2.x, option 'c' turned off syntax highlighting of the cursor line.) ù A new 'symbol set 2' and its associated color can be defined for each syntax statement. This allows you to define two groups of symbols, each with a different color. System.aml: ù The new 'priority' setting sets the priority for dispatching editor events in a multitasking environment (Windows, OS/2, etc). Tran.aml: ù Tran.aml is now compiled independently (to Tran.x) and loaded on-demand by Ext.aml. User.aml: ù The new file User.aml is included in Main.aml, if it exists. User.aml is not shipped with the editor - it is an optional macro source file in which you may place your own editor extensions. ====================================================================== (The following section is primarily of interest to macro programmers) New Macro Language Features: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ There are numerous Macro Language enhancements and changes in Aurora version 3.0: Public vs. Private: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Functions and variables are scoped differently in version 3. Functions and object variables may now be either 'public' or 'private'. Public functions and variables can be accessed from outside the current object definition, whereas private functions and variables can only be accessed from within the current object definition. Only public functions and variables can be inherited by other objects. This scoping is more consistent with established object oriented models. In version 2.x, all object variables and functions could be considered public, whereas 'global' variables were in a class by themselves. In version 3.0, global variables have been replaced by private object variables. Note that local variables defined within a function still have the same scope - they are 'private' to the function. By default, all variables are private, and all functions are public: object edit abc = "hello" // abc is private to this 'edit' block function xyz // xyz is public : end The default scoping can be overridden with the new 'public' and 'private' keywords. For example: object edit : public abc = "Hello" // abc is public private function xyz // xyz is private to this 'edit' block : end Objects themselves (such as 'edit' above) are always public, and cannot be made private. The 'public' and 'private' keywords may also precede the 'forward', 'function' 'variable', and 'var' keywords. public variable abc // public variable private forward x // private function not defined yet private function xyz // private function : end Within the object block in which they are defined, both public and private functions and variables can be accessed by name. Private functions and variables cannot be accessed from outside the object definition block. Public Variables: Public variables in a parent object can be accessed from a child object by declaring the variable as public in the child object, or by preceding the variable reference with an underscore (_) when used. Public variables can also be accessed remotely via the new member selection (.) operator or the subscript [] operator (see below). The following variables must be public: - variables accessed from other object definition blocks - variables accessed from within menu function calls - variables accessed via the 'lookup' and 'variable?' function calls - variables whose names are not known at compile time Public variables can also be assigned values by prefixing the variable name with an underscore, or by using the 'set' function. The following assignment statements all have the same effect at execution: public abc = "Hello" _abc = "Hello" set "abc" "Hello" However, these statements are not exactly equivalent. The first defines 'abc' as a public variable symbol which can later be referenced in the same object block without an underscore. The second and third statements do not define 'abc' as a variable symbol. Public Functions: The following functions must be public: - functions called from other object definition blocks - functions called from menus, buttons, etc. - keyboard and mouse event handling functions - functions called as a result of executing call, pass, passprev, queue, queueobject, send, sendobject, etc. - functions whose names are not known at compile time Functions defined using the 'key' or 'event' keywords are automatically public and cannot be defined as private. New Member Selection (.) and Subscript [] Operators: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The member selection (.) and subscript [] operators can now be used to access public variables and functions in another object. For example, using the member selection (.) operator: fmgr.abc = "Hello" // assign "Hello" to public variable 'abc' // in object 'fmgr' say fmgr.abc // displays "Hello" If the name to the right of the (.) is undefined, it is assumed to be a variable. However, if the name to the right of the (.) was previously declared as a public function, then the member selection operator can be used to call the function in another object. For example: forward xyz fmgr.xyz 1 2 // call function 'xyz' in object 'fmgr' with // parameters 1 and 2 The subscript operator [] can now be used with an object name to access a public variable whose name is not known at compile time. For example: x = "a" y = "bc" fmgr [x + y] = "Hello" // assign "Hello" to public variable 'abc' // in object 'fmgr' say fmgr [x + y] // displays "Hello" Both the member selection (.) and subscript [] operators can be used with the new pre-defined object name 'this', which always refers to the current object. For example: x = "a" y = "bc" this [x + y] = "Hello" // assign "Hello" to public variable 'abc' // in the current object say this [x + y] // displays "Hello" say this.abc // displays "Hello" Statements Removed: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The new methods used to assign values to public variables (discussed above), together with the new functions 'set' and 'setfunction', have eliminated the need for the old setx, setobj, setxobj, and setxfun statements - these statements have been removed. The following examples illustrate how to perform equivalent assignments using the new methods: x = "a" y = "bc" setx x + y "Hello" // old method this [x + y] = "Hello" // new method setobj abc "Hello" "fmgr" // old method fmgr.abc = "Hello" // new method setxobj x + y "Hello" "fmgr" // old method fmgr [x + y] = "Hello" // new method setxobj x + y "Hello" "fmgr" // old method fmgr [x + y] = "Hello" // new method setxfun "" "beep 400 400" "fmgr" // old method setfunction "" "beep 400 400" "fmgr" // new method The old 'set' statement is now a function call, and can be used to perform any type of public variable assignment: x = "a" y = "bc" set "abc" "Hello" // assign "hello" to 'abc' // (equivalent to: _abc = "Hello") set x + y "Hello" // assign "hello" to 'abc' // (equivalent to: this [x + y] = "Hello") i = "fm" j = "gr" set x + y "Hello" i + j // assign "hello" to 'abc' in object 'fmgr' Note that the first argument to 'set' is now an expression, so quotes are required if a literal variable name is used. Constant Statement: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ A new 'constant' statement eliminates most of the need for the old define-end statement in 2.x versions. The 'constant' statement defines symbolic constants: constant five = 5 constant six = 2 * 3 constant thirty = five * six The synonym 'const' may also be used, and commas may be used to separate each constant definition: const name = "Aurora", time = getdate + ' ' + gettime, user = "John Doe" The 'constant function' statement defines functions which are called at compile-time to return constant values: constant function color (foreground on background) return background * 16 + foreground end constant blue = 1 constant white = 15 say (color white on blue) // equivalent to 'say 31' Substrings and Substring Assignment: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The new '..' operator can be used to obtain the 'slice' of a string between two positions in the string: s = "Hello" say s [2..4] // displays 'ell' - equivalent to: say s [2:3] // displays 'ell' A value of -1, not zero, in the second operand is now used to indicate the end of the string (the value of the constant TO_END in Define.aml has changed accordingly). For example: s = "Hello" say s [2..-1] // displays 'ello' say s [2:-1] // displays 'ello' If zero is specified as the second operand, a zero-length substring (the null string) is returned. Note that zero in the first operand still references the last character of the string: say s [0] // displays 'o' When placed on the left side of an assignment statement, the substring operator [] can now be used to replace a portion of a string with another string ('substring assignment'). For example: x = "Hello" x [1] = 'J' say x // displays 'Jello' x [0] = 'y' say x // displays 'Jelly' The length of the string will change if needed: x = "Jelly" x [3..5] = 't' say x // displays 'Jet' x [2:-1] = "upiter" say x // displays 'Jupiter' Substring assignment also allows a portion of a string to be deleted, and one string to be inserted within another: x = "Hello" x [2..4] = '' say x // displays "Ho" x [2:0] = "er" say x // displays "Hero" Arrays: ÄÄÄÄÄÄ The macro language now supports flexible, typeless arrays. An array is a collection of values, each of which can be indexed by a number. Arrays can be created by listing all the initial array values or 'elements' between a pair of braces {}: dogs = {"collie" "airdale" "sheepdog"} In the example above, an array of three strings is created and assigned to the variable 'dogs'. The first element of the array is 'collie', the second is 'airdale', and the third is 'sheepdog'. Array elements are referenced, and assigned values, with the subscript operator []: i = 1 say dogs [i] // displays 'collie' dogs [i] = "lassie" say dogs [i] // displays 'lassie' Arrays elements can also be referenced with the member selection (.) operator and a numeric constant. For example: say dogs.2 // displays 'airdale' constant terrier = 2 say dogs.terrier // displays 'airdale' Note that arrays themselves are expressions, and do not necessarily need to be assigned to variables. Arrays can usually be treated like any other expression. For example: i = 2 say {"one" "two" "three"}[i] // displays 'two' Arrays can also be passed to functions, and returned from functions. Arrays can be used to return more than one value from a function: function xyz i = 4 j = " string" return {i 'a' + j 1} end x = xyz // after the call, x is {4 "a string" 1} Arrays are always passed by reference to a function. This means that changing an array element in the called function will also change the element where the function was called: function xyz (y) y [2] = 5 end x = {1 2 3} xyz x // after the call, 'x' is {1 5 3} Since the macro language is typeless, arrays may contain elements of any type, including strings, numbers, complex expressions, or even other arrays. For example: y = 4 x = {1 "abc" 3 {134 (y + 8) / 2 "xyz"}} say x [1] // displays '1' say x [2] // displays 'abc' say x [4][1] // displays '134' say x [4][2] // displays '6' say x [4][3][2] // displays 'y' x [4][3] = {4 5 6} // replaces 'xyz' with {4 5 6} say x [4][3][2] // displays '5' Arrays are treated very much like strings. You can concatenate arrays, take a 'slice' of an array, or assign an array to a portion of another array (analagous to 'substring assignment' discussed above). For example: x1 = {1 2 3} x2 = {4 5 6} x3 = x2 + x1 + {7 8} // x3 = {4 5 6 1 2 3 7 8} x4 = x3 [3..6] // x4 = {6 1 2 3} x4 [2:2] = '' // x4 = {6 3} x4 [1:1] = {5 6 7} // x4 = {5 6 7 3} The function 'array' creates an array of an arbitrary size, where each element is initialized to the null string: x = array 50 // creates an array of 50 null strings // and assigns it to the variable 'x' The function 'array?' tests for the existence of an array: if array? data then : end To obtain the number of elements in an array, use the new unary 'length' operator: x = {1 4 5 6} say length x // displays 4 Note that constant arrays cannot be defined. For example: constant x = {1 4 5 6} // *not* permitted New Operators: ÄÄÄÄÄÄÄÄÄÄÄÄÄ The following new operators have been added to the macro language: Operator Description ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄ . Member selection operator (see above) .. String/array slice operator (see above) ~ Bitwise-not unary operator - This operator inverts the bits of its numeric operand. For example: say ~0ffffffffh // displays '0' length String/array length unary operator (replaces 'sizeof') - This operator obtains the size of its operand. For example: say length "abcde" // displays '5' say length {5 77 31 2} // displays '4' : : Format operator (replaces 'pad') - this operator justifies its first operand within a field length specified by its second operand. If the field length is preceded by a minus (-) sign, the first operand is left justified, otherwise it is right justified. The third operand is optional and specifies a pad string. If a pad string is not specified, then a blank (Ascii 32) is assumed. For example: 34 : 4 // value is ' 34' 34 : -3 // value is '34 ' '' : 5 // value is ' ' '' : 7 : '0' // value is '0000000' i = 10 i : -i // value is '10 ' "abc" : i : '-+' // value is '-+-+-+-abc' For Statement: ÄÄÄÄÄÄÄÄÄÄÄÄÄ The new 'for' statement can be used for indexed looping. It is often more convenient and more readable than the 'while' statement, and is also faster. For example: for i = 1 to 10 do // displays numbers from 1 to 10 msgbox i end The 'downto' keyword may be used to count downward: for i = 10 downto 1 do // displays numbers from 10 to 1 msgbox i endfor // end or endfor may be used An optional 'step' keyword allows the loop variable to be incremented or decremented by values other than one: for i = 1 to 10 step 2 do // displays 1, 3, 5, 7, 9 msgbox end An optional 'by' keyword defines an expression to be assigned to the loop variable for each iteration. It can be used for looping with irregular or non-numeric loop variables: // displays: 1, 2, 4, 8, 16, 32, 64, 128 for i = 1 to 128 by i + i do msgbox i end // displays 'abcde', 'abcd', 'abc', 'ab, 'a' for i = 'abcde' to 'a' by i [1..length i - 1] do msgbox i end Note that when the 'by' keyword is used, no scalar comparison (less than or greater than) is done at each iteration between the loop variable and the limit specified by the 'to' expression. They must be exactly equal for the loop to terminate. Loop Times: ÄÄÄÄÄÄÄÄÄÄ The new 'times' keyword may now be used to limit the number of iterations in the 'loop' statement: i = 2 loop i + 5 times msgbox "loop" // displays 'loop' 7 times end Forward Statement Changes: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Since object names may now be used with the member selection (.) and subscript [] operators, it sometimes necessary to declare an object symbol without defining the actual object (for example, in independently compiled external macros which reference editor objects). This can be done with the new 'forward object' statement: forward object prf // define 'prf' as an object symbol say prf.EditStyle // display EditStyle in object prf The new 'forward function' statement is a synonym for 'forward': forward function msgbox // define msgbox as a function symbol Object Entry: ÄÄÄÄÄÄÄÄÄÄÄÄ The new pre-defined object name 'entry' can be used within external macros to change the current object back to what it was when the external macro was invoked: // start of external macro : : object abc // define object abc : // (and change current object to abc) : object entry // change back to current object at invocation : Conditional Compilation: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The macro language now supports 'conditional compilation'. Conditional compilation keywords allow sections of macro source code to be compiled or ignored, based on the value of expressions evaluated at compile-time. The new conditional compilation keywords are: #if, #elseif, #else, #end, and #endif. The expression following the '#if' or '#elseif' keywords is evaluated at compile-time. If true, the macro source code in the '#if' or '#elseif' block is compiled, otherwise the source code in an optional '#else' block is compiled. The following example illustrates conditional compilation: constant DEBUG = TRUE i = xyz #if DEBUG msgbox i #end Conditional compilation keywords can also be used to temporarily 'comment-out' sections of macro source code: #if 0 : #end #Exec Statement: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The old define-end statment has been renamed to #exec-#endexec. Any statements found between #exec and #endexec are executed at compile-time. This statement can be used to perform very specialized initialization and checking of the compilation environment, such as defining constants or constant functions based on the current environment, ensuring necessary files are present and in the correct locations, etc. Syntax Changes: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Several minor enhancements were made to the macro language syntax: 'C-style' hex constants can now be used in addition to the hex constants already supported by AML. The new hex constants must be preceded by '0x' and not followed by 'h' or 'H'. For example: 0h, 4C5H, 0ffh // old style (still valid) 0x0, 0x4C5, 0xff // C-style The character '#' is no longer allowed in macro language identifiers (except for the conditional-compilation keywords, and #exec-#endexec). The 'var' keyword and the new synonym 'variable' now allow the use of commas to define more than one variable: var a, b, c variable a, b, c The 'event' and 'endevent' keywords are new synoymns for the 'key' and 'endkey' keywords. They may provide a more readable way to define event handling functions for builtin events (in angled brackets), which are not keyboard events. For example: event : end The 'key', 'event', and 'function' statements are now terminated by the 'object' statement. It is no longer necessary to close a 'key' statement with 'end' or 'endkey' immediately before an object statement. For example: key askcomplete key askcomplete // 'end' not required here object edit : The 'key', 'event', and 'function' statements are now all terminated by the 'key', 'event', and 'function' keywords, which may be more convenient for short function or event definitions: function askclip askc "Clipboard Name" "ClipName" function askprthdr askc "Current Header/Footer" "PrtHdr" function askx : In statements where a new variable is assigned a value based on its previous value, the 'var' or 'variable' statement is no longer required to define the variable. For example: function abc repeat i = i + 1 // 'var i' is no longer required before 'repeat' msgbox i until i == 10 end Compiler Error Codes: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The following changes were made to macro language compiler error codes: New error codes: 1314: Unexpected keyword 1315: Invalid redefinition 1708: Internal Stack Overflow Error code description changed: 1504: Statement must be at top level Error codes removed: 1503: (replaced with error code 1504) 1505: (replaced with error code 1504) 1506: (replaced with error code 1504) 1509: (replaced with error code 1504) 1702: (replaced with error code 1701) Other Compiler/Interpreter Comments: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The interpreter is about 10%-20% faster, depending on usage. Sorting is 70%-120% faster. A few other commands may be slightly faster. Executable macro file (.X) formats have changed. Version 2.x .X files will not run under version 3, and vice-versa. Aurora now requires about 10k more conventional memory (about 480k for the 386 version). New Functions and Events: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The following new functions and events were added. See Function.dox or Language.dox for more details: * builtin functions: actualcol // get the actual column for an apparent column apparentcol // get the apparent column of an actual column array // create an array array? // test if an array exists book? // test if bookmark exists break? // test if was pressed breakoff // clear the flag createcursor // create a cursor createobject // create an object directory? // test if a directory exists file? // test if a file exists foldoptions // set options for displaying closed folds getbuftabs // get the buffer tab width getcurrfile // get the current filename being executed or compiled getfileinfo // return file/directory information getlinesize // get the actual length of a line getrealtext // get a line or a portion of a line from a buffer getsyntax // get the window syntax object loadobject // load an object machine // execute machine-level code priority // set the event dispatching priority setbuftabs // set the buffer tab width seterror // generate a compiler error setfunction // change the definition of a public function set // change the value of a public object variable setobjtype // change the inheritance path of an object variable? // test if a public variable exists * library functions: fgetopt // get file manager options fgetsort // get file manager sort order fstatus // update file manager status line fupdate // update file manager line(s) * extension functions: flopen // open a file list flsave // save a file list fremove // remove file manager lines fstat // display file/directory statistics helpmacro // display macro help * events: // sent before an object is destroyed // sent after the display is updated onclosedlg // sent when a dialog box is closed ondialog // sent when unrecognized dialog box events occur ondesk // sent after the desktop is restored onname // sent to retrieve a formatted filename Functions Removed: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The following macro language functions are no longer supported and have been removed: * builtin functions: bufferflag? // replaced by the new bufferflag option '?' hidebuf // replaced by the new bufferflag option 'h' includemacro // not needed lineflag? // replaced by the new lineflag option '?' pad // replaced by the new format operator (:) saveobject // not needed sizeof // replaced by the new length operator trunc? // replaced by the new bufferflag option 't' * library functions: fscanstr // not-needed (replaced by the new Scan macro) ftype? // not-needed openf // replaced by new code in fopen (Ext.aml) picklist // replaced by pickfile scandlg // replaced by the Scandlg macro scanfiles // replaced by new Scan macro * extension functions: onscanning // replaced by the new Scan macro runmac // replaced by runmacro2 searchfiles // replaced by the new Scan macro Functions Renamed: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ In the pursuit of more consistent terminology, the following functions and events were renamed: * builtin functions: destroyvar // renamed from unsetx geteventcode // renamed from getkeycode geteventname // renamed from getkeyname resident // renamed from stayresident seteventobj // renamed from eventobject setfileattr // renamed from chgfileattr settype // renamed from inheritfrom system // renamed from exec * library functions: fbreak // renamed from fdobrk fcommand // renamed from fdomark fgetfile // renamed from getffile pickfile // renamed from askfile * events: // renamed from oncompiling // renamed from onloading // renamed from ondraw // renamed from onprinting // renamed from onsaving // renamed from onstatus Functions Altered: -ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The following functions were altered in some way: Builtin functions: * bufferflag, lineflag, windowflag These functions will now accept option '?', for testing whether or not other flags are turned on (replacing the functions bufferflag? and lineflag?). If flags are specified without -, +, or ?, then they will be turned on and any flags not specified will be turned off. * bufferflag The old option 'd' (process dirty lines) is now option 'p'. Options '?d' can now be specified to test if the buffer was initially loaded as a directory with the 'loadbuf' function. The new option 'h' can be use to hide a buffer, un-hide a buffer, or test if a buffer is hidden (replacing the old hidebuf function). Options '?t' can now be specified to test if the buffer was truncated when loaded (replacing the old trunc? function). * closefile, filepos, readfile, writefile If no file handle is specified, these functions will now work with the file handle returned from the most recent openfile call. The file handle parameter is now always the last parameter. For readfile, a length of 16000 is now assumed if no length is specified. * col, left, right These functions now return the new column. * colorcursor, colormark If the color -1 is specified, the default window mark color is used. If the color -2 is specified, the cursor or mark is hidden. * destroyobject This function will now destroy an object immediately if possible, otherwise the object will be destroyed when it is no longer referenced. This function now returns TRUE if the object is destroyed immediately. * down, gotopos, movepos, row, up These functions now return the new line number. * fillblock This function now fills blocks with a blank if no fillstring is specified. * frame? If no frame options are specified, this function now returns a non-null value if any frame options are present. * getcoord Option 'd' (clip with the display) now works with all other options. * getdate, gettime These functions now take an optional date and time format as the first parameter, overriding the formats specified in the international function. If -1 is specified for the first parameter of the gettime function, then the formats specified in the international function are used, but seconds will also added (if not already present). * getlinelen, saveblock, savebuf The 'getlinelen' function will now ignore tab characters (Ascii 9) when they occur at the end of a line in a non-binary buffer. 'savebuf' and 'saveblock' will only ignore tabs if option 't' is specified. * getos Option 'l' (test for long filenames) was added. * getwinctrl This function now returns a string composed of all the title bar controls. The second parameter (control position) was removed. * insertbuf, loadbuf These functions now accept the following new directory options: f - include normal files v - load the directory in variable format q - qualify names with the directory name. This option can only be specified with option 'v'. s - load the directory in 'short' format (name only, starting at column 1). This option can only be specified with option 'v'. c - show names capitalized l - show names in lowercase u - show names in uppercase Option '1' was removed from these functions, but can still be used with the 'open' and 'openbuf' functions. * locatefile Option 'f' (locate files) was added. If no options are specified, then 'fd' (locate files and directories) is assumed. * lookup Option 'e' was removed (replaced by the new 'variable?' function) * peek, poke These functions now take segment:offset addresses, not absolute addresses. * printblock, printbuf A new optional 4th parameter (printer initialization string) was added to these functions. * runmacro A new object parameter was added (consistent with the new loadobject function). * savebuf This function now uses the buffer name if no filename is specified. * scanfile This function now returns zero if interrupted by . * setborder A new optional parameter (the hex view divider character) was added. * sortblock A new optional 3rd parameter (start column) was added. * syntax New option 'd' (show through closed folds) was added. Option 'c' now indicates that the cursor line should be highlighted (the reverse was true in v2.x). The new parameters 'symbol set 2' and its associated color can be defined in the syntax statement, allowing a group of symbols to be defined with a different color than the original symbol set. * tabblock If a column mark is specified with tab expansion, then only the tabs within the column (or overlapping the column boundries) are expanded. * tilewindow The 2nd and 3rd parameters (split threshold and limit) were switched, and option 'b' was renamed to option 'r' (reverse order). * windowflag New options 'z' (resizable windows), and options 'h12' (hex view options) where added. Option 'd' (draw) was renamed to option 'p' (paint). * Other changes to builtin functions: All builtin block functions now accept the pre-defined markid's '*l' and '*a'. '*l' is a pre-defined line mark which marks the line at the cursor in the current buffer. '*a' is predefined line mark which spans the entire contents of the current buffer. These pre-defined markid's allow some block operations to be performed without first creating a mark and then destroying the mark when the operation is completed. For example: shiftblock 1 '*a' // shift the entire file right one column When cursors are created, either explicitly by calling createcursor, or implicitly by calling cursor movement functions, the default cursor color will now always be the color of the text, not the default mark color. Library functions: * fsort This function was moved to object 'fmgr'. * gotomenu, gotobar, gotobar2 These functions were moved to object 'a' * msgbox, okbox, shortbox, yncbox These functions will now allow message boxes with an arbitrary number of message lines to be displayed when a newline character (\n) is inserted between each line in the message string. * pickfile A second title was added and the parameter order was changed. This function will now automatically reload the picklist when a directory is selected. * popup The event-handling object for popup windows in Lib.x is now called 'popup'. User-defined objects can be derived from object 'popup' and define their own keys, event handling functions, etc. A new optional 5th parameter (object) was added to the popup function. If an object is specified, the window event object for the popup window will be set to this object (this object must be derived from the pre-defined 'popup' object). * restoredesk A new option 'c' (clear desktop) was added. This option was previously the default). * setting A new optional 3rd parameter (object) was added. This parameter specifies the syntax highlighting object to use with the 'x' setting (syntax highlighting). If not specified, the 'onsyntax' event is sent to obtain the syntax highlighting object. * setting?, setting The new 'h' option (hex view) can be specified in the first parameter. * tile Parameter 2 (number of windows) was added. Options 'r' and 'l' are now also available in parameter 1 (see the tilewindow function). * trackmouse This function will now work on any window with a buffer. Extension functions: * ask This function now marks the cursor position. * asksaveas This function will now prompt the user when replacing an existing file. * askeval, askopen, askopenb, askrac, asksaveas, askx, backup, pickmacro, print, printfile, save These functions were moved to object 'a'. * askrepl A backslash (/) is now automatically appended to the end of the search string if needed (for non-dialog box prompts only). * askrmacro Pressing enter from within this prompt will now display a macro picklist. * fattr This function will now allow directory attributes to be changed from within the file manager. * finddlg, repldlg These functions were moved from Lib.x to Ext.aml. * frun This function will now also run AML executable (.X) files. * onhotkey Modified to accomodate the new variable directory format. * onopen Added support for the new open option 'x' (hex view). * runmacro2 This function will now run a macro in the Macro subdirectory if no path is specified (replacing 'runmac') * tabfunc Added support for switching between hex entry and hex view modes with the or keys. * write Added support for the new hex view/entry mode. Events: * This event (formerly onstatus) no longer draws edit window settings automatically. The 'getsettings' function can be used to obtain window settings.