AfterGrasp GLPRO replacement project start Feb 27th, 2002 ---------------------------------------------------------------------------- Thu, 04 March 2010 Some confusion over the actual meaning of EnterCritical/LeaveCritical was allowing some errors to still occur. All the tracking of CRITICAL_SECTION objects rewritten to correct these flaws. ---------------------------------------------------------------------------- Wed, 03 March 2010 Had some hanging problems in BHO, and some other risky situations from a whole tree of code used to search the dictionary. It was doing it in a way that could not be interrupted, so it had to all be locked down, which led to the hanging risk. All that search code is rewritten to be re-entrant, fixing all the hang issues in yesterday's build. ---------------------------------------------------------------------------- Tue, 02 March 2010 Serious bug in low level dictionary add/resize which were not correctly disabling background threads during a dictionary resize. This could cause GPF faults and other strange symptoms. Fixed with new critical section support for all major token functions. There may be some infinite loop hangs if I made any mistakes in checking all the call branches since there are so many places these key functions call each other. ---------------------------------------------------------------------------- Thu, 25 February 2010 Bug in creation of new WHENs was allowing background event checker to access the list of active WHENs while it was being resized/manipulated. This could cause crashes when frequently clicking while hotspots are created/destroyed rapidly. ---------------------------------------------------------------------------- Mon, 15 February 2010 New command DEBUGEXCEPTION generates a windows exception/crash on purpose to test debugging in the field. ---------------------------------------------------------------------------- Mon, 08 February 2010 STRASC was giving negative values for ascii characters over 127. Fixed. STRASC now supports unicode (16bit) strings. ---------------------------------------------------------------------------- Thu, 04 February 2010 New function STRHTMLREPARSE based on the LIBXML2 HTML parsing and HTML writing. It takes a HTML string and outputs a reparsed HTML string. The added are removed, and any tags are removed. The LIBXML2 HTML parser does not recognize some obscure & codes such as &equal;. This means it will turn &equal; into &equal;. STRHTMLREPARSE is to give another HTML repair option in addition to STRHTMLREPAIR, STRHTMLCLEAN and the STRHTMLFILTER functions. Some minor changes to STRHTMLFILTER because of possible memory corruption. ---------------------------------------------------------------------------- Mon, 01 February 2010 If SET TEXTKERN OFF, all checks for kerning are now disabled correctly. STRTEXTTOHTML now handles all & codes including unicode special characters. May give some quirky results because of the use of right hand single quotes being too wide. Same support added to STRRTFTOHTML for all & codes. TEXTHTML ON and other HTML text functions were not supporting & codes 8 or more characters long such as &asterisk;, fixed. ---------------------------------------------------------------------------- Thu, 28 January 2010 Small fix to STRHTMLSTRIP for ascii characters >127 STRRTFTOHTML now encodes tab characters as New command CLIPBOARDGETTEXTUNICODE, works exactly like CLIPBOARDGETTEXT except the result is a 16bit per character BSTR. New command STRTEXTTOHTML, handles UNICODE strings as input, converts plain text into HTML text. It replaces: \n into
\t into < into < > into > & into & and other characters above 127 into � format. ---------------------------------------------------------------------------- Wed, 27 January 2010 DRAWLISTLINENEXT and DRAWLISTLINEPREV were not matching an exact coordinate, only a greaterthan (for NEXT), or less than (for prev). Fixed. ---------------------------------------------------------------------------- Mon, 25 January 2010 STRHTMLSTRIP STRHTMLPOSITOON AND STRPOSITIONHTML now treat as a single STRCHR(9) character. They also treat the numbered tab tags like and so on as a single tab character. TEXTSTRPOSITIONRECTS, TEXTSTRPOSITIONRECTSFROM, TEXTLINESRECTS, and TEXTLINESRECTSFROM now support tabs. A HREF tags with tabs in the text is now supported. ---------------------------------------------------------------------------- Wed, 20 January 2010 STRHTMLPOSITION and STRPOSITIONHTML when given a position of 0 now return 1 instead of the position of the first "real" character. Bug in handling of all TABs when DRAWOFFSET is in use fixed. Bug in handling of HTML TABs using the same position for all tabs fixed. ---------------------------------------------------------------------------- Mon, 18 January 2010 Numbered tab tags and so on are now handled by the STRHTMLCLEAN/STRHTMLREPAIR commands. Problems with HTML support when TEXTHTMLTABS enabled forcing a newline are fixed. ---------------------------------------------------------------------------- Mon, 11 January 2010 CLIPBOARDGETTEXTHTML now converts UTF8 text into HTML encoded text. ---------------------------------------------------------------------------- Thu, 07 January 2010 Setup now upgraded to be compiled with InnoSetup 3.6.7 Unicode. STRHTMLCLEAN and STRHTMLREPAIR now treat
  • as a paired tag, and will insert missing
  • tags, and remove extra tags. Also they will not remove nested
  • tags like it would with other tags like or STRLEFTHTML STRRIGHTHTML STRMIDHTML no longer try to match
  • or tags. ---------------------------------------------------------------------------- Tue, 05 January 2010 STRHTMLREPAIR and STRHTMLCLEAN could crash with complex HTML that had huge tags/attributes, such as complex URLs. Fixed to handle any size tag/nested tag. STRHTMLFILTER functions will now filter out SCRIPT code and STYLE blocks if those tags are filtered out. STRHTMLFILTER functions now remove HTML comments. Limits on text lines handled by TEXT, TEXTHEIGHT and other text functions increased from 32K to 128K. ---------------------------------------------------------------------------- Wed, 30 December 2009 New option for SET VARIABLES. If the value is a string, then it is used as the match string for the VARIABLES dialog box, and VARIABLES is turned ON: SET VARIABLES VARMATCHSTRING Example: drawclear white tagarray = array(a,c,e,f) set variables tagarray set debug step ---------------------------------------------------------------------------- Tue, 29 December 2009 STRHTMLFILTER and STRHTMLFILTERVALUE now match values with quotes against values without quotes, and vis-versa. Example: drawclear white sizevalid = array("size", "#") facevalid = array("face", "*") colorvalid = array("color", "\##") fontvalid = array("font", &facevalid, &sizevalid, &colorvalid) local s "Hello
    " news = strhtmlfilter(@s, array("br", &fontvalid)) ; Gives: Hello
    messagebox @news exitnow ---------------------------------------------------------------------------- Sun, 27 December 2009 Corrected examples for STRHTMLFILTER commands, they all take arrays not multiple tag values. STRHTMLFILER code finished and tested Runable example of some STRHTMLFILTER functions: drawclear white local s "Hello
    " news = strhtmlfiltertag(@s, array("font")) ; Gives "Hello" messagebox @news local s "Hello
    " news = strhtmlfilterattrib(@s, array(array("font","size"),"br")) ; Gives "Hello
    " messagebox @news sizevalid = array("size", "#") facevalid = array("face", "*") colorvalid = array("color", "\##") fontvalid = array("font", &facevalid, &sizevalid, &colorvalid) local s "Hello
    " news = strhtmlfilter(@s, array("br", &fontvalid)) ; Gives "Hello
    " messagebox @news exitnow ---------------------------------------------------------------------------- Wed, 16 December 2009 Fixed small bug in STRHTMLTAGREMOVE, an extra space was left when removing an attribute from multiple attributes in a single tag. STRHTMLTAGREMOVE rewritten to be generalized so the same code can be used for the new STRHTMLFILTER functions. ---------------------------------------------------------------------------- Tue, 15 December 2009 STRHTMLSTRIP now takes @TEXTHTMLSPACES into account, and does not remove spaces with it's TRUE. Five new commands under development, all for filtering HTML text to remove tags not listed. None are functioning yet: STRHTMLFILTERTAG Ignores attributes/values, only considers tag name in deciding which tags to preserve: STRRESULT = STRHTMLFILTERTAG(STRVAL,ARRAY_TAG) news = strhtmlfiltertag(@s, array("b", "br", "p", "font")) STRHTMLFILTERATTRIB ignores values, only considers tag name, and attributes: STRRESULT = STRHTMLFILTERATTRIB(STRVAL,ARRAY_TAG_ATTRIB) news = strhtmlfilterattrib(@s, array("b", "br", "p", array("font", "face", "size"))) STRHTMLFILTERVALUE considers tag name, attributes, and values: STRRESULT = STRHTMLFILTERVALUE(STRVAL,ARRAY_TAG_ATTRIB_VALUE) sizevalid = array("size", "1", "2", "3", "4", "5", "6", "7", "8", "9") facevalid = array("face", "arial", "times") colorvalid = array("color", "#000000", "0", "#FFFFFF") fontvalid = array("font", &facevalid, &sizevalid, &colorvalid) news = strhtmlfiltervalue(@s, array("b", "br", "p", &fontvalid)) STRHTMLFILTERVALUE considers tag name, attributes, and values. The tag name, attribute or value can be a wildcard string using '?' to match a single character '*' to match 0 or more characters '#' to match 1 or more digits in a row If you want to accept tags with no attributes as well as with specific attributes, you will need to include "" as an attribute name. STRRESULT = STRHTMLFILTER(STRVAL,ARRAY_TAG_ATTRIB_VALUE) sizevalid = array("size", "#") facevalid = array("face", "*") colorvalid = array("color", "\##") fontvalid = array("font", &facevalid, &sizevalid, &colorvalid) news = strhtmlfilter(@s, array("b", "br", "p", &fontvalid)) ---------------------------------------------------------------------------- Thu, 10 December 2009 New function WinErrorMessage, takes a windows error code, and looks up the text message error code. RESULTSTRING = WINERRORMESSAGE(ERRORCODE) ---------------------------------------------------------------------------- Wed, 09 December 2009 SET VARIABLES ON now surpresses headings for blocks of ignored variables. For instance if you have a GLOBAL variable called "undo", and set the variables search string to "undo", even if you had no local variables named "undo" you would still get a variable number of LOCAL headers constantly growing and shrinking above the GLOBAL section. This is fixed. ---------------------------------------------------------------------------- Fri, 20 November 2009 Long standing flaw in the way the internal token dictionary (which drives the whole interpreter) was resized is fixed. In rare cases, a background task might try to access the base token list as it was being resized resulting in a memory access error. This mostly showed up with active animated layers, but could happen in other cases. Fixed. CLIPBOARDGETTEXTHTML now trims off any leading or trailing @CR and @LF characters. ---------------------------------------------------------------------------- Thu, 19 November 2009 STRRTFTOHTML no longer adds a CRLF in front of
    tags. STRRTFTOHTML now writes tags are lower case. STRRTFTOHTML now translates '<' '>' and '&' characters to HTML escape sequences. New CLIPBOARDGETTEXTHTML and CLIPBOARDPUTTEXTHTML commands, work just like CLIPBOARDGETTEXTRTF and CLIPBOARDPUTTEXTRTF commands. ---------------------------------------------------------------------------- Tue, 17 November 2009 Bug in STRHTMLCLEAN which would incorrect adjust indexes passed. It was advancing them when it should have been decreasing them. ---------------------------------------------------------------------------- Fri, 13 November 2009 Added extra error check to low memory reallocation code to prevent crashes with negative or wildly incorrect block sizes. A crash in this code showed up during some debugging, so this is to prevent that in future. ---------------------------------------------------------------------------- Tue, 10 November 2009 Serious crashing bug in STRHTMLCLEAN with multiple duplicate FONT tags, fixed. STRHTMLCLEAN was not correctly cleaning strings with overlapping font tags, fixed. Test example: drawclear white a = "Goodbye" messagebox @a strhtmlclean(@a) exitnow Added error checking to key ItemAdd and ItemAddUnique low level functions. They would crash if given a negative byte count. ---------------------------------------------------------------------------- Thu, 05 November 2009 STRHTMLTOFLASH now outputs BSTR (16bit per character) strings, it converts codepage 1252 characters into unicode characters. For instance ’ is converted into the character 0x2019. STRURLENCODE now handles BSTR (16bit per character) unicode strings, it uses UTF-8 encoding. STRURLDECODE now outputs a BSTR (16bit per character) string. It handles UTF-8 data. STRHEX now supports BSTR (16bit per character) strings, it outputs them as upper byte, lower byte pairs. A test of all this, takes a RTF rquote (right quote), converts to HTML which gives ’. Converts the HTML to flash and then UTF-8 URL encodes it to give %E2%80%99. Then it decodes the URL back to a BSTR and displays that in hex which is 2019 (unicode character for right quote). a = strrtftohtml("{\rtf1\rquote}") s = strurlencode(strhtmltoflash(@a)) messagebox @a$" "$@s strhex(strurldecode(@s)) ---------------------------------------------------------------------------- Wed, 04 November 2009 Test version: STRHTMLTOFLASH changed to generate URL style %NN sequences instead of html &#NNN; sequences. ---------------------------------------------------------------------------- Thu, 29 October 2009 New compiled script signature for 64bit compiled scripts. They use 32bit string size counts (instead of 16bit), and 64bit tokens. Signature is "AGSCRI64". Not enabled yet until further testing, and some fixes to the optimizer which combines multiple values into a single token. FILESETDATETIME now supports a combined date and time if no time is given FILESETDATETIME FILENAME DATETIME DATETIME is in the format of a 14 digit integer, YYYYMMDDHHMMSS so 9:36:15pm October 29th, 2009 would be 20091029213615 ---------------------------------------------------------------------------- Tue, 27 October 2009 Modifed script compile and load code to not be specific to TOKEN32, tested as TOKEN64, but not enabled until further testing. Replaced all comparisons with NULLTOKENS to be non-specific to token type. ---------------------------------------------------------------------------- Wed, 22 October 2009 Removed TOKEN32 references in COLOR code, and a few other minor places. ---------------------------------------------------------------------------- Tue, 21 October 2009 Removed all references to TOKEN32 from ItemFree code, only remaining references to TOKEN32 are in some TOKEN management code, and in the compiled script data (a MUCH bigger step to replace). ---------------------------------------------------------------------------- Mon, 19 October 2009 Memory leak from creating duplicate threads when LAYERS were busy with an animation or expiration time, or other update. This could accumulate rapidly with any kind of frequently update layer like a blinking cursor. Replaced dangerous TerminateThread with new cooperative shutdown code to fix the leak problems. DLL functions are now stored in a separate tree from labels. The order of precedence is DLL functions first priority, followed by script labels, followed by internal commands. ---------------------------------------------------------------------------- Wed, 14 October 2009 Lots of new error checking in cases where we are out of memory, and cannot allocate a image buffer. Internal change to use 64bit tokens for fonts and images to start move to standardize on all 64bit tokens (only using 32bit tokens for compiled script files). ---------------------------------------------------------------------------- Sun, 11 October 2009 New HOTSPOT creation code which no longer creates the hotspot as an ative variable, and then adds to it. This could cause crashes if a WHEN or other active thread freed that hotspot. Now the hotspot is entirely local within the hotspot creation code until it is fully formed and activated. Also all responses to WHENs are now disabled during a HOTSPOT creation (just in case). ---------------------------------------------------------------------------- Wed, 07 October 2009 New safe interpreter shutdown added to code which free's instance data for interpreter. New error checking on shutdown for invalid pointers to our main instance data. ---------------------------------------------------------------------------- Thu, 01 October 2009 New system variable IMAGEANTISCALE which defaults to 10. IMAGEANTISCALE controls the degree of oversampling that IMAGEANTIWARP and IMAGEANTIROTATE use. Best results were found with an oversampling of 10 which is over 6x slower than the previous fixed value of 4. Values above 10 give only minor improvements at best and get dramatically slower and consume more memory. Use of very result areas with IMAGEANTIWARP or IMAGEANTISCALE and a large IMAGEANTISCALE may cause errors. ---------------------------------------------------------------------------- Wed, 30 September 2009 Fixed crashing bug in IMAGEINDEXPUT when coordinates in index image are out of range. Disabled Index background drawing because of bugs in color choice related in PNG image load/translate problems. Is added to bug list for future fix. Also discovered that ALPHA ON with a 64bit PNG does not display correctly, also added to bug list. ---------------------------------------------------------------------------- Tue, 29 September 2009 IMAGEINDEXPUT debugged, tested and working. The results are hundreds of times faster than the test script version. imageindexnew test64map 1000 1000 imagesavepng test64map ; ; edit test64map in Photoshop ; imageload test.jpg imageload test64map.png imageindexput test64map test Internal code for IMAGEPUT and IMAGEINDEXPUT combined since they are almost identical (IMAGEINDEXPUT only adds the index image). ---------------------------------------------------------------------------- Mon, 14 September 2009 Debug data for IEAfterGRASP made into smaller PDB for transportability (Edit/Continue disabled). ---------------------------------------------------------------------------- Tue, 08 September 2009 PM Added more error checking in FILEPUTVARIABLES, and removed most outdated references to 32bit tokens (moving source code to 64bit only). ---------------------------------------------------------------------------- Tue, 08 September 2009 FILEPUTVARIABLES could crash with exception error if used with wildcards like "*" (all variables). ---------------------------------------------------------------------------- Mon, 07 September 2009 Bug in new FILEGETVARIABLES code for attributes fixed. FILEPUTVARIABLES now sorts all array indexes using ASCII order to give consistent results and correct overwritten array entries from misordered indexes. This little test creates two text files that are identical: drawclear white with filestringalways on filestringstart "¬¬" filestringend "¬¬" xmlload xmlTable.xml set filestringalways on fileputvariables "c:\a.txt" xmltable free xmltable global filegetvariables("c:\a.txt") fileputvariables "c:\b.txt" xmlTable endwith exitnow ---------------------------------------------------------------------------- Sun, 06 September 2009 FILEPUTVARIABLES now writes array attributes, for instance: drawclear white a{bob} = hello a[jane] = goodbye memnew j fileputvariables mem:j a messagebox @@j exitnow FILEGETVARIBALES now reads array attributes, uses new code to build array references that is much faster and no longer calls ARRAYREF command. ARRAYAREF rewritten to use code in common with new FILEGETVARIABLES code for creating array references. Added more error checking to FILEPUTVARIABLES to handle large array indexes, and replaced most checks for null tokens in all of AG with new type generic version (simplified code, allowed more error checking). ---------------------------------------------------------------------------- Tue, 01 September 2009 FILEPUTVARIABLES now handles arrays with mixed case indexes. This comes up with XML documents, for example an EXCEL spreadsheet. Any array index that is not all lower case is put in quotes. FILEGETVARIABLES now handles array indexes in quotes, if an index is not in quotes, it is converted to lowercase. FILEPUTVARIABLES now puts values that have a semicolon into quotes since a semicolon is used to represent a comment. Simple test: drawclear white xmlload xmlTable.xml set variables on fileputvariables "c:\a.txt" xmlTable free xmltable local filegetvariables("c:\a.txt") fileputvariables "c:\b.txt" xmlTable s = @xmltable["Worksheet"]["Table"]["Row"][0]["Cell"][2]["Data"][1] messagebox @quote$@s$@quote exitnow ---------------------------------------------------------------------------- Wed, 25 August 2009 New code in FILEPUTVARIABLES to better handle measurements. Previously a capitals prefix of "MEASURE " was put in front of the value, and it was written with a fixed 3 decimal places so this displayed "MEASURE 1.300pt". Now it displays "1.3pt". It was also treating zero values as blank, so that b would display as "MEASURE ", it now displays as "0pt". drawclear white memnew j a = 1.3pt fileputvariables mem:j a messagebox @@j memnew k b = 0pt fileputvariables mem:k b messagebox @@k exitnow ---------------------------------------------------------------------------- Tue, 25 August 2009 Detailed new debug logged code added to trace some problems with BHO message loop. Can be enabled with new SET DEBUGLOGGING ON option, creates a file C:\AGDEBUGLOG_currentdate.LOG Default is OFF BHO Exit code rewritten to correctly close down thread, and send a mouse click to the IE window which in turn triggers a CommandState message to the TrapInvoke code. This fixes the strange hanging bug where the BHO wouldn't seem to exit until the mouse was moved. Bug where BHO could never run a different signed GL fixed, any open GLs are now free'd and closed from memory correctly which also fixes some security issues. ---------------------------------------------------------------------------- Thu, 06 August 2009 Bug in STRVARNAME (and internal variable name conversion code) which would give corrupt values for short invalid variable names like "+" is fixed. ---------------------------------------------------------------------------- Wed, 29 July 2009 Crash bug in SCRIPTCOMPILE when given a blank string fixed. Bug in opening GZIP compressed files, the file handle wouldn't be closed. ---------------------------------------------------------------------------- Mon, 20 July 2009 IEAfterGRASP uninstall now deletes the %APPDATA%\IEAfterGRASP folder and it's contents. ---------------------------------------------------------------------------- Thu, 16 July 2009 Bug in TEXTSTRPOSITIONHEIGHT fixed, it was ignoring TEXTFROMSTRIP setting, never stripping. ---------------------------------------------------------------------------- Wed, 15 July 2009 SET TEXTFROMSTRIP now strips ascii characters under 8 as well (used as special markers in some text projects). SCRIPTCOMPILE has the completely new STREVAL code for testing, it will handle any expression that AGCOMP can handle: drawclear white set texthtml on text "" textln SCRIPTCOMPILE("2*128") ; displays 256 a=var var[z]=3 textln SCRIPTCOMPILE("@(@a)[z]*128") displays 384 wait exitnow It does not behave exactly the same as STREVAL, I'm testing for compatability issues before replacing STREVAL. ---------------------------------------------------------------------------- Tue, 14 July 2009 SetTimer added to window hook code for IEAfterGRASP to prevent stalls from lack of messages at exit. Fixed some of the bounds checking in AGCOMP which was not comparing against the correct end of buffer. SCRIPTCOMPILE now generates a 1st pass compile of expressions only, being used to test code for a rewrite of STREVAL to use real compiler code from AGCOMP and handle any expression. For instance messagebox scriptcompile("256*128") gives "(128 256 multiply)" messagebox scriptcompile("@(@a)[z]*128") gives (128 ((z (a at) arrayref) at) multiply) ---------------------------------------------------------------------------- Thu, 09 July 2009 Two new system variables which default to ON/TRUE SET FILESIGNED ON/OFF SET GLSIGNED ON/OFF They control whether internal cryptographic signing checks are enabled or disabled. ---------------------------------------------------------------------------- Wed, 08 July 2009 New interpreter code to process WHENs while one of these commands are busy: HTTP POST HTTP POSTFILE HTTP POSTVAR HTTP GET HTTP GETFILE HTTP GETVAR FILEUNZIP FILEUNZIPAS FILEZIP FILEZIPAS FILESHA1 FILESHA2 FILECOPY FILECRC There may be some quirky behavior if complex operations like scriptcall or exit are done from inside a WHEN processed during one of those commands. ---------------------------------------------------------------------------- Mon, 06 July 2009 Added more error checking when opening a GL to check for invalid GL files, also added more checking for unsigned vs invalid GL files to eliminate false unsigned errors. Also added check for overflow on filename length inside a GL. ---------------------------------------------------------------------------- Wed, 24 June 2009 Bug in FILEPUTVARIABLES which would convert numeric indexes into strings, making arrays inaccessable is fixed. ---------------------------------------------------------------------------- Sun, 21 June 2009 STREVAL now handles expressions with quoted values, non-numeric strings, and variables mixed in like this: drawclear white messagebox streval("a$b$\"c d\"$f$e") messagebox streval("\"1\"$\"2\"$@glprodirectory$3$4") product = "yy" version = "xxx3" application = "zzz" user = "jbridges" account = "hhhhhhhh" baseDOMAIN = "192.168.2.101" s = "\"http://\"$@baseDOMAIN$\"/\"$@product$\"/\"$@version$\"/\"$@application$\"/\"$@user$\"/\"$@account$\"/\"" r = "http://"$@baseDOMAIN$"/"$@product$"/"$@version$"/"$@application$"/"$@user$"/"$@account$"/" messagebox strlist(streval(@s),@r) @s ---------------------------------------------------------------------------- Thu, 18 June 2009 Added support for 3 more RTF character tags to TEXTRTF support: \bullet \emdash \endash ---------------------------------------------------------------------------- Mon, 15 June 2009 STRHTMLCLEAN and STRHTMLREPAIR were both mishanding single tags, either removing them, or putting in strange null tag "" at the end of the text. There were also memory leaks (small ones) in the same code. Both problems are fixed. This includes BR & LI tags. ---------------------------------------------------------------------------- Fri, 12 June 2009 New Nasty bug in the WHEN fix made on 09 June 2009. It would cause AG to hang completely when a large number of repeating whens were triggered like when quickly moving a mouse when having a mouse movement when. Fixed. WHEN and EVENT queues increased to 4096 (was 2048). ---------------------------------------------------------------------------- Thu, 11 June 2009 Fixed some small bugs in IMAGETILE command (bleed option wasn't always being read). ---------------------------------------------------------------------------- Tue, 09 June 2009 New command KEYGETCOUNT, gives a count of how many keypresses are waiting in the input buffer (which can be read with successive KEYGET commands). Syntax is similar to KEYGET. KEYSPENDING = KEYGETCOUNT() KEYGETCOUNT VARNAME Serious bug in WHEN handling which could cause a crash, invalid label or other strange errors when a large number of whens are triggered in an overlapping way. For example pounding on the keyboard when a bunch of keyboard whens are defined. This bug started when AG switched to a seperate thread to handle events. INVALID LABEL error dialog now displays the invalid label (converted to a string, so it may not be useful). ---------------------------------------------------------------------------- Thu, 04 June 2009 HTTP POST/HTTP POSTVAR/HTTP POSTFILE and HTTP GET/HTTP GETVAR/HTTP GETFILE commands now update layer animations and whens while busy, but not in realtime (there are still delays between updates). IMAGEINDEXPUT code translated from AG test code, still untested. ---------------------------------------------------------------------------- Wed, 03 June 2009 Initial code for IMAGEINDEXPUT, main translate code not written yet so it behaves just like IMAGEPUT (Index image not used yet). IMAGEINDEXPUT IMGINDEX IMGNAME IMAGEINDEXPUT IMGINDEX XPOS YPOS IMGNAME IMAGEINDEXPUT IMGINDEX XPOS YPOS IMGNAME XSIZE YSIZE ---------------------------------------------------------------------------- Tue, 02 June 2009 IMAGEINDEXNEW written, syntax is similar to IMAGENEW: IMAGEINDEXNEW VARNAME IMAGEINDEXNEW VARNAME WIDTH HEIGHT IMAGEINDEXNEW VARNAME BITS IMAGEINDEXNEW VARNAME WIDTH HEIGHT BITS RESULT = IMAGEINDEXNEW() RESULT = IMAGEINDEXNEW(WIDTH,HEIGHT) RESULT = IMAGEINDEXNEW(BITS) RESULT = IMAGEINDEXNEW(WIDTH,HEIGHT,BITS) Default BITS is 64 The resulting image is where the color of each pixel is RED is calculated by XPOS/WIDTH GREEN is calculated by YPOS/HEIGHT BLUE is 1/2 ALPHA is MAXVALUE The resulting image buffer is to be used with image manipulation calculations using IMAGEINDEXPUT. ---------------------------------------------------------------------------- Mon, 01 June 2009 IEAfterGRASP no longer loads about:blank as the background page, instead it uses the URL for the GL, replacing the GL suffix with HTML. Small bug in TOMEASURE causing a fault with some high ascii characters fixed. ---------------------------------------------------------------------------- Sun, 31 May 2009 Early code for two new commands IMAGEINDEXNEW and IMAGEINDEXPUT added. IMAGEINDEXNEW IMGINDEX SIZEX SIZEY IMAGEINDEXPUT IMGINDEX XPOS YPOS IMGNAME XSIZE YSIZE They are not functional yet. I will document better once they are working. ---------------------------------------------------------------------------- Wed, 27 May 2009 Bug in STRFORMATNUMBER not handling conditional strings correctly (it was adding up the total number of digits required for all cases). Rewritten to maintain counts for each possible case (negative, zero and positive). Example: drawclear white format = "\"$\"#,##0;[Red]\-\"$\"#,##0" s = -52720 messagebox strlist(@format,@s) strformatnumber(@format, @s) exitnow ---------------------------------------------------------------------------- Wed, 13 May 2009 Bug in CMYK to RGB lookup table fixed, was broken since Feb 19th 2009. The table is written as R,G,B values, but the color code was assuming it was written as B,G,R (as are all RGB color values are stored in AfterGRASP). As part of figuring out this problem, all the RGB to CMYK and CMYK to RGB conversion has been generalized and put in at a low level to apply to all references to a Color value. This means that operations like drawing into a CMYK image using RGB colors, and vis versa now work. ---------------------------------------------------------------------------- Sun, 10 May 2009 Bug in IMAGELOAD when loading GIFs was preventing loading of multi-image GIFs. fixed. ---------------------------------------------------------------------------- Tue, 05 May 2009 Unirary operator support in STREVAL rewritten to use same code as AGCOMP. More operator code from AGCOMP made generic to be shared to AG runtime. ---------------------------------------------------------------------------- Mon, 04 May 2009 STREVAL now handles operator precidence. So for instance: messagebox streval("3*2+1") ; both display 7 messagebox streval("1+3*2") Now uses same operator parse code from AGCOMP (adapted to be more general purpose). Parenthesis in STREVAl still do not work correctly except for function calls. ---------------------------------------------------------------------------- Sun, 03 May 2009 STREVAL now handles simple operator expressions such as: STREVAL("10-5") ; gives 5 STREVAL("12/2") ; gives 6 Operators supported are: $ % ^ & && * :( / | || != - -> + == => =< < << <> <= > >> >= ---------------------------------------------------------------------------- Mon, 27 April 2009 Series of new functions to extract/convert measurements. ASINCHES ASMILLIMETERS ASPERCENTAGE ASPICAS ASPOINTS Example: drawclear white messagebox asinches(8.5in) ;gives 8.5 messagebox asmillimeters(10cm) ;gives 100. drawregion 0 0 639 479 messagebox aspercentage(320) ;gives 50. imagedensity 50 messagebox aspoints(100) ;gives 144. messagebox aspicas(75) ;gives 9. exitnow Coversions of percentages or pixels into inches/picas/points/millimeters are done using the X axis Coversions of inches/picas/points/millimeters or pixels into percentage are done using the X axis. ---------------------------------------------------------------------------- Thu, 16 April 2009 Small fixes to IMAGESAVEJPEG when using the smaller than filesize option (would sometimes be off by 1 in quality), and allow saving higher than 32bit per pixel images. FILEZIPAS was broken, it was adding twice as many files as requested with incorrect paths. ---------------------------------------------------------------------------- Wed, 08 April 2009 Added support for: LAYNAME->LAYERIMAGE LAYNAME->LAYERANIM LAYNAME->LAYERDEPTH All were null features until now. LAYER ABOVE and LAYER BELOW were not creating blank layers, fixed. ---------------------------------------------------------------------------- Tue, 07 April 2009 LAYNAME->LAYERSHOW (also callable as ELE_LAYERSHOW(LAYNAME)) is now supported. LAYER BELOW when acting on the top most layer was not working, fixed. FILEGETVARIABLES now supports standard INI file comments. Any text after a semicolon ';' until the end of that line is ignored. This does not include semicolons inside quotes. ; test a=1;comment b="1;";comment Gives a=1 b=1; ---------------------------------------------------------------------------- Sun, 05 April 2009 Long standing bug in floating point to text conversion fixed, had to do with rounding errors when dealing with a large number of fractional digits. Bug in conversion of RGB floating point to RGB integer not handling 0 and maximum values. They were both only getting .5 of their value. ---------------------------------------------------------------------------- Wed, 01 April 2009 Added a tiny little function CONDITIONAL, takes 3 parameters. RESULT = CONDITIONAL(BOOLVALUE,USETRUE,USEFALSE) drawclear white messagebox conditional(5==6,"TRUE","FALSE") messagebox conditional(5!=6,"TRUE","FALSE") exitnow (no, it's not a April Fool's day joke, it's for use in some complex XML strings evaluated with STREVAL) ---------------------------------------------------------------------------- Tue, 31 March 2009 LAYERRECT/DRAWRECT/LAYERBOX/DRAWBOX now supports DRAWXOR with all color bit depths. LAYERRECT/DRAWRECT/LAYERBOX/DRAWBOX now supports DRAWAND and DRAWOR with all hicolor bit depths from 24 bits per pixel up. LAYERBOXROUND and LAYERRECTROUND now supported (they did nothing before now). Faster bitmap operations for beyond 32bits per pixel when the source and destination are the same bit depth. ---------------------------------------------------------------------------- Wed, 25 March 2009 Bug in TEXT RECTS commands TEXTLINESRECTS, TEXTLINESRECTSFROM, TEXTSTRPOSITIONRECTS and TEXTSTRPOSITIONRECTSFROM not handling CENTER or BOTTOM for the Y position. They were using the calculated starting Y coordinate as the top of the area. Fixed. BHO tested with Internet Explorer 8, works fine. ---------------------------------------------------------------------------- Sun, 16 March 2009 Rounding down error when converting floating point RGB values (like those created by COLORMIX) into integer RGB values (such as 24bit, 32bit) fixed. ---------------------------------------------------------------------------- Thu, 12 March 2009 ARRAYPAIR was not including the attribute for the first item in the list. Fixed. New interal only floating point color representation added: RGB192 which is 64bit floating point double red, green and blu. RGB256 which is 64bit floating point double red, green, blu and alpha. For now, these are only used by the HSV calculations including commands like ColorSaturationSet, COLORMIX and by DRAWGRADIENT which uses floating point colors for dithering and blending. Several bugs in use of UINT64 colors fixed, was accidently converting 32bit color values into 64bit RGB color values. Also removed all the sloppy old conversions from UINT to color, leaving only a few simple cases. ---------------------------------------------------------------------------- Wed, 11 March 2009 Long standing issue with FOREVER and DELAY not yielding enough, and consuming too much CPU is fixed. May make response to some active WHENs slightly slower (1/1000th of a second). All wildcard matching of variables such as the FREE command and VARMATCH commands now support the '#' special character which matches 1 or more digits only. Example: drawclear white set texthtml on text "" set texthtml off test = 1 test1 = 1 testa8 = 1 test99 = 1 textln strlist(varmatch("test#")) ; gives test1 test99 textln strlist(varmatch("test?#")) ; gives testa8 test99 textln strlist(varmatch("test*")) ; gives test test1 testa8 test99 textln strlist(varmatch("test?*")) ; gives test1 testa8 test99 forever ---------------------------------------------------------------------------- Thu, 05 March 2009 Bug in MEASUREMENTS of zero size being converted to strings is fixed. Previously it would produce a null string. Bug in conversion to MEASUREMENTS to an integer is fixed, it was giving an address of the measurement object as an integer instead of converting the measurement into an integer. When converting a measurement into an integer, it now assumes conversion on the X axis. Bug in conversion to FLOAT of integer values like measurements, was always returning 0. Fixed. ---------------------------------------------------------------------------- Fri, 27 February 2009 New functions to create color values out of seperate channel values. COLORBYTE creates a color from bytes, 8bit values, 0 to 255 each COLORWORD creates a color from words, 16bit values, 0 to 65535 each COLORLONG creates a color from longs, 32bit values, 0 to 4294967295 each COLORVAL = COLORBYTE(RED,GREEN,BLUE) COLORVAL = COLORBYTE(RED,GREEN,BLUE,ALPHA) COLORVAL = COLORWORD(RED,GREEN,BLUE) COLORVAL = COLORWORD(RED,GREEN,BLUE,ALPHA) COLORVAL = COLORLONG(RED,GREEN,BLUE) COLORVAL = COLORLONG(RED,GREEN,BLUE,ALPHA) COLORGET and IMAGECOLORGET now support an optional fourth variable name used to get the alpha channel. COLORGET X Y CVAR COLORGET X Y RVAR GVAR BVAR COLORGET X Y RVAR GVAR BVAR AVAR IMAGECOLORGET IMAGEBUF X Y CVAR IMAGECOLORGET IMAGEBUF X Y RVAR GVAR BVAR IMAGECOLORGET IMAGEBUF X Y RVAR GVAR BVAR AVAR ---------------------------------------------------------------------------- Thu, 26 February 2009 IMAGECOLORGET now supports deep colors. COLORNAME now works with color values returned from @COLORNUM DRAWRECT and DRAWBOX now support 48bit/64bit/96bit/128bit color. Default color and maxcolor mask both fixed for 48bit/64bit/96bit/128bit color. Low level bitblt operations such as IMAGEPUT now support 48bit/64bit/96bit/128bit color images as source and destination. Supports flipx and flipy. They do not yet support scaling, masking, or alpha. ---------------------------------------------------------------------------- Wed, 25 February 2009 Long standing crash on exit bug caused by freeing up the temporary images used for fonts before the font is fixed. COLORGET now supports deep colors for R,G,B variables. So for 32bit or lower images, the range for each is still 0 to 255. But for 48bit/64bit images the range is 0 to 65535, and for 96bit/128bit images the range is 0 to 4294967295. Several crashes caused by some HTML string operators when dealing with characters over ascii 127 are fixed. ---------------------------------------------------------------------------- Tue, 24 February 2009 New deep color support in place. Previously variables like @COLORNUM were just a 32bit integer. Now it's a complex value that can be 24bit, 32bit, 48bit, 64bit, 96bit, or 128bit. This required changes to anywhere in AfterGRASP that a color is used, which is ALL over the place. I've run some test scripts, but because of the nature of these extensive changes there may be bugs in some more obscure color conversions, like CMYK, or with flood/mask routines. IMAGESAVEPNG byte order when saving 48bit/64bit images fixed. IMAGELOADPNG byte order when saving 48bit/64bit images fixed. Commands that are tested with 48bit color and working are DRAWPIXEL and COLOR with RGB values. Here is a simple test script: drawCLEAR white color black imagenew test48 100 100 48 imageset test48 for y from 0 count @drawheight for x from 0 count @drawwidth color (@x*65535)/(@drawwidth-1) (@y*65535)/(@drawwidth-1) 32768 drawpixel @x @y next next imageset imagesavepng test48.png exitnow IMAGESAVETIFF and IMAGELOADTIFF tested with 48bit/64bit images, and working. But 96bit/128bit are still not working. ---------------------------------------------------------------------------- Wed, 18 February 2009 Long standing bug with Webnavigate and other DLL specific features not working in ReleaseDLL version fixed. Had to do with some missing/conflicting settings in the ReleaseDLL properties. ---------------------------------------------------------------------------- Mon, 16 February 2009 New setable option controls whether HTML Links are active. Defaults to ON, if OFF no Hotspot is created by HTML <= or >= fixed. It was defaulting to a string comparison. Now it only defaults to a string comparison if both sides are a string, or for equal and not equal comparisons. Bug in IMAGEANTIWARP which would change the value of IMAGEFASTSCALE is fixed. ---------------------------------------------------------------------------- Thu, 12 February 2009 LIBXML upgraded to 2.7.3 All files are now compiled with VS 2008. Modular compiler still needs some work to work with the new VS 2008 object files. ---------------------------------------------------------------------------- Sun, 08 February 2009 Line spacing calculation now ignores the height of space, tab and non-printable characters (like tags). This fixes odd line spacing bugs with trailing spaces or tags. Bug in spacing and rendering of fonts that start with character cell 1 fixed. Showed up with Monsoon script font having truncated spacing, fixed. ---------------------------------------------------------------------------- Thu, 05 February 2009 LIBPNG updated to verion 1.2.34. More changes to prepare for >32bit colors. ---------------------------------------------------------------------------- Wed, 04 February 2009 The extra suffix of ".invalid" is now supported in URLs and in GL filenames. It's automatically removed as if it wasn't at the end of the GL filename/URL. This allows creation of URLs that won't open the GL in the browser as a plain file if the BHO isn't installed. Extensive changes as start of plan to support color values larger than 32bits. IMAGESAVETIFF now works fully, including reversing Alpha channel, and dropping alpha on images with IMAGEALPHA OFF. Has experimental support for saving 48, 64, 96, and 128bit images as well. 48bit and 64bit working 96bit and 128bit do not produce valid files. IMAGELOADTIFF now working. It forces all images with fewer than 24bits into a 32bit image buffer. It has experimental support for larger than 32bit images added. IMAGESAVEPNG has experimental support for 48, 64, 96 and 128bit images added. 48bit and 64bit working, 96bit and 128bit may never work (appears unsupported by PNG). IMAGESAVETIFF IMAGELOADTIFF IMAGESAVEPNG and IMAGELOADPNG now all save and load Alpha channel correctly. Here is a test script to prove it: drawclear white color white imagenew cirmask imageset cirmask drawclear white color black drawcirclefilled 200 200 100 100 imageset imagenew test 32 imageset test set texthtml on textln "Hello" color red textln "RED" color green textln "GREEN" color blue textln "BLUE" imageset imagealphaset test cirmask imagesavepng test.png imagesavetiff test.tif appshell open test.png drawclear yellow imageput test wait free test imageload test.png imagealpha on test drawclear yellow imageput test wait free test imageload test.tif imagealpha on test drawclear yellow imageput test appshell open test.tif wait exitnow ---------------------------------------------------------------------------- Tue, 03 February 2009 IMAGESAVEPNG had the Red and Blue values reversed, fixed. PNG Image load code had Red and Blue values reversed, fixed. Experimental support for 48, 64, 96 and 128bit images added to IMAGENEW, IMAGEPIECE, WINDOWSIZE and IMAGECONVERT commands. Images can be allocated but little else works since it appears no Windows API calls support more then 32bits per pixel. A lot of changes to try and make TIFF saving work, still writes unreadable files. I'll be upgrading the LibTIFF code tomorrow to see if that helps. WINSENDMESSAGE now supported, syntax is: WINSENDMESSAGE HWND MESSAGE WINSENDMESSAGE HWND MESSAGE WPARAM WINSENDMESSAGE HWND MESSAGE WPARAM LPARAM LRESULT = WINSENDMESSAGE(HWND,MESSAGE) LRESULT = WINSENDMESSAGE(HWND,MESSAGE,WPARAM) LRESULT = WINSENDMESSAGE(HWND,MESSAGE,WPARAM,LPARAM) HWND is a window handle MESSAGE is one of these strings, or an integer value: CLEAR CLOSE COPY CUT DESTROY PASTE PRINT PRINTCLIENT ---------------------------------------------------------------------------- Sun, 01 February 2009 Minor changes to WHEN processing. ---------------------------------------------------------------------------- Thu, 29 January 2009 Bug in DRAWLISTINSIDE which was matching zero size character cells. DRAWLISTINSIDE now has two additional optional parameters which control a seed point. Useful for when creating a text selection region that may start before the current drag point. ARRAYINDEX = DRAWLISTINSIDE(RECTARRAY, XPOS, YPOS) ARRAYINDEX = DRAWLISTINSIDE(RECTARRAY, XPOS, YPOS, SEEDX, SEEDY) ARRAYINDEX = DRAWLISTINSIDE(RECTARRAY, XPOS, YPOS, MINX, MINY, MAXX, MAXY) ARRAYINDEX = DRAWLISTINSIDE(RECTARRAY, XPOS, YPOS, MINX, MINY, MAXX, MAXY, SEEDX, SEEDY) ---------------------------------------------------------------------------- Tue, 27 January 2009 Added more error checking to ARRAYDELETE and ARRAYINSERT to handle a negative count. TEXT RECTS commands TEXTLINESRECTS, TEXTLINESRECTSFROM, TEXTSTRPOSITIONRECTS and TEXTSTRPOSITIONRECTSFROM now have the RECTARRAY continue all the way to the end of the text, even with zero values. ---------------------------------------------------------------------------- Mon, 26 January 2009 Measurements done in points, like 12pt are now preserved as type "point" when converted back to a string so for instance drawclear white messagebox 72pt/2 exitnow Will display as 36pt instead of 0.5in When combining points and metric measurements, the result will be provided as mm, not points. ---------------------------------------------------------------------------- Sun, 25 January 2009 Long standing bug in FILEZIP and FILEZIPAS which was using a date with the month one month ahead of time. Turns out that ZIP files use a month numbered from 0 to 11, not 1 to 12!! But still uses a day value from 1 to 31. Crazy! and, it's fixed. Same problem also affected FILEUNZIP, FILEUNZIPLIST and FILEUNZIPAS in reverse (date one month behind). Fixed. ---------------------------------------------------------------------------- Tue, 20 January 2009 Bug in use of the tag at the start of a line with multiple size fonts, the height was being lost. Bug in aligning multiple size fonts when the text wraps because of a newline instead of word wrap fixed (line height was being lost in 2nd pass of text format code). Bug in aligning multiple size fonts if the last character before a word wrap is the largest, the line height would be too short. Support added to track the character height above the baseline, this allows multiple sized fonts on the same line to align on the baseline. For example: drawclear white set texthtml on text "" set texthtmlantifont off testsub set texthtmlantifont on testsub wait exitnow testsub: fontfree "*" teststr = "" z = 7.2 for 35 teststr = @teststr$"A" z = @z*1.05 next teststr = @teststr$"
    " for 15 teststr = @teststr$"B" z = @z*1.05 next teststr = @teststr$"
    " text @teststr teststr = "" z = 72 for 35 teststr = @teststr$"C" z = @z*.95 next teststr = @teststr$"
    " text @teststr return FONTSAVE and FONTSAVECOMPRESSED now produce a AGF type 5 font which has a baseysize variable which is derived from the Ascent type property. It's the height of the character above the baseline. This AGF type 5 font will only load in this and future builds of AfterGRASP. Here is the layout structure for the AGP type 5 header: typedef struct { char id[4]; // 'A' 'G' 'F' 5 DWORD fontbytes; // bytes of font data (not including header size) INT32 xsize; INT32 ysize; INT32 logpixelsx; // dpi (pixels per inch) on x axis INT32 logpixelsy; // dpi (pixels per inch) on y axis INT32 topwidth; INT32 ascoff; INT32 fnumchars; INT32 gap; INT32 sgap; INT32 vgap; INT32 rotation; // normally 0 INT32 bits; // bits per pixel, normally 1. Use 8 for antialias BOOL32 anti; INT32 winfirstchar; INT32 winlastchar; INT32 iantiscale; // scale value for width values (original integer value used for older AGF files) INT32 averagewidth; INT32 yoffset; // value to add to Y coordinate before drawing each character // used for superscript/subscript fonts INT32 originalysize; // original y size from FONTDEFINE double fantiscale; // floating point scale value for width values INT32 baseysize; // height of character above the baseline (from Ascent) // AGFONTHEADERWIDTHS fwidths[]; // UINT16 fontindexcount; // UINT16 fontindex[]; // unsigned char fontdata[]; } AGFONTHEADER5, *LPAGFONTHEADER5; typedef struct { INT32 start; // starting pixel to draw from INT32 end; // ending pixel to draw from INT32 leftofs; // add before drawing (can be negative) INT32 rightofs; // add after drawing (can be negative) INT32 total; // total character width } AGFONTHEADERWIDTHS; ---------------------------------------------------------------------------- Thu, 15 January 2009 Bug in modular compiler not including WINDOWUPDATE when used in the old SET WINDOWUPDATE style fixed. ---------------------------------------------------------------------------- Tue, 13 January 2009 TEXT RECTS commands TEXTLINESRECTS, TEXTLINESRECTSFROM, TEXTSTRPOSITIONRECTS and TEXTSTRPOSITIONRECTSFROM now have entries for new lines (with html that's
    tags). The width is 1 pixel wide to avoid a null entry. Multi-character sequences like HTML bullet points still don't correctly add RECT entries, the code has been added to expand the width of multiple character width entries, but there needs to be some more code added to the bullet point draw code to handle this. AGCOMP script compiler now has checks to avoid RETURN or WHENRETURN from inside a active WITH/ENDWITH block. ---------------------------------------------------------------------------- Sun, 11 January 2009 DEBUG display of HOTSPOTs now includes whether the hotspot is enabled or disabled. VARIABLES debug display now updates even when DEBUG STEP has stopped script execution. ---------------------------------------------------------------------------- Thu, 08 January 2009 When running the BHO version of AfterGRASP, the WINDOWRESIZE system variable now defaults to ON/TRUE since the BHO doesn't control IE's window sizing. Redundant window re-draws caused by WM_ERASEBKGRD are fixed. In BHO, allowing IE to update the window when invalid handle or AG pointer is now prevented. But there are still white flicker problems from some untrapped draw messages when resizing the window. ---------------------------------------------------------------------------- Tue, 06 January 2009 WINDOWUPDATE changed to add a few options, and new @WINDOWUPDATECOUNT variable: @WINDOWUPDATECOUNT ; Current WINDOWUPDATECOUNT, if greater than zero ; changes to the window are drawn to the desktop WINDOWUPDATE ; Update entire window, doesn't change @WINDOWUPDATECOUNT WINDOWUPDATE ALL ; Update entire window, sets WINDOWUPDATECOUNT to 1 WINDOWUPDATE ON ; sets WINDOWUPDATECOUNT to 1 WINDOWUPDATE OFF ; sets WINDOWUPDATECOUNT to 0 WINDOWUPDATE SAVE ; decrements WINDOWUPDATECOUNT WINDOWUPDATE RESTORE ; increments WINDOWUPDATECOUNT WINDOWUPDATECOUNT can be used with WITH to make for easy save restore in drawing routines: with windowupdatecount off textln @str1 textln @str2 textln @str3 endwith ---------------------------------------------------------------------------- Sun, 04 January 2009 Bug in compiler which prevented any kind of IF statement inside a WITH block is fixed. New system variable which controls whether WINDOWRESIZE re-scales the window contents to fit the new window size. Defaults to ON. Has no effect if WINDOWRESIZE is OFF. SET WINDOWRESIZESCALE ON/OFF The effect is similar to: set windowresize on when testscale winresize windowscale @windowscalex @windowscaley endwhen But is done in realtime without any scripting required. ---------------------------------------------------------------------------- Tue, 30 December 2008 WHENRETURN was accidently leaving a _TAIL on the parameter stack which would accumulate and eventually give a stack overflow error or possibly a crash. Fixed. Three new system variables: SET WINDOWRESIZE ON @WINDOWRESIZEX @WINDOWRESIZEY WINDOWRESIZE defaults to OFF (0), when enabled window resizing is allowed, and WHEN WINRESIZE whens can be triggered. The @WINDOWRESIZEX and @WINDOWRESIZEY variables are never modified until a WHEN WINRESIZE is triggered. If no such when is defined, they will never be updated. WHEN RESIZETEST WINRESIZE ENDWHEN Runable example: drawclear white set texthtml on text "" set texthtml off set windowresize on when testresize winresize windowsize @windowresizex @windowresizey drawclear white drawregion color black textln @windowresizex$" "$@windowresizey endwhen forever ---------------------------------------------------------------------------- Mon, 29 December 2008 DRAWOFFSETCLIP now supports multiple offset areas. DRAWOFFSET, DRAWOFFSETCLIP, and DRAWOFFSETRESET all treat multiple offset areas as relative to each previous one given on a command line. This is so that the behavior matches separate commands. Example of using WITH with DRAWOFFSETSTACK: drawclear white drawoffset 200 300 400 500 drawoffset 20 30 40 50 messagebox strlist(@@drawoffsetstack) with drawoffsetstack array(0,0,100,200) messagebox strlist(@@drawoffsetstack) endwith messagebox strlist(@@drawoffsetstack) wait exitnow ---------------------------------------------------------------------------- Sun, 28 December 2008 The STACK system variable is now supported, it's read only. It gives the same value you see in the DEBUG window for the system parameter stack. Two new system variables DRAWOFFSETSTACK and DRAWREGIONSTACK, they give the current entire list of DRAWOFFSETs or DRAWREGIONS as an array. They are both readable and writable, for instance: local drawoffsetsave @drawoffsetstack drawoffsetreset drawclear white set drawoffsetstack @drawoffsetsave When setting DRAWOFFSETSTACK or DRAWREGIONSTACK, values should be in sets of 4 integers or an array of integers. No measurements or relative positions are supported to ensure saving and restoring a list of offsets or regions will always work. DRAWOFFSET and DRAWOFFSETRESET now support multiple offset areas in a single command. For instance these two lines drawoffsetreset @ax1 @ay1 @ax2 @ay2 drawoffset @bx1 @by1 @bx2 @by2 Can now be written as: drawoffsetreset @ax1 @ay1 @ax2 @ay2 @bx1 @by1 @bx2 @by2 Bug fixed in the handling of accessing arrays or system variables with multiple return values. For example: drawclear white set texthtml on text "" set texthtml off drawoffsetsave = @drawoffsetstack n = "drawoffsetsave" b = "n" local v strreplace(strlist(@@@b),@crlf,@quote$","$@quote) textln "("$@quote$strleft(@v,strlen(@v)-2)$")" wait exitnow ---------------------------------------------------------------------------- Thu, 18 December 2008 FILEPUTVARIABLES now handles a wide range of object types for informational purposes, like images, layers, and hotspots. Useful when using FILEPUTVARIABLES to create a debug message or log. For example: m = "CurrentDirectory:"$@quote$dirgetcurrent()$@quote$@crlf$@crlf for zn from 0 count @editfieldcount memnew jj 1 fileputvariables mem:jj editfields[@zn][fieldtype] editfields[@zn][varname] @editfields[@zn][varname] m = @m$@@jj$@crlf free jj next messagebox @m editfields Or to dump all variables to a file (similar to the GLPRO DEBUGSAVEVARS command): fileputvariables c:\varlist.txt varmatch("*") ---------------------------------------------------------------------------- Tue, 16 December 2008 Bug in Layer free code which could crash during shutdown fixed, it was attempting to update a no longer existant window, and trying to access a non-existant instance as part of that process. A new system variable, and two new commands for WHENs: ENDWHEN does a WHENFINISH WHENFINISH WHENRETURN SET WHENFINISHREQUIRED ON (default is OFF) New support for controlling overlapping WHENs. The new SET WHENFINISHREQUIRED ON option forces whens to never allow another when to be triggered until the previous WHEN is complete. This applies to all the whens created by HOTSPOT as well. The commands which control when a WHEN is finished are WHENFINISH which sigals the when processing has finished, and WHENRETURN which functions just like RETURN except it does a WHENFINISH as part of the RETURN code. WHENRETURN is more than just a WHENFINISH followed by a RETURN command because WHENRETURN will not allow a when to be triggered before the RETURN has happened. The ENDWHEN command automatically does a WHENFINISH for you. WHENFINISH takes no parameters. WHENRETURN functions exactly like RETURN (it accepts optional values to return, although this doesn't make much sense for WHEN or HOTSPOT since they have no support for return values). ---------------------------------------------------------------------------- Mon, 15 December 2008 Changed the way TOKEN32 and TOKEN64 operator overloads work trying to track down endless loop in use with AVLtree. ---------------------------------------------------------------------------- Thu, 11 December 2008 Start of new tag handling in STRHTMLCLEAN (required to fix tags that need reordering like "ABCDEF". Internal use of GetSetIntegerVar and GetSetStringVar simplified. ---------------------------------------------------------------------------- Wed, 10 December 2008 WHENENABLED System variable now supported, defaults to ON, when turned OFF all response to WHENs is stopped until re-enabled. SET WHENENABLED OFF Changed to internal DynamicArray class to fix some initialization errors. Removed some extra checking from internal DEBUG version (was making debugging painfully slow). ---------------------------------------------------------------------------- Tue, 09 December 2008 STRHTMLREPAIR and STRHTMLCLEAN were decrementing string positions they returned, fixed. These system variables fixed to not crash when accessed with no valid window available: drawand drawdensityx drawdensityy drawfilter drawor drawtint drawxor imageregionmask textcenter texthtml texthtmlantifont texthtmlspaces texthtmltabs texthtmlwinfont textindent textjustified textkern textkernsize textleft textmonospace textposx textposy textquick textright textscroll textshadowfilter texttabsize textwrap textwrappunct ---------------------------------------------------------------------------- Sun, 07 December 2008 New keyboard trap code in BHO which prevents IE from getting Ctrl-B, Backspace, Ctrl-I or Ctrl-U keys. May expand to all controls keys depending on usefulness of other default key bindings in IE. Most important this prevents Backspace from reseting a running BHO session. ---------------------------------------------------------------------------- Thu, 04 December 2008 Several bugs in filename handling overflow are fixed. This prevents several crash conditions when trying to use very long filenames. All version numbers are now shifted over so that instead of 1.2008.12.04 It's now 2008.12.04.01 And in the BHO, BHOobj.Version which used to give 120081204, now gives 2008120401. This is to solve the multiple release in one day problems with version numbers. ---------------------------------------------------------------------------- Wed, 03 December 2008 The default IMAGEDENSITY for an image created with IMAGENEW is now the same as the current IMAGEDENSITY. Previously it was always being set to 96. The parsing of the URL in the BHO looking for a GL name now ignores anything after the first '?'. ---------------------------------------------------------------------------- Tue, 02 December 2008 BHO ActiveX now tagged via IObjectSafetyImpl for INTERFACESAFE_FOR_UNTRUSTED_CALLER and INTERFACESAFE_FOR_UNTRUSTED_DATA. This fixes a bunch of warnings and errors. ---------------------------------------------------------------------------- Fri, 21 November 2008 IEAfterGRASP Version property now returns a integer value making comparisons much easier. About dialog boxes updated to use File version info (reduces work for me each time I product a new version). APPMUTEX for IEAfterGRASP changed to "Digi-products". Object name for ActiveX is now "Object" Test code to get version of BHO is now: ---------------------------------------------------------------------------- Tue, 18 November 2008 STRHTMLCLEAN is complete and tested. It removes any meaningless tags, doing a STRHTMLREPAIR first to repair any problem tag pairs, then removes all duplicate tags and empty tags CLEANSTRING = STRHTMLCLEAN(STRING) Runable test example: drawclear white set texthtml on textln "" set texthtml off teststrhtmlclean "Hello","Hello" teststrhtmlclean "Hello","Hello" teststrhtmlclean "Hello","Hello" wait exitnow teststrhtmlclean: declare s1 s2 textln "original: "$@quote$@s1$@quote textln "repair: "$@quote$strhtmlrepair(@s1)$@quote textln "clean: "$@quote$strhtmlclean(@s1)$@quote textln "correct: "$@quote$@s2$@quote textln return ---------------------------------------------------------------------------- Tue, 11 November 2008 IEAfterGRASP has new SetSite code which correctly returns the the base class implementation. This fixes the problems with ActiveXObject use from Javascript in IE always failing. IEAfterGRASP Invoke method rewritten to check for null pointers, and to call the base Invoke COM class to handle the Version property (and other future methods/properties). The IEAfterGRASP Version property now gives the version of the IEAfterGRASP.dll (was giving the version of Internet Explorer). These three fixes mean the example from yesterday now works correctly. ---------------------------------------------------------------------------- Mon, 10 November 2008 Registry settings for IEAfterGRASP fixed to match Microsoft example, this also includes a entry for the App's CLSID. ATL now used for the IEAfterGRASP startup. IEAfterGRASP reading of window dimensions are fixed in IE7 (was including toolbar height). IEAfterGRASP no longer loads if called from EXPLORER.EXE (prevents slowdowns and waste). IEAfterGRASP ActiveX object now provides a Version property: ---------------------------------------------------------------------------- Wed, 22 October 2008 When using a non-unicode font, or font with no unicode characters, or when translating HTML to plain text or Flash text, the unicode base & codes are now translated into these characters: '¢', ¢ '©', © '°', ° '?',   '?',   'Ð', Ð 'ð', ð '€', € '«', « '“', “ '‘', ‘ '—', — 'µ', µ '–', – '¬', ¬ '¶', ¶ '»', » '”', ” '’', ’ '®', ® '§', § 'Þ', Þ 'þ', þ '™', ™ STRTRIMDOMAIN fixed to accept a STARTPOS (was screwing up). STRRESULT = STRTRIMDOMAIN(STRVAL) STRRESULT = STRTRIMDOMAIN(STRVAL, STARTPOS) STRSEARCHEMAIL STRSEARCHURL STRTRIMEMAIL STRTRIMURL are now all written, working and tested. STRPOS = STRSEARCHEMAIL(STRVAL) STRPOS = STRSEARCHEMAIL(STRVAL, STARTPOS) STRPOS = STRSEARCHURL(STRVAL) STRPOS = STRSEARCHURL(STRVAL, STARTPOS) STRRESULT = STRTRIMEMAIL(STRVAL) STRRESULT = STRTRIMEMAIL(STRVAL, STARTPOS) STRRESULT = STRTRIMURL(STRVAL) STRRESULT = STRTRIMURL(STRVAL, STARTPOS) drawclear white set texthtml on textln "" s = "hello there http://www.test.com and more" textln strtrimurl(@s) textln strsearchurl(@s) s = "hello there email@gmail.com and more" textln strtrimemail(@s) textln strsearchemail(@s) wait ---------------------------------------------------------------------------- Thu, 16 October 2008 Some of the new string tree code added yesterday made use of the c++ runtime which pulled in a lot of extra runtime code, and caused some problems. This was also making the runtime slightly larger, and caused the modular compiler to fail when the FILEUNZIP or FILEUNZIPAS commands were used. ---------------------------------------------------------------------------- Wed, 15 October 2008 FILEUNZIP and FILEUNZIPAS will now created nested directories as needed with no limitations on order or depth. They keep a tree index of which directories were created to prevent trying to re-create directories for each file. DIRCREATE will now create multiple depth directories in a single command. For instance these sequence of dircreates: dircreate "f:\a" dircreate "f:\a\b" dircreate "f:\a\b\c" dircreate "f:\a\b\c\d" Can now be done with a single dircreate dircreate "f:\a\b\c\d" ---------------------------------------------------------------------------- Tue, 14 October 2008 STRTRIMDOMAIN and STRSEARCHDOMAIN are now finished and working. New commands for unzipping and listing ZIP files. FILEUNZIP FILEUNZIPAS and FILEUNZIPLIST. FILEUNZIP ZIPFILENAME FILEUNZIP ZIPFILENAME WILDMATCH NAMEARRAY = FILEUNZIP(ZIPFILENAME) NAMEARRAY = FILEUNZIP(ZIPFILENAME, WILDMATCH) FILEUNZIPAS ZIPFILENAME SOURCENAME DESTNAME LISTARRAY = FILEUNZIPLIST(ZIPFILENAME) windowsize 800 800 drawclear white set texthtml on textln "" list = array(strsplit(drivefilelist(0, "*.gls"),@crlf)) filezip test.zip @list listarray = fileunziplist(test.zip) for a from 0 count listarray->size textln strpad(@listarray[@a][compressed],12)$" "$@listarray[@a][name] next dircreate temp filedelete "temp\*" dirchange temp result = fileunzip("..\test.zip") textln textln "FILEUNZIP Extracted result" for a from 0 count result->size textln @result[@a] next textln textln "Directory list" textln strreplace(drivefilelist(0, "*"),@crlf,"
    ") dirchange ".." filedelete "temp\*" dirchange temp for a from 0 count listarray->size namelist[@a*2] = @listarray[@a][name] namelist[@a*2+1] = strreplace(@listarray[@a][name],".gls",".txt") next result = fileunzipas("..\test.zip",@namelist) textln textln "FILEUNZIPAS Extracted result" for a from 0 count result->size textln @result[@a] next textln textln "Directory list" textln strreplace(drivefilelist(0, "*"),@crlf,"
    ") dirchange ".." filedelete "temp\*" set variables on wait exitnow ---------------------------------------------------------------------------- Mon, 13 October 2008 "Happy Columbus Day!" PNGSAVE fixed, was not working for a long time. Now writes 32bit images as 24bit unless IMAGEALPHA is enabled in that image. Also supports writing 1, 4 and 8 bit per pixel images. Here is a simple test: drawclear white color white imagenew cirmask imageset cirmask drawclear black color white drawcirclefilled 200 200 100 100 imageset imagenew test 32 imageset test set texthtml on textln "Hello" color red textln "RED" color green textln "GREEN" color blue textln "BLUE" imageset imagealphaset test cirmask imagesavepng test.png appshell open test.png exitnow ---------------------------------------------------------------------------- Thu, 09 October 2008 Bug in DRAWGRADIENT which would get confused if multiple numeric values were used for color and percentage is fixed. Bug in detecting hex numeric strings that have a '#' prefix is fixed. TEXTHTML now supports these additional tags (some require unicode fonts): Å 0x212B ¢ 0x00A2 © 0x00A9 ‡ 0x2021 † 0x2020 ° 0x00B0   0x2003   0x2002 Ð 0x00D0 ð 0x00F0 € 0x20AC ½ 0x00BD « 0x00AB “ 0x201c ‘ 0x2018 — 0x2014 µ 0x00B5 · 0x00B7 – 0x2013 ¬ 0x00AC   0x2007 ¶ 0x00B6 ‰ 0x2030   0x2008 » 0x00BB ” 0x201d ’ 0x2019 ® 0x00AE § 0x00A7 Þ 0x00DE þ 0x00FE ™ 0x2122 Stubs for new commands for searching for, and trimming down domain names, email addresses, and URLs. NOT WORKING YET (Also, STRHTMLCLEAN is still not working). STRPOS = STRSEARCHDOMAIN(STRVAL) STRPOS = STRSEARCHDOMAIN(STRVAL, STARTPOS) STRPOS = STRSEARCHEMAIL(STRVAL) STRPOS = STRSEARCHEMAIL(STRVAL, STARTPOS) STRPOS = STRSEARCHURL(STRVAL) STRPOS = STRSEARCHURL(STRVAL, STARTPOS) STRRESULT = STRTRIMDOMAIN(STRVAL) STRRESULT = STRTRIMDOMAIN(STRVAL, STARTPOS) STRRESULT = STRTRIMEMAIL(STRVAL) STRRESULT = STRTRIMEMAIL(STRVAL, STARTPOS) STRRESULT = STRTRIMURL(STRVAL) STRRESULT = STRTRIMURL(STRVAL, STARTPOS) ---------------------------------------------------------------------------- Fri, 03 October 2008 Bug in IEAfterGRASP which prevented DEBUG and VARIABLES dialogs is fixed. The internal HInstance variable wasn't being setup correctly, which kept those dialogs from being found. ---------------------------------------------------------------------------- Thu, 02 October 2008 NULL Pointer Crashing bug in IEAfterGRASP (BHO Specific runtime) fixed. Had to do with an empty command line parsing. IEAfterGRASP in addition to parsing the URL for variable names, it also creates a @urldomainname variable which is the domain name parsed from the url. ---------------------------------------------------------------------------- Wed, 01 October 2008 Two new system variables: @SYSBHO @SYSBROWSER SYSBHO defaults to 0 in the normal AfterGRASP engine, and to 1 (TRUE) when running in the Browser Helper Object version of AfterGRASP (also called IEAfterGRASP). SYSBROWSER is blank in the normal AfterGRASP engine, and has a string containing the browser type and version when running in IEAfterGRASP. ---------------------------------------------------------------------------- Mon, 29 September 2008 Bug in STRLEFTHTML, STRLEFTRIGHTHTML, STRRIGHTHTML and STRMIDHTML which was putting trailing tags in reverse order is fixed. This has been in there ever since these functions were introduced. Also the case of added trailing tags now matches the case (upper vs lower) of the leading tags. DRAWOFFSETCLIP was clipping to the current DRAWREGION instead of DRAWOFFSET. Fixed. It now clips to the current active DRAWOFFSET. STRHTMLREPAIR now working: drawclear white color black s = "biuHeyThere" textln @s textln strhtmlrepair(@s) wait exitnow For example given this test string "biuHeyThere" STRHTMLREPAIR produces: "biuHeyThere" ---------------------------------------------------------------------------- Thu, 25 September 2008 New command DRAWOFFSETCLIP, works exactly like DRAWOFFSET except the coordinates are clipped to the previous DRAWOFFSET. This means you can use DRAWOFFSETCLIP to contract a drawing area, but not expand it. DRAWCLIPX and DRAWCLIPY rewritten to work better with DRAWOFFSET. All TEXT commands now correctly crop inside a DRAWOFFSET even if the draw region goes outside the draw area. ---------------------------------------------------------------------------- Tue, 23 September 2008 Limits in STRLEFTHTML, STRRIGHTHTML, STRMIDHTML and STRLEFTRIGHTHTML that prevented them from working with large numbers of tags, or complex cross nested tags are fixed by replacing fixed array code with new dynamic code used in STRHTMLTAGREMOVE. This also simplifies the codebase somewhat. ---------------------------------------------------------------------------- Thu, 18 September 2008 New crashing bug in STRHTMLTAGS fixed (was introduced in previous build since STRHTMMLTAGS uses the same underlying code as STRHTMLTAGREMOVE). Bug in STRLEFTHTML, STRRIGHTHTML, STRMIDHTML and STRLEFTRIGHTHTML where the end of a block is inside a tag would give an extra closing tag is fixed. ---------------------------------------------------------------------------- Tue, 16 September 2008 New function STRHTMLTAGREMOVE strips out specific tags, and can remove specific attributes. RESULTSTR = STRHTMLTAGREMOVE(STR, TAGNAME) RESULTSTR = STRHTMLTAGREMOVE(STR, TAGNAME, "") RESULTSTR = STRHTMLTAGREMOVE(STR, TAGNAME, ATTRIBNAME) RESULTSTR = STRHTMLTAGREMOVE(STR, TAGNAME) Removes any instance of TAGNAME with any attribute RESULTSTR = STRHTMLTAGREMOVE(STR, TAGNAME, "") Removes any instance of TAGNAME with no attributes. If the tag has any attributes, it is not removed. RESULTSTR = STRHTMLTAGREMOVE(STR, TAGNAME, "") Removes any instance of ATTRIBUTE that occurs under tags that match TAGNAME. If a tag has no remaining attributes, the empty tag is not removed. This example shows removing different font tags: drawclear white color black t1 = "Arial" t2 = strhtmltagremove(@t1, font, face) t3 = strhtmltagremove(@t2, font, size) t4 = strhtmltagremove(@t3, font, "") t5 = strhtmltagremove(@t1, font) set variables on wait exitnow ---------------------------------------------------------------------------- Wed, 10 September 2008 New function STRHTMLTAGARRAY returns an array of tags, the numerical index for each tag is the string position in the HTML string. The attribute for that array value is the string position of the terminating tag. For example: tagarraya = strhtmltagarray("hello") ; tagarraya[1] = "b" ; tagarraya{1} = 9 tagarrayb = strhtmltagarray("Arial") ; tagarrayb[1] = "i" ; tagarrayb{1} = 33 ; tagarrayb[4] = "font" ; tagarrayb{4} = 26 STRHTMLTAGS and STRHTMLTAGARRAY will not include
    and

    tags that have no closing tag. A note on clipboard use in AfterGRASP. In AfterGRASP the clipboardGET commands all return the clipboard, they don't set a variable. drawclear white color black clipboardCLEAR ;clear the Windows clipboard clipboardPUTTEXT "Hello there" textln clipboardGETTEXT() ;displays "Hello there" wait This applies to RTF text and images as well: drawclear white set texthtml on text "" text strrtftohtml(clipboardgettextrtf()) wait And here is a more complete example that checks a string if it's a valid URL or valid eMail address: drawclear white color black messagebox ValidURLCheck("http://www.google.com/test?") "http://www.google.com/test?" messagebox ValidURLCheck("http://www.1google.com/test?") "http://www.1google.com/test?" messagebox ValidURLCheck("http://www.google.c1om/test?") "http://www.google.c1om/test?" messagebox ValidURLCheck("http://www.g_oogle.com/test?") "http://www.g_oogle.com/test?" messagebox ValidURLCheck("www.google.com/test?") "www.google.com/test?" messagebox ValidURLCheck("http://192.168.2.2@admin:test") "http://192.168.2.2@admin:test" messagebox ValidEmailCheck("rob.howarth@eu.jll.com") "rob.howarth@eu.jll.com" messagebox ValidEmailCheck("john.hello@ibm.com") "john.hello@ibm.com" messagebox ValidEmailCheck("john.hello@ibm.coma") "john.hello@ibm.coma" messagebox ValidEmailCheck("john.hello@ibm.c1om") "john.hello@ibm.c1om" messagebox ValidEmailCheck("john.@hello@ibm.com") "john.@hello@ibm.com" messagebox ValidEmailCheck("john.@hello@ibm.co.uk") "john.@hello@ibm.co.uk" messagebox ValidEmailCheck("john.@hello@ibm.co.k") "john.@hello@ibm.co.k" exitnow ValidEmailCheck: declare emailstr local atcount 0 for i count strlen(@emailstr) c = strmid(@emailstr, @i, 1) if @c=="@"&&!@atcount inc atcount continue endif if strsearch("_%+-.0123456789",@c) continue if strupper(@c)==strlower(@c) failemail next domainstr = strleftright(@emailstr, strsearch(@emailstr, "@")+1) return ValidDomainCheck(@domainstr) failemail: return @FALSE ValidURLCheck: declare urlstr for i count strlen(@urlstr) c = strmid(@urlstr, @i, 1) if strsearch("-_.!~*'()a-zA-Z0-9;/?:@&=+$,%#0123456789",@c) continue if strupper(@c)==strlower(@c) failurl next urlstr = strlower(@urlstr) if strleft(@urlstr,4)=="www." else if strleft(@urlstr,7)=="http://" urlstr = strleftright(@urlstr, 8) else if strleft(@urlstr,8)=="https://" urlstr = strleftright(@urlstr, 9) else if strleft(@urlstr,6)=="ftp://" urlstr = strleftright(@urlstr, 7) else goto failurl endif domainstr = @urlstr if strsearch(@domainstr, "/") domainstr = strleft(@domainstr, strsearch(@urlstr, "/")-1) endif if strsearch(@domainstr, "@") domainstr = strleft(@domainstr, strsearch(@urlstr, "@")-1) endif if strsearch(@domainstr, ":") domainstr = strleft(@domainstr, strsearch(@urlstr, ":")-1) endif return ValidDomainCheck(@domainstr) failurl: return @FALSE ValidDomainCheck: declare domainstr if !strsearch(@domainstr, ".") faildomain if strleft(@domainstr,1)=="."||strright(@domainstr,1)=="." faildomain local anyletter @FALSE for i count strlen(@domainstr) c = strmid(@domainstr, @i, 1) if strsearch(".0123456789",@c) continue anyletter = @TRUE if strupper(@c)==strlower(@c) faildomain next if @anyletter domainsuffix = strlower(strleftright(@domainstr, strsearchreverse(@domainstr, ".")+1)) for i count strlen(@domainsuffix) c = strmid(@domainsuffix, @i, 1) if strupper(@c)==strlower(@c) faildomain next if strlen(@domainsuffix)<2 faildomain if strlen(@domainsuffix)>2 local domains array("com","org","net","gov","mil","biz","info","mobi","name","aero","jobs","museum") if !arraysearch(&domains, @domainsuffix)->size faildomain endif endif return @TRUE faildomain: return @FALSE ---------------------------------------------------------------------------- Mon, 08 September 2008 STRHTMLTAGS changed to return an array, not a list of seperate values. This is because the index of the array is the string position where each tag is found in the string. TAGLISTARRAY = STRHTMLTAGS(STRING, POSITION) The count for STRMID now defaults to 1 if none given, for example this routine checks a string to see if it's a valid email address: drawclear white color black messagebox ValidEmailCheck("john.hello@ibm.com") "john.hello@ibm.com" messagebox ValidEmailCheck("john.hello@ibm.coma") "john.hello@ibm.coma" messagebox ValidEmailCheck("john.hello@ibm.c1om") "john.hello@ibm.c1om" messagebox ValidEmailCheck("john.@hello@ibm.com") "john.@hello@ibm.com" messagebox ValidEmailCheck("john.@hello@ibm.co.uk") "john.@hello@ibm.co.uk" messagebox ValidEmailCheck("john.@hello@ibm.co.k") "john.@hello@ibm.co.k" exitnow ValidEmailCheck: declare emailstr local atcount 0 for i count strlen(@emailstr) c = strmid(@emailstr, @i) if @c=="@"&&!@atcount inc atcount continue endif if strsearch(".0123456789",@c) continue if strupper(@c)==strlower(@c) fail next domainstr = strleftright(@emailstr, strsearch(@emailstr, "@")+1) if !strsearch(@domainstr, ".") fail domainsuffix = strlower(strleftright(@domainstr, strsearchreverse(@domainstr, ".")+1)) for i count strlen(@domainsuffix) c = strmid(@domainsuffix, @i) if strupper(@c)==strlower(@c) fail next if strlen(@domainsuffix)<2 fail if strlen(@domainsuffix)>2 local domains array("com","org","net","gov","mil","biz","info","mobi","name","aero","jobs","museum") if !arraysearch(&domains, @domainsuffix)->size fail endif return @TRUE fail: return @FALSE ---------------------------------------------------------------------------- Wed, 20 August 2008 STRHTMLREPAIR and STRHTMLCLEAN now have one or more optional position options. SET RESULT STRHTMLREPAIR(STR) SETS RESULT NEWPOS1 STRHTMLREPAIR(STR, POS1) SETS RESULT NEWPOS1 NEWPOS2 STRHTMLREPAIR(STR, POS1, POS2) SET RESULT STRHTMLCLEAN(STR) SETS RESULT NEWPOS1 STRHTMLCLEAN(STR, POS1) SETS RESULT NEWPOS1 NEWPOS2 STRHTMLCLEAN(STR, POS1, POS2) POS is a string position from 1 to the length of STR Any number of string positions are supported (not just 1 or 2). Useful for tracking a position in a HTML string after it's been repaired or cleaned, for instance: rstr = "Hello There" rstrstart = strsearch(@rstr, "Hello") rstrend = strsearch(@rstr, "There")-1 sets rstr rstrstart rstrend strhtmlclean(@rstr, @rstrstart, @rstrend) messagebox @rstr strmidhtml(@rstr, @rstrstart, @rstrend-@rstrstart) ; shows "Hello" ---------------------------------------------------------------------------- Sun, 10 August 2008 Fixed several crashing bugs with IMAGEPUT and other image operations when DRAWOFFSET is set to coordinates outside valid coordinates. All the TEXTRECTS commands now have the RIGHT edge value stored at the start of the list corrected. It was too large, having the left position added to it twice by accident. DRAWLISTIMAGE has been expanded to have 3 more (optional) options. IMAGEBUF = DRAWLISTIMAGE(DRAWLIST) IMAGEBUF = DRAWLISTIMAGE(DRAWLIST, STARTPOS) IMAGEBUF = DRAWLISTIMAGE(DRAWLIST, STARTPOS, COUNT) IMAGEBUF = DRAWLISTIMAGE(DRAWLIST, STARTPOS, COUNT, COLOR) DRAWLIST is the array of rectangles, generally created by TEXTLINESRECTS. STARTPOS is the offset to start drawing from the list from, default is 1 COUNT is the number of RECTS to draw from the list, default is all. COLOR is a color to draw the RECTS in, default is to use index as color value. These options make it possible to use DRAWLISTIMAGE to create a mask used to show a selected body of text. For instance, something like this: drawclear white color black rectarray = textlinesrects("Hello There") rectimage = drawlistimage(rectarray, 2, 4, white) with drawxor on imageput rectimage wait New WHEN option "OTHER" used in the same circumstances as INSIDE and OUTSIDE. WHEN name MOUSE[DOWN|UP][1|2|3] OTHER It is triggered if no other defined whens are triggered by the MOUSEUP or MOUSEDOWN eventid. This is useful for handling the case where someone clicks outside all active hotspots or other WHEN INSIDE whens. ---------------------------------------------------------------------------- Thu, 07 August 2008 Three new commands, STRHTMLTAGS, STRHTMLREPAIR and STRHTMLCLEAN. STRHTMLCLEAR and STRHTMLREPAIR are still under development and do not work correctly yet. STRHTMLTAGS gives a list of active tags at that string position. It returns multiple values, so you would commonly use functions like ARRAY or STRLIST on the return values. TAGLIST = ARRAY(STRHTMLTAGS(STRING, POSITION)) For instance strhtmltags("
    Hello
    ",4) gives "b". Tags are converted to all lower case. STRHTMLREPAIR removes any duplicate/redundant tags, fixes mismatched trailing tags, and adds any missing trailing tags. REPAIRSTRING = STRHTMLREPAIR(STRING) For instance: strhtmlrepair("Hello") gives "Hello" strhtmlrepair("Hello") gives "Hello" strhtmlrepair("Hello") gives "Hello" strhtmlrepair("Hello") gives "Hello" strhtmlrepair("Hello There") gives "Hello There" strhtmlrepair("Hello There") gives "Hello There" STRHTMLCLEAN removes any meaningless tags. It does a STRHTMLREPAIR first to repair any problems. CLEANSTRING = STRHTMLCLEAN(STRING) For instance: strhtmlclean("Hello") gives "Hello" strhtmlclean("Hello") gives "Hello" strhtmlclean("Hello") gives "Hello" ---------------------------------------------------------------------------- Mon, 28 July 2008 Bug in FONTDEFINE and WINFONT which would give no character spacing with all characters run together fixed. It would only happen with very old or quirky fonts that did not support the GetCharABCWidths API call. Fixed some minor exceptions in FILEGETVARIABLES and a few other commands having to do with signed conversion of characters being passed to some library functions like isalnum(). ---------------------------------------------------------------------------- Wed, 16 July 2008 The VARIABLES debug dialog now has a "Expand LgArrays" checkbox which defaults to OFF. When OFF only the first four elements of any arrays are displayed in the VARIABLES dialog. This is because large arrays are so cumbersome to read in the variables display, they are not expanded to their full view unless you check this checkbox. ---------------------------------------------------------------------------- Mon, 14 July 2008 The VARIABLES debug dialog now has a input field, it's a wildcard match for variable names. It allows you to only show variables which match whatever string you type. Syntax is identical to wildcards in the FREE commands. You may need to use the REFRESH button to update the view. Bug in DRAWLISTLINEPREV and DRAWLISTLINENEXT which could crash if ROOTINDEX was out of bounds is fixed. ---------------------------------------------------------------------------- Thu, 10 July 2008 DRAWLISTLINEBEGIN and DRAWLISTLINEEND fixed at start and end of text. More error checking added to DRAWLISTEND DRAWLISTBEGIN DRAWLISTNEXT and DRAWLISTPREV. DRAWLISTLINENEXT and DRAWLISTLINEPREV now try to preserve the horizontal position. DRAWLISTLINENEXT and DRAWLISTLINEPREV now support an optional root index used to preserve the horizontal position from a root position. Useful for maintaining a relative position when arrowing serveral lines up or down at once. ARRAYINDEX = DRAWLISTLINENEXT(RECTARRAY, INDEX) ARRAYINDEX = DRAWLISTLINENEXT(RECTARRAY, INDEX, ROOTINDEX) ARRAYINDEX = DRAWLISTLINEPREV(RECTARRAY, INDEX) ARRAYINDEX = DRAWLISTLINEPREV(RECTARRAY, INDEX, ROOTINDEX) ---------------------------------------------------------------------------- Wed, 09 July 2008 The WHENTRIGGER command is now supported. It activates a WHEN even if the required action has not happened (keypress, mouse click, countdown timer or whatever). It supports wildcards like WHENENABLE and WHENDISABLE. DRAWLISTIMAGE now fills each rectangle to the edge of the image, this means there will be no pixels in the image that are not filled. DRAWLISTINSIDE now gives the next character position if the xpos/ypos is to the right of the center of a cell. This simulates the way text click/selection works in most GUIs, when clicking on a character, if you click on the left side, the cursor is placed before the character, if clicking on the right side, the cursor is placed after the character. DRAWLISTLINEBEGIN and DRAWLISTLINEEND now working. Crashing bug in TEXTSTRPOSITIONRECTS and TEXTLINESRECTS fixed. TEXT RECTS commands TEXTLINESRECTS, TEXTLINESRECTSFROM, TEXTSTRPOSITIONRECTS and TEXTSTRPOSITIONRECTSFROM have the RECTARRAY updated so that the left edge is no longer offset by a character. Coordinate fill code rewritten to fix multiple problems like this. ---------------------------------------------------------------------------- Mon, 07 July 2008 New command to help with DRAWLISTS, DRAWLISTIMAGE. It returns an image created as large as the DRAWLIST area. It's 32bits per pixel filled with rectangles for each item in the list. The color of each rectangle is the position in DRAWLIST (with 1 being the first). This allows instant translation from coordiantes into DRAWLIST position (and thereby string position). RECTARRAY = TEXTLINESRECTS(TEXTSTRING) RECTIMAGE = DRAWLISTIMAGE(RECTARRAY) STRINGPOSITION = IMAGECOLORGET(RECTIMAGE,@XPOS,@YPOS) TEXT RECTS commands TEXTLINESRECTS, TEXTLINESRECTSFROM, TEXTSTRPOSITIONRECTS and TEXTSTRPOSITIONRECTSFROM have the RECTARRAY updated so that it now has the full width of each character cell including any gap between characters. ---------------------------------------------------------------------------- Wed, 02 July 2008 Bug recently introduced in the size of a space character in newly defined fonts created with WINFONT or created with the "" tag. The space size was zero (no spacing at all), fixed. Added two new commands CLIPBOARDGETTEXTRTF and CLIPBOARDPUTTEXTRTF, they work exactly like the CLIPBOARDGETTEXT and CLIPBOARDPUTTEXT commands except they operate on RTF formatted text. Simple example: drawclear white set texthtml on text "" text strrtftohtml(clipboardgettextrtf()) wait exitnow ---------------------------------------------------------------------------- Tue, 01 July 2008 ERRORLOAD OFF was not working for missing files, fixed. Fixed some mismatched declarations for AGIMAGE vs LPAGIMAGE which were causing some odd debug issues. ---------------------------------------------------------------------------- Mon, 30 June 2008 IMAGEPUT with a DRAWREGION outside a DRAWOFFSET was drawing outside the DRAWOFFSET area, fixed. MEMSCAN commands, FILEPUTCHARIABLES, FILEPUTARRAY and FILEPUTARRAYNAMED commands updated for 64bits. Internal source update, all TOKEN pointers now use a new LP type, same with AGMEASURE. ---------------------------------------------------------------------------- Sun, 29 June 2008 All the coordinate elements are now compatible with DRAWOFFSET (they adjust for it). ->X1 ->Y1 ->X2 ->Y2 ->XPOS ->YPOS ->LEFT ->TOP ->RIGHT ->BOTTOM All the X and Y based elements now support measurements and percentages when being set. ---------------------------------------------------------------------------- Sat, 28 June 2008 All the coordinate/size elements now support HOTSPOTs and WHENs ->X1 ->Y1 ->X2 ->Y2 ->SIZEX ->SIZEY ->XPOS ->YPOS ->LEFT ->TOP ->RIGHT ->BOTTOM ---------------------------------------------------------------------------- Thu, 26 June 2008 Bug in low level font width calculations that was accidently trying to calculate the width of control characters like linefeed strchr(10). FONTSTYLE ANTI OFF now works (previously the only way to turn off font anti-aliasing was with FONTSTYLE INIT). FONTSTYLE ANTI when enabled no longer messes up WINFONT. Previously it would create huge 8x larger letters all run together overlapping. Strange spacing and screenupdate problems for WINFONT defined fonts when using characters between 128 and 255. Several strange bugs when using characters between 128 and 255 in fonts created with FONTDEFINE are fixed. This includes blank missing characters, incorrect spacing, and small black marks instead of characters. ---------------------------------------------------------------------------- Mon, 23 June 2008 The VARREFERENCE command used on an array with a non-existant zero index was broken. This showed up when trying to access part of a loaded XML with only a single value. Here is an example that failed in previous builds: drawclear white a[hello]{red} = one messagebox strlist(arrayattrib(&a[hello])) ; displays red messagebox strlist(arrayattrib(&a[hello][0])) ; should display red (wasn't) exitnow ---------------------------------------------------------------------------- Thu, 19 June 2008 AGCOMP Modular now correctly handles SET WINDOWUPDATE, it needed to call the WINDOWUPDATE command (variable and command are identical). AGCOMP Modular now directly references LIBCMT.LIB and OLDNAMES.LIB to eliminate lib path problems(linker could not always find libraries). ---------------------------------------------------------------------------- Mon, 16 June 2008 The ->SIZE element was not working with array subindexes and arrays passed by address. For example: messagebox array(a,b,c)->size ; was displaying 0, should be 3 a[0][0] = x a[0][1] = y messagebox a[0]->size ; was displaying 0, should be 2 Some small performance optimizations made when accessing arrays, some unused parameters being passed around were eliminated. This also simplified a large number of array reference calls (making the code simpler). ---------------------------------------------------------------------------- Sun, 15 June 2008 New setable global option TEXTHTMLSPACES, default is OFF: SET TEXTHTMLSPACES ON SET TEXTHTMLSPACES OFF When ON, extra space characters are drawn, for instance: drawclear white set texthtml on text "" text "a b" ; displays a b set texthtmlspaces on text "a b" ; displays a b wait ---------------------------------------------------------------------------- Tue, 10 June 2008 A new function, STRRTFTOHTML. Takes a RTF string, and returns a HTML one. Only BOLD, ITALIC, UNDERLINE and LINEBREAK tags are supported at this time. Two new commands ARRAYINDEX0 and ARRAYATTRIB0, they functions exactly the same as ARRAYINDEX and ARRAYATTRIB except that it will return a single "0" result when there are no numeric indexes. This is mainly for use when reading XML files, for example: drawclear white set texthtml on text "" set textwrap off set texthtml off aexample[fred][0][zed] = a aexample[fred][1][zed] = b aexample[fred][2][zed] = c bexample[fred][zed] = z textln strlist(arrayindex(&aexample[fred])) ; shows 0 1 2 textln strlist(arrayindex0(&aexample[fred])) ; shows 0 1 2 textln strlist(arrayindex(&bexample[fred])) ; shows zed textln strlist(arrayindex0(&bexample[fred])) ; shows 0 wait exitnow ---------------------------------------------------------------------------- Mon, 02 June 2008 AGCOMP Modular compiler now includes the APPSHELL (required for MAILTO: links) and NETOPENWEBPAGE (required for HTTP: links) commands if HTMLLINK is ON. ---------------------------------------------------------------------------- Fri, 30 May 2008 Problem with FONTSTYLE messing up a previously defined font with FONTDEFINE that had not been used is fixed. ASCII 0 was being treated as a chracter with an actual width, this was messing up bullets and other indented text. Fixed (was broken in 22 May 2008 onward). ---------------------------------------------------------------------------- Thu, 29 May 2008 Problem with font settings not "sticking" fixed. This showed up as FONTSTYLE ALLVARIATIONS not working. This also showed up when defining fonts and saving them. Bug recently introduced in AGCOMP which kept LAYER FILTER from working is fixed. ---------------------------------------------------------------------------- Wed, 28 May 2008 Bullet points and any use of   was broken since the May 7th build. Fixed. ---------------------------------------------------------------------------- Tue, 27 May 2008 Size of SPACE character in new fonts defined with WINFONT or FONTDEFINE is fixed. Problem with character spacing when using multiple size Unicode fonts defined with WINFONT at once is fixed. ---------------------------------------------------------------------------- Sun, 25 May 2008 AGCOMP 32bit, and non-BHO builds of AGPLAY now use the NEDMALLOC memory allocation routines to reduce fragmentation, and speed up virtually all routines. You can find more on NEDMALLOC here: http://www.nedprod.com/programs/portable/nedmalloc/index.html I originally was interested in JEMALLOC since it's being used in the next FIREFOX release, and has made substantial improvements to FIREFOX's memory overhead and performance. But NEDMALLOC was much simpler to integrate at this point. FONTLOAD with GLPRO style GLF fonts now works (it was creating blank character sets). FONTSAVE/FONTLOAD with AGF4 (latest format with Unicode index) now working. ---------------------------------------------------------------------------- Thu, 22 May 2008 More error checking added as part of a diagnostic including rewriting part of the AVL trees template used in several parts of AG. EXTREME changes to all font load, save and draw code to support unicode fonts. Previously Unicode was only functional in a very limited way with no anti-aliasing, saved fonts or bitmap font support. It really was really only for printing, and in fact was broken in recent builds. Because FONTLOAD and FONTSAVE have been completely rewritten, expect bugs. In particular the loading of older font formats, GLF from GLPRO, and AGF (variations 0, 1, 2 and 3) had to be rewritten. FONTSAVE and FONTSAVECOMPRESSED now produce a AGF type 4 font which has a variable size font widths table, and a index of which character bitmaps are included. FONTSAVE and FONTSAVECOMPRESSED now use the same underlying code (the old fontsave was so simple it wasn't worth making a more generalized version). This AGF type 4 font will only load in this and future builds of AfterGRASP. Known issues in this copy include overly large space character sizing. Example of Unicode text: windowsize 1000 800 32 drawclear white color black ; set texthtmlwinfont on ; set texthtmlantifont off fontstyle init 512 set texthtml on text "şi Oferă consultanţă tehnică şi o gamă variată de sigilanţi şi." wait exitnow ---------------------------------------------------------------------------- Thu, 08 May 2008 STRFORMATNUMBER now uses this format string for "Standard" "###,###,###,###,###.00" XMLLOAD handling of HTML tags (any section with a HTML only namespace) is fixed, it was only doing the child, not the actual node. Showed up when loading Excel XML spreadsheets with html tagged text. Fixed Crashing bug in FILEPUTVARIABLES when FILESTRINGALWAYS is enabled, and variable has a NULL value. ---------------------------------------------------------------------------- Wed, 07 May 2008 XMLLOAD now encodes non-ascii characters using HTML encoding. TEXTHTML now supports a more complete set of special character names including "–". ---------------------------------------------------------------------------- Fri, 02 May 2008 Minor changes to INPUT code, use of input objects directly is now allowed by all INPUT commands (useful for arrays of input). Small bug in INPUT related to reuse of string objects fixed, could have causes strange problem with input fields having text changed. ---------------------------------------------------------------------------- Wed, 30 April 2008 MEMNEW fixed to allow creating zero length memory buffers. New system variable, FILESTRINGALWAYS which affects the FILEPUTVARIABLES command. The default is for FILEPUTVARIABLES to not include the quote string around variable values which do not require it. If FILESTRINGALWAYS is set to ON/TRUE, then the quote string will always be used. SET FILESTRINGALWAYS ON SET FILESTRINGALWAYS OFF Example: drawclear red a = 1 b = 2 c = 3 d = "Hello there" set filestringalways on memnew teston fileputvariables mem:teston a b c d set filestringalways off memnew testoff fileputvariables mem:testoff a b c d with texthtml on text "" color white set textwrap off textln "ON" textln @@teston textln textln "OFF" textln @@testoff set variables on wait exitnow ---------------------------------------------------------------------------- Tue, 29 April 2008 New command INPUTUPDATEVAR, used to force an active input to store any edit results into the input variable. Useful for showing complex form results/preview without ended all the active inputs. Passed one or more active inputs. INPUTUPDATEVAR INPUTNAME ... ---------------------------------------------------------------------------- Mon, 28 April 2008 @DRAWOFFX and @DRAWOFFY fixed to match @DRAWOFFMINX and @DRAWOFFMINY STRLINECOUNT was not handling strings with trailing NULL characters correctly, it was returning a count one less than the correct value. STRSORT was including extra NULL characters at the end of the result, sometimes a single NULL, sometimes 3 NULL characters. Fixed. FILEPUTVARIABLES now supports wildcard variable names. FILEPUTVARIABLES now supports filehandles as well as filenames, so you can do this: drawclear white set a 1 b 2 c 3 x 99 y 98 z 97 hello xx goodbye yy fileputvariables test.ini hello goodbye fs = fileappend(test.ini) fileseek @fs 0 2 fileputvariables @fs a b c fileputvariables @fs x y z fileclose @fs messagebox fileget(test.ini) exitnow ---------------------------------------------------------------------------- Wed, 23 April 2008 SET DRAWMINX, DRAWMINY, DRAWMAXX and DRAWMAXY were broken. HOTSPOT command now supports measurements. HOTSPOT command now supports DRAWOFFSET. All the anti-aliased drawing commands now support DRAWOFFSET. These fixes particularly affect these commands which were completely incompatible with DRAWOFFSET: DRAWANTIBOX DRAWANTIBOXROUND DRAWANTICIRCLE DRAWANTICIRLCEFILLED DRAWANTIRECT DRAWANTIRECTROUND ---------------------------------------------------------------------------- Thu, 17 April 2008 Use of Rectangle to draw fill rectangles replaced with FillRect which is faster. ---------------------------------------------------------------------------- Fri, 11 April 2008 Small change in STRFORMATNUMBER on the handling of ',' with trailing digits. ---------------------------------------------------------------------------- Thu, 10 April 2008 Fixed bug in STRFORMATTIME not correctly handling time formats. Simple test example of STRFORMATDATETIME: drawclear red color white set texthtml on text "" textln strformatdatetime("Short Date",@date,0) textln strformatdatetime("Short Time",0,@time) textln strformatdatetime("Long Date",@date,0) textln strformatdatetime("Long Time",0,@time) textln strformatdatetime("General",@date,@time) textln strformatdatetime("HHmmss",0,@time) textln strformatdatetime("yyyyMMdd",@date,0) wait exitnow Simple test example of STRFORMATNUMBER: windowsize 1000 700 drawclear red color white set texthtml on text "" set texthtml off testformat "General" testformat "#" testformat "#.#;[red]#.#" testformat ".#" testformat "#.##" testformat "#.####" testformat "000.0000" testformat "000,000" testformat "#,000" wait exitnow testformat: declare formatstr text @quote$@formatstr$@quote textln 400 @textposy " -1234.567 "$strformatnumber(@formatstr, -1234.567) text @quote$@formatstr$@quote textln 400 @textposy " 99.8 "$strformatnumber(@formatstr, 99.8) return ---------------------------------------------------------------------------- Wed, 09 April 2008 The AppMutex for AGPLAY.EXE is now only created when the standalone runtime is running as AGPLAY.EXE. When part of a built EXE, the Mutex is no longer created. This fixes the problem where the AG install would fail if any apps created with AG are running. ---------------------------------------------------------------------------- Tue, 08 April 2008 Severe bug in FILEICONSET which was failing badly when using an ICON with more than 1 image. Fixed. Two new commands, STRFORMATDATETIME and STRFORMATNUMBER. Both use EXCEL style formatting strings. Neither is complete and will be ehanced over time. STRFORMATNUMBER is particular still needs work for some basic functionality. I'm uploading this new build now to document the new commands, and get the FILEICONSET bug fix uploaded. STRRESULT = STRFORMATDATETIME(DATEFORMATSTR, DATE, TIME) STRRESULT = STRFORMATDATETIME(DATEFORMATSTR, DATETIMESTR) DATEFORMATSTR can be either a fixed name, or a Excel style date format string: "General" "General Date" "Long Date" "Long Time" "Medium Date" "Medium Time" "Short Date" "Short Time" "Standard" The style string supports these options, you cannot mix date and time options in the same format string, results will be unpredictable since STRFORMATDATETIME uses the GetDateFormat and GetTimeFormat WIN32 API calls. d Day of month as digits with no leading zero for single-digit days. dd Day of month as digits with leading zero for single-digit days. ddd Day of week as a three-letter abbreviation. dddd Day of week as its full name. M Month as digits with no leading zero for single-digit months. MM Month as digits with leading zero for single-digit months. MMM Month as a three-letter abbreviation. MMMM Month as its full name. y Year as last two digits, but with no leading zero for years less than 10. yy Year as last two digits, but with leading zero for years less than 10. yyyy Year represented by full four digits. gg Period/era string. h Hours with no leading zero for single-digit hours; 12-hour clock. hh Hours with leading zero for single-digit hours; 12-hour clock. H Hours with no leading zero for single-digit hours; 24-hour clock. HH Hours with leading zero for single-digit hours; 24-hour clock. m Minutes with no leading zero for single-digit minutes. mm Minutes with leading zero for single-digit minutes. s Seconds with no leading zero for single-digit seconds. ss Seconds with leading zero for single-digit seconds. t One character time-marker string, such as A or P. tt Multicharacter time-marker string, such as AM or PM. DATE and TIME are standard AG date and time values, yyyyMMdd and HHMMSS. Such as 20080403 and 221605. DATETIMESTR is a Excel format datetime string YYYY-MM-DDTHH:MM:SS. such as "2008-04-03T00:00:00.000" STRRESULT = STRFORMATNUMBER(NUMBERFORMATSTR, NUMBER) NUMBERFORMATSTR can be either a fixed name, or an Excel style number format string. Conditionals are not supported. "Currency" "Euro Currency" "Fixed" "General" "General Number" "Percent" "Scientific" "Standard" The style string supports these options: 0 Digit placeholder. This code pads the value with zeros to fill the format. # Digit placeholder. This code does not display extra zeros. ? Digit placeholder. This code leaves a space for insignificant zeros but does not display them. . Decimal number. % Percentage. Multiplies by 100 and adds the % character. , Thousands separator. A comma followed by a placeholder scales the number by a thousand. $ - + / ( ) : space These characters are displayed in the number. To display any other character, enclose the character in quotation marks or precede it with a backslash. \character This code displays the character you specify. _ This code skips the width of the next character. This code is commonly used as "_)" (without the quotation marks) to leave space for a closing parenthesis in a positive number format when the negative number format includes parentheses. This allows the values to line up at the decimal point. @ Text placeholder. "text" This code displays text. * This code repeats the next character in the format to fill the column width. Only one asterisk per section of a format is allowed. ---------------------------------------------------------------------------- Wed, 02 April 2008 Long standing bug in Postscript printing detection fixed. Was related to using a different function for detection and injection detect. Bug in combinting link regions created with
    tags fixed. It was creating multiple hotspots or PDFMARK links which could cause problems, particular for some Postscript interpreters. Some small refinements to date/time routines. XML array write reference code updated. It takes a array and a filename, and writes a standard XML file (although a big sparse with excessive whitespace). Here is the updated example: XMLwrite: declare a fname filedelete @fname filesendln @fname "" filesendln @fname local depth -1 writeone &a a->root "" filesendln @fname return FixXmlStr: declare s return strreplace(@s, "¦","¦") FixXmlQuotes: declare s return strreplace(@s, @quote, """, "<", "<", ">", ">") writeattrib: declare a depth local result "" local list strlist(arrayattrib(a)) strsort list strsort "#" list for j in @list result = @result$strrepeat(@depth,strchr(9))$@j$"="$@quote$FixXmlQuotes(@a{@j})$@quote$@crlf next return strleft(@result, strlen(@result)-2) writeone: declare a j parent if @j==strpad0(@j+0,0) ; if number local name @parent local indentdepth @depth-1 else local name @j local indentdepth @depth endif if a->dim1==0 filesendln @fname strrepeat(@indentdepth,strchr(9))$"<"$@name$">" filesendln @fname strrepeat(@indentdepth,strchr(9))$@a filesendln @fname strrepeat(@indentdepth,strchr(9))$""$@crlf return endif local attribcount array(arrayattrib(&a))->dim1 local aidx array(arrayindex(&a)) local indexcount aidx->dim1 if @attribcount filesendln @fname strrepeat(@indentdepth,strchr(9))$"<"$@name filesend @fname FixXmlStr(writeattrib(&a,@indentdepth+1)) if @indexcount filesendln @fname ">" if @indentdepth<0 filesendln @fname endif writewalk &a @indentdepth+1 @name filesendln @fname strrepeat(@indentdepth,strchr(9))$""$@crlf else filesendln @fname " />"$@crlf endif else if @indexcount local firstindex @aidx[0] local isnumber @firstindex==strpad0(@firstindex+0,0) ; if number if !@isnumber filesendln @fname strrepeat(@indentdepth,strchr(9))$"<"$@name$">" endif writewalk &a @indentdepth+1 @name if !@isnumber filesendln @fname strrepeat(@indentdepth,strchr(9))$""$@crlf endif else filesendln @fname strrepeat(@indentdepth,strchr(9))$"<"$@name$" />" endif endif return writewalk: declare a depth parent for j inarray array(arrayindex(a)) writeone &a[@j] @j @parent next return ---------------------------------------------------------------------------- Thu, 27 March 2008 Update yesterday for XMLLOAD was not inserting the HTML parsed content at the correct array depth. Fixed. Bug in internal ArrayAdd which would created corrupt array index values when adding to arrays with non-numeric index values is fixed. Bug in XMLLoad which could create incorrect attribute array indexes fixed. ---------------------------------------------------------------------------- Wed, 26 March 2008 New code in XMLLOAD which looks for use of a HTML namespace, if used then the tags are built into any content. It identifies that it is an HTML namespace by looking for the letters "html" without a period in the XML NameSpace URL. For instance, Microsoft when saving Excel XML spreadsheets uses the URL "http://www.w3.org/TR/REC-html40". An crude example of what it did before, vs now: New C30 Car Previously, this would have been loaded as test["Data"][0] = "New " test["Data"][1]["B"] = "C30" test["Data"][2] = " Car" Now it's loaded as: test["Data"] = "New C30 Car" This code required some modification to the LIBXML2 library (to expose the Node writing function, and call it), which will reduce the likelyhood (or at least frequency) of future updates to the LIBXML2 source code used in AfterGRASP. ---------------------------------------------------------------------------- Tue, 25 March 2008 LAYER TO and LAYER CURVE were both broken recently, the X coordinate was lost. Fixed. ---------------------------------------------------------------------------- Thu, 20 March 2008 INPUT commands were not handling high-ascii characters like £, fixed. Keyboard input was not allowing high-ascii characters to be entered via the numeric keypad and alt key. Fixed. This means alt-end, alt-home, alt-pgup, alt-pgdn, alt-up, alt-down, alt-right, alt-left are no longer allowed. Direct keyboard input on non-USA keyboards of high-ascii characters was sometimes wrong, fixed. Command name change, text commands previously listed as XY are now RECTS, they return an array of boxes with LEFT, TOP, RIGHT, BOTTOM. All the DRAWLIST commands now expect an array of RECTs, not an XY array. Why do the TEXT RECTS commands return a flat array, and DRAWLIST commands expect a flat array? Design limits of AfterGRASP make is a poor idea to create large numbers of 2 dimensional arrays, or arrays of thousands of seperate objects (I looked into using a built in type, RECT). So I've abandoned all the code I was researching, and I'm sticking with a simple single dimensional array of integers. Four elements per character position. I realize this makes for ugly direct access to individual coordinates (having to multiply the string position by 4). The next update may switch this to using a memory buffer (like that created with MEMNEW) since it will be smaller, faster and slightly easier to use. Over time I expect all this to grow into some new functions for rich text editing that will be painless to use. Some assorted new functions used for internal testing only: AREAITEM = TOAREA(X1, Y1, X2, Y2) RECTITEM = TORECT(LEFT, TOP, RIGHT, BOTTOM) ->BOTTOM ->LEFT ->RIGHT ->TOP ->XPOS ->YPOS ---------------------------------------------------------------------------- Tue, 18 March 2008 New commands TEXTLINESRECTSFROM and TEXTSTRPOSITIONRECTSFROM. They are identical to TEXTLINESFROM and TEXTSTRPOSITIONFROM except they also return a character XY position array exactly like TEXTLINESRECTS and TEXTSTRPOSITIONRECTS. The XY positions in the result are relative to the current drawregion. This makes the results identical to those provided by TEXTLINESRECTS and TEXTSTRPOSITIONRECTS which have no idea of window coordinates since they do not draw anything, just calculate text positions relative to a starting point of 0,0. RECTARRAY = TEXTLINESRECTSFROM(TEXTSTRING, STARTLINE) RECTARRAY = TEXTLINESRECTSFROM(TEXTSTRING, STARTLINE, LINECOUNT) RECTARRAY = TEXTSTRPOSITIONRECTSFROM(TEXTSTRING, STARTSTRPOSITION) RECTARRAY = TEXTSTRPOSITIONRECTSFROM(TEXTSTRING, STARTSTRPOSITION, ENDSTRPOSITION) ---------------------------------------------------------------------------- Mon, 17 March 2008 Crashing bugs in XMLSAVE fixed, but it still does not write changes made to the loaded data. Many new commands TEXTLINESRECTS, TEXTSTRPOSITIONRECTS, DRAWLISTINSIDE, DRAWLISTBEGIN, DRAWLISTEND, DRAWLISTNEXT, DRAWLISTPREV, DRAWLISTLINEBEGIN, DRAWLISTLINEEND, DRAWLISTLINENEXT, DRAWLISTLINEPREV, ARRAYINSERT and ARRAYDELETE. ARRAYINSERT and ARRAYDELETE are for numericly indexed arrays only. Insert is used to insert new members into an array, renumbering upward members which follow. Delete to remove members, and renumber downward members which follow. ARRAYINSERT ARRAY START INSERTCOUNT ARRAYINSERT ARRAY START INSERTARRAY ARRAYDELETE ARRAY START DELETECOUNT INSERTCOUNT and DELETECOUNT both default to 1. Runable Example: drawclear test = array(a,b,c,d) arrayinsert test 2 3 test[2] = x test[3] = y test[4] = z arraydelete test 3 arrayinsert test 3 array(i,j,k) messagebox strlist(@test) ; displays a, x, i, j, k, z, b, c, d exitnow TEXTLINESRECTS and TEXTSTRPOSITIONRECTS work like TEXTLINESHEIGHT and TEXTSTRPOSITIONHEIGHT in that they calculate spacing. But instead of returning height, they return an array of X Y positions, one coordinate for every character in the TEXTSTRING. The first two elements in the array are reserved for the width/height of the text area. Each pair of integer elements which follow are the X, Y coordinates. RECTARRAY = TEXTLINESRECTS(TEXTSTRING, WIDTH, STARTLINE) RECTARRAY = TEXTLINESRECTS(TEXTSTRING, WIDTH, STARTLINE, LINECOUNT) RECTARRAY = TEXTSTRPOSITIONRECTS(TEXTSTRING, WIDTH, STRPOSITION) RECTARRAY = TEXTSTRPOSITIONRECTS(TEXTSTRING, WIDTH, STRPOSITION, ENDSTRPOSITION) DRAWLISTINSIDE works a little like DRAWINSIDE, but it is given a array of coordinates, and a region. It returns the index of which is the first coordinate pair that is the upper left hand corner of a box which contains the coordinate. DRAWLISTINSIDE returns 0 for no match. This is most useful for determining which character someone clicked on in a block of complexly formatted text. ARRAYINDEX = DRAWLISTINSIDE(RECTARRAY, XPOS, YPOS) ARRAYINDEX = DRAWLISTINSIDE(RECTARRAY, XPOS, YPOS, MINX, MINY, MAXX, MAXY) DRAWLISTBEGIN searches backward from INDEX for the first coordinate identical to the coordinate at INDEX. DRAWLISTEND finds the last coordinate identical to the coordinate at INDEX. ARRAYINDEX = DRAWLISTBEGIN(RECTARRAY, INDEX) ARRAYINDEX = DRAWLISTEND(RECTARRAY, INDEX) The code for both is the same as this script code: drawlistbegin: declare index index = @index*4 local xpos @RECTARRAY[@index] local ypos @RECTARRAY[@index+1] local result @index/4 for i from @index-4 to 4 step -4 if (@xpos==@RECTARRAY[@i])&&(@ypos==@RECTARRAY[@i+1]) local result @i/4 endif next return @result drawlistend: declare index index = @index*4 local xpos @RECTARRAY[@index] local ypos @RECTARRAY[@index+1] local result @index/4 for i from @index+4 to @RECTARRAY->dim1-4 step 4 if (@xpos==@RECTARRAY[@i])&&(@ypos==@RECTARRAY[@i+1]) local result @i/4 endif next return @result DRAWLISTPREV searches backward from INDEX for the first coordinate different from the coordinate at INDEX. DRAWLISTNEXT finds the next coordinate different from the coordinate at INDEX. ARRAYINDEX = DRAWLISTPREV(RECTARRAY, INDEX) ARRAYINDEX = DRAWLISTNEXT(RECTARRAY, INDEX) The code for both is the same as this script code: drawlistprev: declare index index = @index*4 local xpos @RECTARRAY[@index] local ypos @RECTARRAY[@index+1] local result 1 for i from @index-4 to 4 step -4 if (@xpos!=@RECTARRAY[@i])||(@ypos!=@RECTARRAY[@i+1]) local result @i/4 break endif next return @result drawlistnext: declare index index = @index*4 local xpos @RECTARRAY[@index] local ypos @RECTARRAY[@index+1] local result @RECTARRAY->dim1/4 for i from @index+4 to @RECTARRAY->dim1-4 step 4 if (@xpos!=@RECTARRAY[@i])||(@ypos!=@RECTARRAY[@i+1]) local result @i/4 break endif next return @result DRAWLISTLINENEXT searches RECTARRAY for next index which changes Y position down, but has the same X position. If Y changes again, use furthest right X. DRAWLISTLINEPREV searches RECTARRAY for previous index which changes Y position up, but has the same X position. If Y changes again, use furthest right X. ARRAYINDEX = DRAWLISTLINENEXT(RECTARRAY, INDEX) ARRAYINDEX = DRAWLISTLINEPREV(RECTARRAY, INDEX) DRAWLISTLINEBEGIN searches RECTARRAY for start of line. DRAWLISTLINEEND searches RECTARRAY for end of current line. ARRAYINDEX = DRAWLISTLINEBEGIN(RECTARRAY, INDEX) ARRAYINDEX = DRAWLISTLINEEND(RECTARRAY, INDEX) Notes on use for cursor keys: Left arrow does DRAWLISTNEXT Right arrow does DRAWLISTPREV Down arrow does DRAWLISTLINENEXT Up arrow does DRAWLISTLINEPREV Home does DRAWLISTLINEBEGIN End does DRAWLISTLINEEND Selecting a block of text, DRAWLISTBEGIN on start, and DRAWLISTEND on selection end. ---------------------------------------------------------------------------- Sat, 08 March 2008 In AfterGRASP.iss setup script this Mutex check added: AppMutex=AfterGRASP,Global\AfterGRASP In IEAfterGRASP.iss setup script this Mutex check added: AppMutex=IEAfterGRASP,Global\IEAfterGRASP Custom image files removed from IEAfterGRASP setup since they are no longer used/displayed. ---------------------------------------------------------------------------- Fri, 07 March 2008 AfterGRASP and IEAfterGRASP now create a AppMutex useful to detect if they are already running for Setup scripts. ---------------------------------------------------------------------------- Tue, 04 March 2008 Crashing bug in FILECOPY when the destination filename is NULL is fixed. HTTP POSTFILE has some more error checking added. ---------------------------------------------------------------------------- Wed, 27 February 2008 Bug in modular compiler not linking because of FLOAT function, and new alpha blending code, fixed. Flaw in AGCOMP compiler designed which would combine CALL and POP commands into a single token is fixed. This could cause subroutines which return a value to have that value accumulate on the parameter stack, or other odd bugs. The interpreter still supports the CALLPOP token to allow older compiled scripts to run, but AGCOMP no longer generates it. Fixed Bug in ARRAYINDEX and ARRAYATTRIB, when used on a non-array variable it was providing the variable contents instead of an no result (empty). Example of the bug: drawclear white hello = 1 for n inarray array(arrayindex(hello)) messagebox "ERROR" next exitnow ---------------------------------------------------------------------------- Sun, 24 February 2008 New functions to directly force conversions: FLOATRESULT = FLOAT(VALUE) FLOATRESULT = FLOATCOORDINATEX(XVALUE) FLOATRESULT = FLOATCOORDINATEX2(X1VALUE, X2VALUE) FLOATRESULT = FLOATCOORDINATEY(YVALUE) FLOATRESULT = FLOATCOORDINATEY2(Y1VALUE, Y2VALUE) FLOATRESULT = FLOATNUMBERX(XVALUE) FLOATRESULT = FLOATNUMBERY(YVALUE) INTRESULT = INTCOORDINATEX(XVALUE) INTRESULT = INTCOORDINATEX2(X1VALUE, X2VALUE) INTRESULT = INTCOORDINATEY(YVALUE) INTRESULT = INTCOORDINATEY2(Y1VALUE, Y2VALUE) INTRESULT = INTNUMBERX(XVALUE) INTRESULT = INTNUMBERY(YVALUE) FLOAT(v) is the simplist, it's basically the same as adding 0.0 to force a value to be floating point. The COORDINATEX and COORDINATEY functions convert a value to integer/float number with understanding of measurements and left/right/top/bottom/center values. The COORDINATEX2 and COORDINATEY2 functions handle size measurements like: x2 = intcoordinatex2(50,(10pct)sizex) NUMBERX and NUMBERY are for values that are not coordinates, generally sizes of things like the height of a font, or thickness of a box. Normally these conversions are done by AfterGRASP internally and you wouldn't need any of these functions (except FLOAT() which is generally useful). But in a few special cases I've found them needed. I also did a internal code cleanup to remove direct references to GetXCoordinate2 and GetYCoordinate2. A handy example of how to read a Excel XML spreadsheet: drawclear white windowsize 1280 720 set texthtml on text "" xmlload sortres.xml test for j inarray array(arrayindex(test["Worksheet"]["Table"]["Row"])) for n inarray array(arrayindex(test["Worksheet"]["Table"]["Row"][@j]["Cell"])) text @test["Worksheet"]["Table"]["Row"][@j]["Cell"][@n]["Data"] text "," next textln next set variables on wait exitnow WHEN INSIDE and WHEN OUTSIDE now handle SIZE measurements (for X2 and Y2). ---------------------------------------------------------------------------- Tue, 19 February 2008 The FILEPUTARRAY and FILEPUTARRAYNAMED commands were not putting quotes around text which did not have a comma, but did cross lines. It now puts quotes around text with any control character including CR, LF and TAB. Code example/documentation on arrays: Given a CSV file where one of the fields looks like "Collection:19/04/2008", sort the CSV and write it back out. drawclear white set texthtml on text "" textln "starting" ; Read the csv into an array global newres filegetarray("newres.csv") global res0 strlist(@newres[0]) ; Searche for which field is the collections field global collections strlinenumber(@res0,strsearch(@res0, "Collection:"))-1 for i inarray array(arrayindex(newres)) cdate = strreplace(@newres[@i][@collections], "Collection:", "") ; Parses the date lpos = strsearch(@cdate, "/") rpos = strsearchreverse(@cdate, "/") cday = strleft(@cdate,@lpos-1) cmonth = strleft(strleftright(@cdate,@lpos+1), (@rpos-@lpos)-1)*100 cyear = strleftright(@cdate,@rpos+1)*10000 ; Create a YYYYMMDDIIIIII index cdate = (@cyear+@cmonth+@cday)*100000+@i resindex[@cdate] = @i next count = 0 ; Create an array sorted on that YYYYMMDDIIIII index for i inarray array(arrayindex(resindex)) sortres[@count] = &newres[@resindex[@i]] inc count next count = resindex->size ; Create an array sorted in reverse on that same YYYYMMDDIIIII index for i inarray array(arrayindex(resindex)) dec count reversesortres[@count] = &newres[@resindex[@i]] next ; resindex is no longer needed at this point and can be freed free resindex fileputarray sortres.csv sortres textln "done" set variables on wait exitnow ---------------------------- AfterGRASP supports what are called sparse arrays, so you can do this: a[10] = a a[50] = b a[2000] = c This array has only 3 items in it. If you did strlist(arrayindex(a)) you would get 10 50 2000 If you did for i inarray array(arrayindex(a)) textln @a[@i] next you would get a b c So if you do a[2008012300001] = 1 a[2007010100002] = 2 a[2008012200003] = 3 You would get strlist(arrayindex(a)) displaying 2007010100003 2008012200002 2008012300001 if you did this loop to the date indexed array for i inarray array(arrayindex(a)) textln @a[@i] next you would get 3 2 1 What is the difference between array(arrayindex(a)) and strlist(arrayindex(a)) ? array(arrayindex(a)) returns an array, for example: global hello array(arrayindex(a)) textln @hello[2] strlist(arrayindex(a)) returns a string, where each item is seperated by a CR LF In the example above, you could use for i in strlist(arrayindex(a)) but it's less efficient, and forces everything to be converted to a string and back to a number multiple times. Using for i inarray array(arrayindex(a)) leaves everything as a number leaving out all the string conversions and string searches. ---------------------------------------------------------------------------- Mon, 04 February 2008 IMAGECOMPRESSED ON with RGB JPEG images now works on PostScript printers. ---------------------------------------------------------------------------- Thu, 31 January 2008 IMAGEALPHA with IMAGEPUT is now over double the speed as in the past. The performance different is only on successive IMAGEPUTs. The first IMAGEPUT is slower because it generates a premultiplied copy of the image with all RGB values multipied by alpha as is required by the windows AlphaBlend API call. This new code is only enabled when IMAGEFASTSCALE is ON. If it is reliable enough for scaling, then it will be used in place of most of the past scaling code. ---------------------------------------------------------------------------- Tue, 29 January 2008 Some divide by zero errors when scaling images are now handled correctly. Serious memory leak in IMAGEANTIWARP and IMAGEANTIROTATE fixed. ---------------------------------------------------------------------------- Wed, 24 January 2008 INPUT commands were broken when a DRAWOFFSET was active. Fixed. Two new LAYER commands which control the DRAWOFFSET used for a layer. LAYER OFFSET LAYER OFFSETRESET They have the same syntax as DRAWOFFSET and DRAWOFFSETRESET. ---------------------------------------------------------------------------- Thu, 17 January 2008 LAYERs now preserve the original DRAWOFFSET from when the LAYER was first created, and use that DRAWOFFSET from then on. Use of LAYER REGION updates the LAYER's DRAWOFFSET to the currently active one. FILESIZE and FILEREAD for files inside a GL or EXE were broken. This also showed up in commands that make use of the FILESIZE code such as FILECOPY. Fixed. FILESIZE code rewritten to use GetFileSize API call instead of FileSetPosition API. Typo in name of HTTPPOSTFLAGS variable was causing a link error in modular compiler. ---------------------------------------------------------------------------- Wed, 16 January 2008 FILEDATE and FILETIME rewritten to handle BSTRING (Unicode) filenames, and work with unusual paths. FILESIZE now works with either a file handle provided by FILEOPEN/FILEAPPEND (as it always did), or a filename. It will also accept a BSTRING filename (Unicode). This means you can now get the size of a file without actually opening it. SuperScript and SubScript fonts are now approximately 2/3rds the size of the original font. Previously they were half. SubScript vertical offset is reduced to 1/4 of the height difference to move the SubScript away from the next line of text. ---------------------------------------------------------------------------- Sun, 13 January 2008 New bug introduced in the Thursday build when in accessing multiple files inside an EXE or GL is fixed (would give data corrupt or missing file errors). Bug in DATABASE code which was overwriting the header with record labels is fixed. Extensive changes made to use templates to eliminate duplicate code for TOKEN32 vs TOKEN64 modules. ---------------------------------------------------------------------------- Thu, 10 January 2008 Serious crashing bug in FILECLOSE is fixed. It would leave a variables containing the file handle with an invalid value that would corrupt memory. The way FILECLOSE works is rewritten to keep the FILE object around, and just clean it up and close the device stream. The DEBUG/VARIABLES display for FILE objects is updated to show the device number, and the original filename. As a side note, there really is little use for FILECLOSE since FILEOPEN, FILEAPPEND and FILECREATE actually create an object that will automatically be closed when no longer in use or free'd. For instance: size = FileSize(FileOpen("example.exe")) This actually is valid, and will not leave "example.exe" open. And a note on IMAGESET. In March 2005, I made IMAGESET and PRINTSET nestable up to 64 levels deep. It allows you to do things like create an image buffer and fill it in the middle of printing. Or write a general subroutine that creates a arrow image, and returns the image for use, then call that subroutine to putup a bunch of arrows inside an image. Also IMAGESET when given no parameters returns a reference to the image buffer that was set, so for instance you can do this: drawclear red imageset imagenew(@drawwidth,@drawheight) imageput left top CreateXImage(@drawwidth/2) imageput right bottom CreateXImage(@drawheight/2) imagefade blend imageset() wait exitnow CreateXImage: declare Xsize imageset imagenew(@Xsize,@Xsize) drawclear black color white drawantiline 0 0 @drawmaxx @drawmaxy 4 drawantiline 0 @drawmaxy @drawmaxx 0 4 return imageset() Notice in this example I never actually store the image buffers in a variable, they are freed when they are no longer needed. ---------------------------------------------------------------------------- Wed, 09 January 2008 Crashing bug when using FILEPUTARRAYNAMED with an array with missing members is fixed. New system variable @SYSTIMEUTC. Defaults to OFF/FALSE (0). When set to ON/TRUE (1) the @TIME, @DATE, SETFILEDATETIME and GETFILEDATETIME features all work in UTC time instead of local time. Here is an example that shows the current timezone offset: drawclear white set systimeutc off set localtime @time set localdate @date set systimeutc on set utctime @time set utcdate @date set timediff round((@localtime-@utctime)/10000.0) if @localdate<@utcdate set timediff @timediff-24 endif if @localdate>@utcdate set timediff @timediff+24 endif set variables on messagebox @timediff timeoffset exitnow ---------------------------------------------------------------------------- Mon, 07 January 2008 Bug in MEM: which was not seeking to the end correctly. Filenames with the MEM: prefix previously only applied to memory buffers created with MEMNEW or MEMLOAD. MEM: now works with string variables as well, for instance the results of the DRIVEFILELIST command. drawclear white set listing drivefilelist(0,"*") local test filegetarray(mem:listing) set variables on wait exitnow ---------------------------------------------------------------------------- Thu, 03 January 2008 HTTP GETFILE and HTTP GETVAR were broken in previous build. HTTP GET now written and tested. Returns the results as a string. For example: drawclear white messagebox http(get,"http://www.google.com/index.html") A reminder, unlike GLPRO, the HTTP OPEN command is not required by HTTP GET, HTTP GETFILE and HTTP GETVAR. ---------------------------------------------------------------------------- Wed, 19 December 2007 Added a bunch of new HTTP commands: HTTP POST URL STRING HTTP POSTFILE URL FILENAME HTTP POSTVAR URL VARNAME HTTP POSTMETHOD MIMETYPESTRING HTTP VERSION VERSIONSTRING HTTP PUT URL STRING HTTP PUTFILE URL FILENAME HTTP PUTVAR URL VARNAME HTTP VERSION sets the HTTP protocol version transmitted by the HTTP PUT/GET/POST commands. HTTP POSTMETHOD sets the mimetype for HTTP POST commands. For example: HTTP POSTMETHOD "application/octet-stream" More info on how POST works can be found here: http://developers.sun.com/mobility/midp/ttips/HTTPPost/ New system status variable for HTTP PUT and HTTP POST. It is @HTTPRESULT, and it contains any messages sent back from the web server at completion of a PUT/POST. For example: drawclear white http open "192.168.2.101" result = http(postfile,"/Scripts/ReadAll.asp",test.txt) messagebox @httpresult "bytes written "$@result exitnow A new system variable @HTTPPOSTFLAGS. It controls the HTTP POST* commands. The options are the same as with the HTTPPUTFLAGS and HTTPGETFLAGS variables: Default value is: SET HTTPPOSTFLAGS NO_CACHE_WRITE ---------------------------------------------------------------------------- Thu, 06 December 2007 Bug added in previous build with WHENs not being triggered in the correct order, and multiple triggered WHENs being lost. Fixed, internal WHEN queue simplified and made more robust. ---------------------------------------------------------------------------- Tue, 04 December 2007 Crashing bug when creating and removing a large number of WHENs is fixed. Bug in the use of 0.0 constant fixed, it was being compiled as "." which broke code that added 0.0 to a integer to force floating point. ---------------------------------------------------------------------------- Mon, 19 November 2007 Bug in IMAGESIZE and IMAGESIZEFIT which would incorrectly scale images that had IMAGEALPHA enabled. Fixed. Reading of system variables using a variable is now supported, for example: var = "drawmaxx" textln @@var This is not supported for system variables that return more than a single value. Bug in use of superscript text at the start of a line not increasing the line height to include space for the superscript text. Fixed. ---------------------------------------------------------------------------- Thu, 15 November 2007 The ->DBRECORDS feature was not taking into account indexes (including search results). Fixed. AGCOMP now displays an error dialog with the error information. This is because AGCOMP is normally run from a GUI application like AGEDIT which was not displaying error codes. Numerous problems with Modular compiler related to Visual Studio fixed. The modular compiler now requires the Microsoft Visual Studio Runtime be installed: http://www.google.com/search?btnI=I%27m+Feeling+Lucky&q=visual+studio+runtime+download I'm using a Google search link because Microsoft has been notorious about changing links making URLs invalid with alarming frequency. AGCOMP now does much more extensive error checking when doing a modular compile. Tools for modular compile expanded to include all the assorted little DLLs that Microsoft now requires just to run LINK.EXE. ---------------------------------------------------------------------------- Mon, 05 November 2007 64bit build of AGCOMP built and tested, results of a large compile are identical. There is no "need" for a 64bit bit build of AGCOMP, it's just a stepping stone in creating a 64bit bit build of AGPLAY since they share a large number of source files. Problem with first command line parameter being lost when running a compiled EXE is fixed (was related to switch to Visual Studio 2005). Problem with Modular compiler related to placement of NO_*.OBJ files fixed. ---------------------------------------------------------------------------- Thu, 01 November 2007 Bug in calling of WINFONT from code which sets the default font was causing errors in Modular compiler, fixed. Project files for IEAfterGRASP BHO (DLL) and regular AfterGRASP (EXE) are split up to eliminate some crazy problems with Visual Studio 2005 profiles. ---------------------------------------------------------------------------- Wed, 31 October 2007 Modular compiler updated for Visual Studio 2005. Unfortunately, the smallest runtime has grown from around 300k to 400k. This is because in the old Visual Studio 6 build of AG, I was able to stub out some startup runtime routines that we don't need. But in the Visual Studio 2005 runtime, those stubs were causing crashes. Updates to HTTP PUT code (not working yet). ---------------------------------------------------------------------------- Tue, 30 October 2007 Porting to Visual Studio 2005 almost complete, only remaining issue is collecting the modular compiler toolset. XMLLIB2 upgraded from 2.6.22 to 2.6.30 to correct some porting issues. ---------------------------------------------------------------------------- Sat, 27 October 2007 All of AG recompiled using Visual Studio 2005 SP1. Extensive small syntax changes required to eliminate compiler warnings and errors. For instance the VS 2005 compiler changed the scope of variables declared in a for() statement. This broke code all over the place in AfterGRASP. Bug found in XMLSEARCH, was not returning multiple matches (revealed in fixing code for VS 2005). Bug found in ARRAYPAIRS, it was always hanging with a stack overflow (another bug found by upgrade to VS 2005). ---------------------------------------------------------------------------- Fri, 26 October 2007 Serious bug in the GLOPEN code which was using uninitialized data space at the end of a filename is fixed. Bug in hex decode caused by switch to using size_t (which is unsigned) instead of int. Fixed by creating ssize_t (signed version) now used in numerous places (avoiding other hidden bugs). GLOPEN of an EXE file no longer needs a "resource:" prefix. It is now automatically added whenever the file extension is EXE. This also applies to the filename passed to the runtime (useful for debuggin). The MEMADDADR command now converts it's results to a POINTER even if all the values passed to it are not a POINTER. This has the useful side effect of converting a integer into a pointer which is needed by some Windows API calls that will accept a constant value. For example, this code snippet from AGEXE now uses memaddadr(10) to create the POINTER value of 10 used for the UpdateResource DLL call. dllsetup @kernel32 HANDLE "BeginUpdateResource" STRING BOOL dllsetup @kernel32 BOOL "UpdateResource" HANDLE PTR STRING WORD PTR DWORD RT_RCDATA = memaddadr(10) memload @theglname glbuf filecopy @runtimename @exename hUpdateRes = BeginUpdateResource(@exename, @FALSE) result = UpdateResource(@hUpdateRes, @RT_RCDATA, "GL", 0, @glbuf, glbuf->dim1) ---------------------------------------------------------------------------- Tue, 23 October 2007 Early prep being done to port AG to 64bits (primarily for server side tasks such as printing which do not run well on Win2003 x64). Because AfterGRASP only uses 62bits for integers, it is not safe for 64bit addresses used in x64 code. To correct this, all commands in AG that use memory addresses such as MEMNEW, SET, and DLL calls now use a internal POINTER type. All references to buffers created with MEMNEW now return a POINTER type which knows the original buffer size. This allows internal bounds checking to prevent overwriting before or after the allocated buffer. All MEMSET and MEMGET commands rewritten to use an internal pointer type. This means you cannot just pass an integer as the address to write to, it must be a pointer either gotten from a buffer created with MEMNEW or MEMLOAD, or passed as a return value from a DLL, or read from memory using MEMGETPOINTER. DLLSETUP and calling code modified to handle x64 code. New type you can pass or have returned from a DLL call "PTR". Behaves exactly the same as "FARPTR" (the prefix "FAR" is a legacy concept from the bad old 16bit Windows days). DLLSETUP still allows FARPTR even though there is nothing "FAR" about it. @NUMBER where number is a memory address used to read a string from memory. It will now only accept a POINTER as the address. Two new commands MEMSETPOINTER and MEMGETPOINTER have been added. They have the same syntax as MEMSETLONG and MEMGETLONG. MEMSETPOINTER only accepts POINTERs to be written to memory, and MEMGETLONG returns POINTERs. The @NULL system variable is now of type POINTER. Whenever using a POINTER as a number or string, it will be converted to integer first. For instance: memnew hello 100 set @hello "Test" msg = "At "$@hello$" Address" ; pointer is converted to integer text @msg$" "$@@hello wait ---------------------------------------------------------------------------- Thu, 11 October 2007 DRAWMOVE wasn't updating the window, fixed. Debug/Variables display of MEMBUF improved to show the size of the memory buffer, and the address in HEX. First code for HTTP DELETE added (untested) ---------------------------------------------------------------------------- Wed, 03 October 2007 Serious BUG fixed in BHO when exiting a script. It was not correctly unhooking it's self from the IE window, this was preventing any further updates to that IE window. The problem was related to where the unhook API is called, apparently it must be called from the same thread that originally hooked the window. New command WEBNAVIGATE, only functional inside the BHO version of AfterGRASP. Used to navigate to a new webpage, either in a new window, or in the current active window. RESULT = WEBNAVIGATE(URLSTRING) RESULT = WEBNAVIGATE(URLSTRING, TARGETSTRING) The default value for TARGETSTRING is "_self". If TARGETSTRING is "_self" (or leftout or blank), then the new webpage is loaded into the current active window. But not until the script exits. The return value is 0 since the actual navigation hasn't taken place yet. If TARGETSTRING has a other value, then the webpage is loaded into a new window immediately, and the return code from the IE goNavigate method is returned. ---------------------------------------------------------------------------- Wed, 26 September 2007 If thestarting GL filename passed to AGPLAY.EXE, or IEAfterGRASP BHO is a URL, then any suffix parameters are trimmed off the GL path, and are setup as default variables. For security reasons, system variables are blocked via this method. http://www.datadump.com/test.gl?page=57&title=Hello URLs with the "file://" prefix work with this in AGPLAY.EXE, but not in the IEAfterGRASP BHO since InternetExplorer pre-parses the URL and removes and suffix before it's made available to the BHO. ---------------------------------------------------------------------------- Wed, 19 September 2007 A couple crashing bugs in the AVL Trees template library when rebalancing trees fixed (AVL Tree template code is being used in more parts of AG which is bringing the less common problems to light). A couple problems with AGCOMP when dealing with files in a relative path like "..\example\startup.ags" are fixed. A surprisingly long term memory leak has been discovered. The ARRAYINDEXs which are created whenever you reference an array were shockingly not being freed correctly! This came to light as more arrays loaded from XML (which don't use numeric indexes) were showing odd symtoms. Fixed. Fixed obscure (but very annoying) bug in array indexes, example where the value of mylay[item1][1] was being destroyed (now fixed): drawclear white set variables on set mylay[item1][1] logo pageitem = mylay[item1] messagebox @mylay[item1][1] pageitem = "" messagebox @mylay[item1][1] exitnow ---------------------------------------------------------------------------- Thu, 13 September 2007 HUGE performance problem in BHO version of AG is fixed! It was repainting the screen after every FREE command, and in other inconvenient places. This gives easily a 10x boost in speed to typical applications. After some extensive low level profiling, I've made some general speed ups in all of AG by replacing a couple key functions with faster versions. One in comparing 64bit values, when comparing for equal or not equal. Another in handling of labels and gotos. Several glaring bugs in the AVL TemplateLibrary used for AG have been fixed (that's what I get for using some free sample code as a starting example!). This allows me to finally enable the code which prevents crashes from multiple scripts running at once in a BHO in different windows. New system variable created as part of the debugging process which may be useful in high performance situations. It prevents screen redraws from happening as a result of a FREE command. The default is @TRUE, redraws are enabled: SET SYSFREEREDRAW @TRUE SET SYSFREEREDRAW @FALSE ; disable redraws after FREE commands. Normally, when freeing a layer, or image used in a layer, or scrollbox, or other active object, the screen is automatically updated. Setting SYSFREEREDRAW to @FALSE will prevent this. The SET DEBUGPROFILE feature is now available in AG. It generates reports in the same directory the original source files were in when compiled. The reports have the file extension .PRO. They will not be generated if the original source file is unavailable because the source is included in the profile output. Some example output might look like this: 773 774 41.16 0.02 0.97% for var inarray array(arrayattrib(vars)) 775 93.53 0.01 2.20% local value @vars{@var} 776 ; local oldvalue @value 777 13.03 0.00 0.30% if @replacecount 778 10.40 0.00 0.24% value = strreplace(@value, @replacelist) 779 endif 780 781 942.79 0.11 22.27% if vardef(macros[@var]) 782 1038.03 0.82 24.52% ivars = ¯os[@var] 783 857.01 0.68 20.24% setupvars ¯os[@var] @value @depth+1 784 1.78 0.01 0.04% continue 785 endif First column is the line number Second column is the total time in 1000ths of a second Third column is the average time for each execution of this line Fourth column is the percentage of the total profile execution time Lines with low values have no stats written, so adding up all the total execution times will not give you an accurate total for the entire program. Also the actual time required to process the profile data is not included in the timing. Notice all lines from the source are included, even comments. ---------------------------------------------------------------------------- Mon, 03 September 2007 Fixed a data corruption bug in the use of HTTP: prefixed filenames. Mostly had to do with FileSeek not working correctly, particularly affecting a GL file read via HTTP access. Changed file buffering for HTTP to use a smaller buffer to work around possible bugs in networking API. Added checks to GL open to check for read errors or a corrupt/empty header. ---------------------------------------------------------------------------- Fri, 31 August 2007 Numerous crashing/wierd bugs associated with XML support are fixed. Had to do with the default LIBXML config enabling multi-threaded support, yet not being setup for multi-threads. All the XML multi-threading is now disabled, and those problems are gone. This was mainly an issue with the IEAfterGRASP BHO. ---------------------------------------------------------------------------- Thu, 30 August 2007 Serious bug in both FILECRYPTVERIFY and FILESIGNVERIFY was creating incorrect signatures on files larger than 64k. Fixed. ---------------------------------------------------------------------------- Wed, 22 August 2007 Bug in FILECRYPTVERIFY crashing on an invalid signature is fixed. New command FILESETEND, sets the end of a file to the current file position set by the last FILESEEK, FILEREAD or FILEWRITE. Only works on writable files, not read only files. So a file opened with FILEOPEN cannot be truncated with FILESETEND. The return value is 0 for failure, and 1 for success. FILECRYPTSIGN now correctly truncates after a replacement signature is written. This fixes a problem where if the original signature was larger than the new signature, the newly written signature would be invalid. ---------------------------------------------------------------------------- Tue, 21 August 2007 The MIN, MAX and INT commands were causing the modular compiler to fail if they were not used. This has to do with reserved keywords in C/C++ (which AG is written in). Corrected so that the internal (longer) naming now works in the modular compiler. The FILECRYPTSIGN command now writes the signature to the end of the file, so to sign a GL it's a single simple command, for example: filecryptsign fileget("c:\digilib\digiprivatekey.txt") project.gl The FILECRYPTSIGN command now ignores any existing signature when calculating the new signature, and will overwrite any existing signature. If the original signature is longer than the new one, they new signature will not be valid. ---------------------------------------------------------------------------- Mon, 20 August 2007 FILECRYPTSIGN and FILECRYPTVERIFY were not properly closing the file after running. Fixed. Some additional error checking added to CRYPTSIGN code. ---------------------------------------------------------------------------- Thu, 16 August 2007 New commands: INTEGER32 = FILECRC32(FILENAME) BINARYSTRING = FILEMD5(FILENAME) BINARYSTRING = FILESHA1(FILENAME) BINARYSTRING = FILESHA2(FILENAME) SIGNSTRING = FILECRYPTSIGN(PRIVATEKEY, FILENAME, OPTIONALEXTRATEXT) FAILURECODE = FILECRYPTVERIFY(PUBLICKEY, FILENAME, SIGNSTRING) FAILURECODE = FILECRYPTVERIFY(PUBLICKEY, FILENAME) FAILURECODE = FILECRYPTVERIFY(FILENAME) FAILURECODE is -1 for not a valid signature, 0 for correct match, and 1 for a mismatch. They all function just like the STR versions of the same commands, except they function on a file, and do not buffer the entire file in memory, they work off small chunks read one at a time instead. This allows verification of files on disk without managing memory buffers, and possibly running out of memory on large strings read into memory. ---------------------------------------------------------------------------- Wed, 15 August 2007 Two new font styles supported, they are SUPERSCRIPT and SUBSCRIPT. They work with both the WINFONTSTYLE and FONTSTYLE commands. FONTSTYLE SUPERSCRIPT FONTSTYLE SUBSCRIPT This also applies to fontstyle variations like this: drawclear white fontstyle render allvariations superscript allvariations subscript allvariations fontdefine arial9 arial 32 set variables on ; shows 45 fonts have been defined! color black textln textln font arial9 text arial9 font arial9sup text arial9sup font arial9sub text arial9sub wait exitnow WINFTONTSTYLE/FONTSTYLE VARIATIONS now supports up to 60 variations, the previous limit was 20. ---------------------------------------------------------------------------- Wed, 01 August 2007 Bug in handling of "" tags which would sometimes cause the color text color to switch to black is fixed. Bugs in handling of text color in HTML text near line wraps and other complex tags was sometimes causing the text color to not change correctly. Seen most often in A HREF links that are near line crossings. Fixed. ---------------------------------------------------------------------------- Tue, 31 July 2007 IEAfterGRASP (The Internet Explorer plug-in version) now creates an application directory and sets that as the current directory at startup. On a WinXP system where you are logged in as Administrator would use this directory: "C:\Documents and Settings\Administrator\Application Data\IEAfterGRASP" The next build will likely extend that directory to include a coded version of the URL the GL is loaded from. For example: http://www.aftergrasp.com/Test.gl "C:\Documents and Settings\Administrator\Application Data\IEAfterGRASP\http\www.aftergrasp.com\Test.gl" This URL to path code is not enabled yet because of security concerns, and will take some more path analysis before it is enabled. ---------------------------------------------------------------------------- Thu, 11 July 2007 Fixed two serious bugs in arrays looping back upon themselves when used with variables references, and array references. You won't be preventing from creating a loop back index, but at least it will no longer crash with a stack overflow, or hang in an infinite loop. Example that would crash: testc = testz[test] testz = testc[1] text @testc[0] ---------------------------------------------------------------------------- Mon, 09 July 2007 New command VARTYPE, you pass it a variable name (or variable names), and it returns the variable type as a uppercase string. If the variable is undefined the result is "". Possible variable types are: INTEGER FLOAT INVALID STRING LABEL INSTANCE PROGRAM STACK ARRAY ARRAYINDEX IMAGE FONT UNUSED TIMER DLL DLLFUNC MEMBUF MEMDATA FILE FILEDATA GL AREA BITMASK LAYER WHEN HOTSPOT VECTORDATA MEASURE INPUT IMAGEFADE SOUND DATABASE DBFIELDNAME DBINDEX DBCACHE DBRECORDCACHE SCROLLBOX BSTRING WEB The VARSHIFT command is now supported. It works much like in GLPRO, default value is -1 if none is given. -1 removes the @1 parameter and renumbers all successive parameters downward by 1. -2 would remove @1 and @2, renumbering downward by 2. Use of a positive value for VARSHIFT (inserting parameters) is not functional yet. ---------------------------------------------------------------------------- Tue, 03 July 2007 Bug where previous build would frequently give missing signing key error is fixed. Hanging bug in incorrectly formed HTML tags is fixed. "Hello there
    " text "Size 6
    " text "Size 24pt
    " text "Size 24
    " text "Points 6
    " text "Points 24pt
    " text "Points 24
    " wait exitnow ---------------------------------------------------------------------------- Thu, 28 June 2007 Updated error messages for corrupt or missing signatures in GL files, they now include the URL/Filename for the GL. Added restart on replace option to CAB install so that replacing a running IEAG BHO will work (although it will prompt for a reboot). ---------------------------------------------------------------------------- Wed, 27 June 2007 ROOT and Digi-products keys regerated, signed and replaced because of a couple security flubs I made. Ooops! Fixed memory free in balanced AVL trees template which will be used for new label management code. Unfortunately there are still problems, so this AVL code is disabled. ---------------------------------------------------------------------------- Mon, 25 June 2007 The STRPUBLICPRIVATEKEYS command has two extra options added: SETS PUBLICKEY PRIVATEKEY STRPUBLICPRIVATEKEYS() SETS PUBLICKEY PRIVATEKEY STRPUBLICPRIVATEKEYS(BITS, EXTRA) SETS PUBLICKEY PRIVATEKEY STRPUBLICPRIVATEKEYS(BITS, EXTRA, SIGNINGPRIVATEKEY) SETS PUBLICKEY PRIVATEKEY STRPUBLICPRIVATEKEYS(BITS, EXTRA, SIGNINGPRIVATEKEY, EXTRASIGN) BITS is the number of key bits (default 4096), valid values are 1024, 2048 and 4096 EXTRA is extra comment text to be included in the key. Each line in the extra text must be preceeded by a "# " (unless blank), and terminated by a @CRLF. SIGNINGPRIVATEKEY is a private key used to sign both of the produced keys, the signature is the same as using the STRCRYPTSIGN command and appending the result to the key string. EXTRASIGN is the extra text for the signing process IEAG no longer supports AGC files in a URL, it only watches for GL files, and will only open one that has been signed with the Digi-products key (which is signed with the IEAG root key). STRCRYPTVERIFY will now accepts a single string, and will find the signature appended to the end: Example: extra = "# Sublicense: Toady Cakes Inc."$@crlf extra = @extra$"# Libya"$@crlf extra = @extra$@crlf extrasign = # Digi-products Ltd."$@crlf sets publkey privkey strpublicprivatekeys(1024, @extra, @digirootprivatekey, @extrasign) messagebox strcryptverify(@digirootpublickey, @publkey) messagebox strcryptverify(@digirootpublickey, @privkey) ---------------------------------------------------------------------------- Wed, 20 June 2007 Added PreApproved registry key for IEAfterGRASP Browser Add-on to correct problems with non-administrators not being able to use the DLL. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Ext\PreApproved Added IE enable 3rd Party Extensions registry setting to IEAG Setup. This is what a signature created by STRCRYPTSIGN looks like before it has been encrypted with the private key: # Begin AfterGRASP Signature # 1024 bits, Wed Jun 20 13:33:40 2007 Bytes: 11 SHA256: 0xabf5dacd019d2229174f1daa9e62852554ab1b955fe6ae6bbbb214bab611f6f5 MD5: 0x32b170d923b654360f351267bf440045 # End AfterGRASP Signature You can extract this information out of a key with STRDECRYPTPUBLIC like this: textln strdecryptpublic(@publkey, strunbase64(strline(@sign, 2))) ---------------------------------------------------------------------------- Tue, 19 June 2007 Updated RSA encryption code to correct some security problems in the older version, also fixes some C++ compatability. Fixed a bug in STRUNBASE64 which would append an extra zero byte at the end of some even length strings. Rewrote key RSA math functions, NN_DigitMult and NN_DigitDiv in assembly language to speed up the STRPUBLICPRIVATEKEYS command (which is very slow with 4096 bit keys). They still can take minutes to calculate a single key pair, but the time has been reduced. The 1024 bit key generation is now nearly instant (a few seconds on a Core2 DUO E6600). All RSA public key encrypt and decrypt commands did not work on strings longer than (KEYBITS/8)-11. Which is 117 bytes for a 1024 bit key. Fixed. Two new commands STRCRYPTSIGN and STRCRYPTVERIFY: SIGNSTRING = STRCRYPTSIGN(PRIVATEKEY, STRING, OPTIONALEXTRATEXT) FAILURECODE = STRCRYPTVERIFY(PUBLICKEY, STRING, SIGNSTRING) FAILURECODE is -1 for not a valid signature, 0 for correct match, and 1 for a mismatch. sets publkey privkey strpublicprivatekeys(1024) teststr = "Hello There" textln sign = strcryptsign(@privkey, @teststr, "# John Bridges"$@crlf) textln @sign textln textln strdecryptpublic(@publkey, strunbase64(strline(@sign, 2))) textln matchstr[-1] = "Invalid Signature" matchstr[0] = "Signature Matches" matchstr[1] = "Signature Mismatch" textln @matchstr[strcryptverify(@publkey, @teststr, @sign)] textln ---------------------------------------------------------------------------- Mon, 18 June 2007 New commands added for public key cryptography (using RSA algorithm). They support key sizes from 1024 bits up to 4096 bits. They are not intended to be used to encrypt or decrypt large blocks of data, they are NOT secure when used for that purpose. The correct way to use public key encryption for anything large is to encrypt a traditional cryptography key (like AES or Blowfish) using the public key system, and use the traditional cryptography key for the actual data. The new STRPUBLICPRIVATEKEYS command is used to create a public/private key pair. The keys are written as human readable ascii in standard IPSEC format. SETS PUBLICKEY PRIVATEKEY STRPUBLICPRIVATEKEYS() SETS PUBLICKEY PRIVATEKEY STRPUBLICPRIVATEKEYS(BITS) An example set of keys written using this script: sets public private strpublicprivatekeys(1024) filesend "c:\publickey.txt" @public filesend "c:\privatekey.txt" @private I've truncated the long lines to fit normal margins in this document, and the lines preceeded with '#' are comments that can be removed. privatekey.txt # 1024 bits, Mon Jun 18 13:37:59 2007 # for signatures only, UNSAFE FOR ENCRYPTION Modulus: 0xbc4ec7c03be91b8329b731ea1cf90666ce9707c020984007bf3e34f...9cc0cad5041e8f19e96e42403df6c6b809d5bf PublicExponent: 0x010001 # everything after this point is secret PrivateExponent: 0x110cd90d50df647c55d49e926219323930cf8006276d61ae...fcd1c464bd1e947bec0d729491039efd50b31 Prime1: 0xee724755dd7560267f303f822e8f6603beb63...5cedb4a84c219a500e6c1d583 Prime2: 0xca2b98bda66e1747c50e2e4b9b0cb9e2...a82880202552bb33442cb77500c615 Exponent1: 0x49a1163008836f1e541604f661043cbf194bd24a2e518...1c67f771a08630595f1c1c95108cb0171521931ff59b Exponent2: 0x7b41e1399f0277c715e8f368bcfb214982e44e594ae80...9397357215d69d9260cc7e750a793624566ef332a991 Coefficient: 0xa38a36fc5cf4d4bfa430c17abd8dd25617d6339583...c3ed57559457b24f6e3413acf771c12a46c8c7c220bd925 publickey.txt # 1024 bits, Mon Jun 18 13:37:59 2007 # for signatures only, UNSAFE FOR ENCRYPTION Modulus: 0xbc4ec7c03be91b8329b731ea1cf90666ce9707c020984007bf3e34f...9cc0cad5041e8f19e96e42403df6c6b809d5bf PublicExponent: 0x010001 You can also use a copy of the IPSEC program on Linux machines to generate a private/public key: ipsec rsasigkey --verbose 1024 > privatekey The public/private cryptographic commands are used in alternate pairs. So for instance you encrypt using a private key, and decrypt using a public key. Such as: result = strencryptprivate(@private, "Hello There") dresult = strdecryptpublic(@public, @result) textln strhex(@result) textln @dresult ENCRYPTEDRESULT = STRENCRYPTPUBLIC(PUBLICKEY,STRING) ENCRYPTEDRESULT = STRENCRYPTPUBLIC(STRING) ENCRYPTEDRESULT = STRENCRYPTPRIVATE(PRIVATEKEY,STRING) ENCRYPTEDRESULT = STRENCRYPTPRIVATE(STRING) DECRYPTEDRESULT = STRDECRYPTPUBLIC(PUBLICKEY,ENCRYPTEDSTRING) DECRYPTEDRESULT = STRDECRYPTPUBLIC(ENCRYPTEDSTRING) DECRYPTEDRESULT = STRDECRYPTPRIVATE(PRIVATEKEY,ENCRYPTEDSTRING) DECRYPTEDRESULT = STRDECRYPTPRIVATE(ENCRYPTEDSTRING) Encrypted results are larger than the original, and the size is rounded up to the blocksize required for the given key size. Two new string commands, STRBASE64, and STRUNBASE64. They work just like STRHEX and STRUNHEX except they encode binary data in BASE64 ascii encoding instead of hexidecimal. BASE64 is much more efficient taking only 4 bytes in the encoded string for each 3 bytes in the original string. HEX takes up double the original number of bytes. ENCODEDSTRING = STRBASE64(@LARGESTRING) Last build of AfterGRASP had all input/messaging broken (was using incorrect place to store window instance information). Crashing bug introduced with new erasebackground support added for IEAG fixed. Web/CAB install for IEAG finished with InnoSetup, and Olive skin. All parts are now digitally signed to eliminate warnings and "(not verified)" notices. ---------------------------------------------------------------------------- Thu, 31 May 2007 Problem with IEAG not responding unless the URL is passed on the command line is fixed. Also typing in successive URLs now works. Multiple tabs or windows opened with IEAG URLs will fail! (needs new code to spawn different token dictionary for each IEAG window). ---------------------------------------------------------------------------- Wed, 30 May 2007 Crashing bug when feeding a HTTP: filename with .GL suffix as the startup filename (common with IEAG) fixed. Added more error checking, and changed the order in which the interpreter instance is created (is now created before a GL is opened). New command, BROWSER with subcommands like HTTP. Used to control the BROWSER host when IEAG is being used. Possible options may include CLOSE (close browser), EXITURL (set URL to link to when current AG Script exits), NAVIGATE (links to URL with AG Script still running). ---------------------------------------------------------------------------- Mon, 28 May 2007 Completely removed all code for debug dialog. This corrects crashes in IExplore when debugging. Fixed Input messages and missing paint messages, it now hooks both GetMessage and CallWndProc, and processes the events slightly differently. ---------------------------------------------------------------------------- Tue, 22 May 2007 Corrected a bunch of development settings tfor precompiled headers that were changed to build IEAG correctly. All versions now build much much faster, about 5 minutes vs the over 10 minutes it took before. IEAG Bugs in when to allow window paint, in filtering messages, and in preserving the window handle are all fixed. These fixes resolved most of window paint issues for IEAG. ---------------------------------------------------------------------------- Thu, 17 May 2007 IEAG now finds the correct window handle to draw in. This fixes all the overwriting tab buttons, and other border elements. Hanging problem of IEAG stealing messgaes from browser fixed. There is some mysterious problem of messages not making it into IEAG's hooked message handler. Until that is resolved, window paint, and input (keyboard and mouse) are still broken. ---------------------------------------------------------------------------- Wed, 16 May 2007 IEAG BHO's interpreter now runs as a new thread, numerous new checks added to avoid corruption and to correctly shutdown IEAG. Draw area still too large, window not updated correctly and input still not working. ---------------------------------------------------------------------------- Tue, 08 May 2007 First running test of IEAfterGRASP BHO worked. Painted too large an area, and hung on input. ---------------------------------------------------------------------------- Thu, 03 May 2007 Fixed crashing bug when no DEFAULT.GLF is included in a project. This has been in there for a long time. Use of HTML text without any defined fonts was giving blank results. Fixed. If no DEFAULT.GLF is included, AfterGRASP now does a default FONTDEFINE to create a default Arial font. Large changes in startup and shutdown code in AfterGRASP as part of the creation of the IEAfterGRASP BHO (Browser Helper Object). This may cause unusual bugs in this release of AfterGRASP. Use of "file:///" as a prefix on a filename is now supported, the rest of the filename will have %DD characters translated (such as %20 into ' '), and '/' into '\'. This is to support URL filenames for local files (part of testing of IEAfterGRASP BHO). ---------------------------------------------------------------------------- Wed, 28 March 2007 ActiveX simple project merged into AfterGRASP code including resources. The IAfterGRASP ActiveX is 2.519MB in size. REGSVR32 IAFTERGRASP.DLL does not work (something is broken). ---------------------------------------------------------------------------- Sun, 04 March 2007 All IAfterGRASP object code rewritten as real C++ classes (was originally written in C hybrid). The C hybrid code is still in place (but not enabled) until the C++ classes code has been tested more. As part of this process, several memory leaks and incorrect declarations are fixed. ---------------------------------------------------------------------------- Thu, 22 February 2007 Return VARIANT type for IAfterGRASP Methods that have no return value is now VT_VOID. Was VT_EMPTY. When converting arrays passed to IAfterGRASP Methods, any type not directly handled is now converted to a string (for example VT_DATE). ---------------------------------------------------------------------------- Wed, 21 February 2007 Passing arrays into IAfterGRASP Methods is now supported, all single dimensional array types are automatically converted into AG arrays including: VT_I1 VT_I1+VT_BYREF VT_I2 VT_I2+VT_BYREF VT_I4 VT_I4+VT_BYREF VT_R4 VT_R4+VT_BYREF VT_R8 VT_R8+VT_BYREF VT_BSTR VT_BSTR+VT_BYREF VT_BOOL VT_BOOL+VT_BYREF VT_UI1 VT_UI1+VT_BYREF VT_UI2 VT_UI2+VT_BYREF VT_UI4 VT_UI4+VT_BYREF VT_I8 VT_I8+VT_BYREF VT_UI8 VT_UI8+VT_BYREF VT_INT VT_INT+VT_BYREF VT_UINT VT_UINT+VT_BYREF VT_VARIANT VT_VARIANT+VT_BYREF This is a large amount of new code, so there are likely bugs. Working, tested example that uses multiple return values from an IAfterGRASP function: set wshShell = WScript.CreateObject ("WSCript.shell") wshshell.run "agplay /r", 6, True set myObj = CreateObject("IAfterGRASP.object") deck = myObj.random(1,52,52) hand = "" for each card in deck hand = hand&card&" " next hand = left(hand, len(hand)-1) msgbox hand msgbox myObj.random(0,255,3)(0), 0, "random(0,255,3)(0) function call" wshshell.run "agplay /u", 6, True ---------------------------------------------------------------------------- Thu, 15 February 2007 Up until now, all the command methods for the IAfterGRASP object were broken or barely working. I've finally rewritten all of them use vararg which allows any number of parameters or any type to be passed to any command. I've also completely rewritten the return value code to use a VARIANT return value. For commands that have multiple return values the new return code will create a SAFEARRAY of VARIANTs. There are still problems, for instance MsgBox accepts a return value, but set gives an error when testing with vbscript like this: set wshShell = WScript.CreateObject ("WSCript.shell") wshshell.run "agplay /r", 6, True set myObj = CreateObject("IAfterGRASP.object") MsgBox myObj.abs(-999), 0, "abs(-999) function call works!" set blah = myObj.abs(-999) MsgBox blah, 0, "never gets here" wshshell.run "agplay /u", 6, True Bug in tab formatting of text when using WINFONT, this was showing up in little empty box characters at each tabstop. Fixed. ---------------------------------------------------------------------------- Tue, 13 February 2007 New command line option '/w' used only for debugging purposes, it's the same as '/r' but does not exit. All SET/GET objects in IAfterGRASP object are now VARIANT, and will accept integers, reals (floating point), bool and strings. All other types either passed or returned are converted to strings. Runable test: set wshShell = WScript.CreateObject ("WSCript.shell") wshshell.run "agplay /r", 6, True set myObj = CreateObject("IAfterGRASP.object") MsgBox myObj.aftergrasp, 0, "aftergrasp variant variable" myObj.aftergrasp = "Hello" MsgBox myObj.aftergrasp, 0, "aftergrasp variant variable" wshshell.run "agplay /u", 6, True ---------------------------------------------------------------------------- Wed, 07 February 2007 Bug in use of numeric colors in some commands (like IMAGENEW). It was using some seemly random value instead of the number you passed. This bug first appeared in the Jan 11th 2007 build. Example of this bug (now fixed): drawclear white color green imageput 0 0 imagenew(100,200,32,0) wait exitnow ---------------------------------------------------------------------------- Mon, 05 February 2007 Text wrapping with some anti-aliased fonts (corpoS for example) was allowing the last pixel to be cropped in some rare cases. This had to do with the calculation for the extra blank pixels beyond a character cell before the next character rounding up instead of down. Fixed. ---------------------------------------------------------------------------- Wed, 31 January 2007 WEBNEW extended to allow setting a default position and size: WEBNEW VARNAME WEBNEW VARNAME XSIZE YSIZE WEBNEW VARNAME XPOS YPOS XSIZE YSIZE WEBOBJVAR = WEBNEW() WEBOBJVAR = WEBNEW(XSIZE,YSIZE) WEBOBJVAR = WEBNEW(XPOS,YPOS,XSIZE,YSIZE) Two crashing bugs when using more than one WEBNEW at once are fixed. WEB series of commands rewritten to no longer create a new window handle for each browser object. Instead they use the current AG window. This fixes many of the eventid problems, for instance this test now works (if you click outside the browser area): windowsize 800 600 drawCLEAR red color black webnew testg (800-640)/2 (600-480)/2-10 640 240 webnew testy (800-640)/2 (600-480)/2+260 640 240 weburl testg "http://www.google.com" weburl testy "http://www.yahoo.com" wait messagebox "removed" exitnow ---------------------------------------------------------------------------- Tue, 30 January 2007 NETCONTROL test command removed. New commands that interface to InternetExplorer object added: WEBNEW VARNAME WEBLOAD HTMLFILENAME VARNAME WEBPOSITION VARNAME XPOS YPOS WEBSIZE VARNAME XSIZE YSIZE WEBTEXT VARNAME HTMLTEXTSTRING WEBURL VARNAME URLSTRING [FLAGS TARGETFRAMENAME POSTDATA HEADERS] WEBFREE VARNAME WEBCONTROL VARNAME OPTION GOBACK GOFORWARD GOHOME SEARCH REFRESH Small test example: drawclear red color black webnew test weburl test "http://www.google.com" delay 500 free test messagebox "removed" exitnow There are messaging and eventid problems, this is still in the testing phase. ---------------------------------------------------------------------------- Tue, 23 January 2007 New NETCONTROL command, creates a Browser Helper Object for testing. No parameters yet. New XMLSEARCH command, searches one or more XML Arrays loaded with XMLLOAD, or provided by previous XMLSEARCHs. Returns one or more array references. RESULTARRAY = ARRAY(XMLSEARCH SEARCHSTRING XMLBUF [XMLBUF2 ...]) A runable example: drawclear white color black xmlstr = " Alabama Republican Alabama Democrat Alaska Republican Alaska Democrat Arizona Republican Arizona Democrat Arkansas Republican Arkansas Democrat California Republican California Democrat Colorado Republican Colorado Democrat " memnew buf strlen(@xmlstr) set @buf @xmlstr set variables on xmlload "mem:buf" xmltest results = array(xmlsearch("Donkey", xmlsearch("Hello", xmltest))) set textwrap off text strlist(@results) wait exitnow ---------------------------------------------------------------------------- Sun, 21 January 2007 XMLLOAD now supports CDATA (treated the same as text). ---------------------------------------------------------------------------- Mon, 15 January 2007 The support for finding the zero'th element in arrays automatically to help with XML access with duplicate tags is revised to only work on reading an array, not when writing to an array (setting values). This corrects bugs when you would do something like this: drawclear white color black test = array() ; this was setting "test = hello" instead of "test[0] = hello" test[0] = hello test[1] = goodbye textln strlist(@test) textln @test[0] wait exitnow ---------------------------------------------------------------------------- Thu, 11 January 2007 To avoid conflicts with identically named variables and commands the following syntax changes are made to AG: DRAWFILTER command renamed to IMAGEDRAWFILTER INPUTBEGIN variable renamed to INPUTBEGINPOS WINDOWSCALED command renamed to WINDOWSCALE The AfterGRASP methods for the following variables have been removed to make space for command methods: ANIMABORT APPUSESHELL32 DATACOUNT DBUSEASCII DEBUGEXIT DEBUGMP3 DEBUGNET DEBUGPROFILEt DEBUGSYSTEMLIST DEBUGTRACK DEBUGWAV EMAILBYTES EMAILCOUNT EMAILDNSERROR EMAILDNSSERVER EMAILERROR EMAILFROM EMAILMAILER EMAILPRIORITY EMAILPROXY EMAILREPLY EMAILTO ERRORCRITICAL ERRORLINE ERRORNUMBER ERRORSCRIPT ERRORSTACK ERRORTYPE FILELONGNAME FILESHARE FONTOFFSETLEFT FONTSCANWIDTH FTPCOUNT FTPPROXY GLHANDLE GLMERGEREVERSE GLNAME GLNAMEPREV GLPROFOCUS GLPROMULTIPLE GLPROUSER GLPROVERSION GLPROWIN32 HTTPCOUNT HTTPPATH HTTPPROXY HTTPTEMPDIR IMAGEDITHER IMAGEEDGECOLOR IMAGEEDGEENABLED IMAGEFADEBARSIZE IMAGEFLOATLAST IMAGEPRELOAD IMAGEREGIONMASK IMAGETRANENABLED INIINTERNAL KEYABORTDELAY KEYCLEAR LAYERHOTSPOT LAYERSEPARATE LAYERSKIPFRAMES LOOP MEMAVAILABLE MEMNEAR MOUSEALWAYS MOUSEMOVED NETPROXYTYPE PALETTEACCURATE PALETTEEND PALETTEENDEXCLUDE PALETTEREMAP PALETTESTART PALETTESTARTEXCLUDE PRINTCMYK SCRIPTBUFFER SCRIPTERROR SCRIPTSHUTDOWN SCRIPTSIZE SOUNDBLOCKSIZE SOUNDCACHEBITS SOUNDCACHECHANNELS SOUNDCACHEHEAD SOUNDCACHERATE SOUNDCACHESIZE SOUNDCACHETAIL SOUNDCLOCK SOUNDDEVICE SOUNDELAPSED SOUNDLEVEL SOUNDLEVELLEFT SOUNDLEVELRIGHT SOUNDMIXLEADTIME SOUNDPLAYING SOUNDVOLUME SOUNDVOLUMELEFT SOUNDVOLUMERIGHT STACK SYSCPUMMX SYSCPUTYPE SYSCTRLALTDEL SYSDISKMAX SYSDPMS SYSLOCKINPUT SYSMESSAGEDELAY SYSOS2 SYSRUNBACK SYSSLEEP SYSSPACE SYSSWAPPATH SYSYIELD TEXTCOLORCODES TEXTFONTCODES TEXTQUICK VIDEOBENCHMARK VIDEOSCALE VIDEOSCALEX VIDEOSCALEY WHENBACKGROUND WHENENABLED WHENFIRSTONLY WHENLASTFIRST WHENOFFSCREEN WIN31 WIN32 WIN32FILEACCESS WINDOWBACKPOSX WINDOWBACKPOSY WINDOWBACKSIZEX WINDOWBACKSIZEY WINDOWREFRESHRATE WINFRAMEADR WINFRAMEDIB WINFRAMEDIBHDC WINFRAMEHDC WINFRAMEHDIB WINFRAMELEN WINSYSTEMDIRECTORY WINYTOPORIGIN The Set methods are removed for these variables: COLORMAX CR CRCR CRLF DATE DEBUGLINE DEBUGLINES DEBUGSCRIPT DEBUGSCRIPTS DRIVECDROM DRIVECDROMS LF LFLF LOGE PI TIME These commands are not supported by AfterGRASP object methods (they are duplicates of standard windows API calls): WINABORTPATH WINANGLEARC WINARC WINARCTO WINBEGINPATH WINBITBLT WINCHORD WINCLOSEFIGURE WINCREATEBRUSHINDIRECT WINCREATEDIBPATTERNBRUSHPT WINCREATEFONTINDIRECT WINCREATEPALETTE WINCREATEPATTERNBRUSH WINCREATEPENINDIRECT WINDELETEOBJECT WINELLIPSE WINENDPATH WINEXCLUDECLIPRECT WINEXTCREATEPEN WINEXTFLOODFILL WINEXTSELECTCLIPRGN WINEXTTEXTOUT WINFILLPATH WINFILLRGN WINFLATTENPATH WINFRAMERGN WINGETSTOCKOBJECT WININTERSECTCLIPRECT WININVERTRGN WINLINETO WINMASKBLT WINMODIFYWORLDTRANSFORM WINMOVETOEX WINOFFSETCLIPRGN WINPAINTRGN WINPIE WINPOLYBEZIER WINPOLYBEZIERTO WINPOLYDRAW WINPOLYGON WINPOLYLINE WINPOLYLINETO WINPOLYPOLYGON WINPOLYPOLYLINE WINPOLYTEXTOUT WINREALIZEPALETTE WINRECTANGLE WINRESIZEPALETTE WINRESTOREDC WINROUNDRECT WINSAVEDC WINSCALEVIEWPORTEXTEX WINSCALEWINDOWEXTEX WINSELECTCLIPPATH WINSELECTOBJECT WINSELECTPALETTE WINSETARCDIRECTION WINSETBKCOLOR WINSETBKMODE WINSETBRUSHORGEX WINSETCOLORADJUSTMENT WINSETDIBITSTODEVICE WINSETMAPMODE WINSETMAPPERFLAGS WINSETMETARGN WINSETMITERLIMIT WINSETPALETTEENTRIES WINSETPIXELFORMAT WINSETPIXELV WINSETPOLYFILLMODE WINSETROP2 WINSETSTRETCHBLTMODE WINSETTEXTALIGN WINSETTEXTCOLOR WINSETVIEWPORTEXTEX WINSETVIEWPORTORGEX WINSETWINDOWEXTEX WINSETWINDOWORGEX WINSETWORLDTRANSFORM WINSTRETCHBLT WINSTRETCHDIBITS WINSTROKEANDFILLPATH WINSTROKEPATH WINWIDENPATH ---------------------------------------------------------------------------- Wed, 03 January 2007 Big trimming done on COM methods for commands that cuts down on the fluff code that was bloating the last AG runtime posted. In order to simplify using arrays created with XMLLOAD where the XML text has duplicate tags, you can now reference a single item in an array with [0]. For example: drawCLEAR white color black set hello[fred] "Goodbye" textln @hello[fred] textln @hello[0][fred] textln @hello[0][fred][0] set hobble "Hello" textln @hobble textln @hobble[0] textln @hobble[0][0] set atest[0][0] "A" set atest[1] "B" set atest[2] "C" set atest[3] "D" set atest[0][1] "Z" textln strcat(@atest[0]) textln @atest[1] textln @atest[0][1] wait exitnow ---------------------------------------------------------------------------- Wed, 20 December 2006 FONTSAVECOMPRESSED was broken on November 12th. There was a bug introduced as part of the "INS:" support. Fixed. Code added to access all commands from COM object, but there are problems because of the 1024 method limit for DCOM support in windows. Because of this and other problems, the commands methods are inaccessable in this build. ---------------------------------------------------------------------------- Mon, 18 December 2006 New modular option "OBJECT" to disable linking in any COM object support. If IAfterGRASP is not registered (using AGPLAY /R), then none of the COM startup or respond code is executed anymore. This means if you run AGPLAY.EXE with no command line options, it now normally exits immediately instead of waiting for COM calls that will never come. IAfterGRASP object now supports all AfterGRASP Setable and Getable variables (I added all the AfterGRASP variables, even unsupported stubs). Example: set wshShell = WScript.CreateObject ("WSCript.shell") wshshell.run "agplay /r", 6, True set myObj = CreateObject("IAfterGRASP.object") MsgBox myObj.aftergrasp, 0, "aftergrasp integer variable" MsgBox myObj.time, 0, "time integer variable" MsgBox myObj.pi, 0, "pi floating point variable" MsgBox myObj.glpropath, 0, "glpropath string variable" wshshell.run "agplay /u", 6, True List of all variables: aftergrasp animabort appuseshell32 colorback colormax colornum colortran commandline cr crcr crlf datacount date dbskipdeleted dbuseascii debug debugexit debugline debuglines debugmp3 debugnet debugprofile debugscript debugscripts debugsystemlist debugtrack debugwav desktopbits desktopbitsreal desktopsizex desktopsizexreal desktopsizey desktopsizeyreal drawand drawdensityx drawdensityy drawfilter drawheight drawmaxx drawmaxy drawminx drawminy drawoffheight drawoffmaxx drawoffmaxy drawoffminx drawoffminy drawoffwidth drawoffx drawoffy drawor drawtint drawwidth drawxor drivecdrom drivecdroms emailbytes emailcount emaildnserror emaildnsserver emaildnstimeout emailerror emailfrom emailmailer emailpriority emailproxy emailreply emailto errorcritical errorline errorload errormessage errornumber errorscript errorstack errortype false filedialogdefext filedialogpath filegzip fileindexopen fileindexsave filelongname filepath fileshare filestringend filestringstart floatdegrees floatdigits floateuropean floatround fontaddress fontgapchar fontgapline fontgapspace fontname fontoffsetleft fontscanwidth fontshadowpos fontshadowx fontshadowy fontsizex fontsizey ftpbytes ftpcount ftperror ftpproxy glhandle glmergereverse glname glnameprev glprodirectory glprofocus glpromultiple glproname glpropath glproplatform glproruntime glprouser glproversion glprowin32 httpbytes httpcount httperror httpgetflags httppath httpproxy httpputflags httptempdir imagecompressed imageconverttablecmyk imageconverttablergb imagedither imageedgecolor imageedgeenabled imageemfpercent imageemftextwidths imagefadebarsize imagefastscale imagefloatlast imageloadcmyk imagepreload imageregionmask imagetranenabled iniinternal inputabort inputbegin inputchange inputfullexit inputinsert inputpassword inputposition inputrestore inputstring inputtimeout inputwrap keyabortdelay keyclear keydownalt keydownctrl keydownshift keyhotdelay keypressed keyupalt keyupctrl keyupshift layerhotspot layerseparate layerskipframes lf lflf loge loop memavailable memnear memused mouse mousealways mousedown mousedown1 mousedown2 mousedown3 mousedownx1 mousedownx2 mousekey mousemoved mousepressed mouseup mouseup1 mouseup2 mouseup3 mouseupx1 mouseupx2 netconnected netproxytype nettimeout null paletteaccurate paletteend paletteendexclude paletteremap palettestart palettestartexclude pi printcmyk printcolorres printdriver printfilename printmetric printname printpixelsx printpixelsy printport printresx printresy printsizex printsizey quote scrabort screnabled scriptbuffer scripterror scriptname scriptshutdown scriptsize scrpassword scrpreview scrsettings scrsmall soundblocksize soundcachebits soundcachechannels soundcachehead soundcacherate soundcachesize soundcachetail soundclock sounddevice soundelapsed soundlevel soundlevelleft soundlevelright soundmixleadtime soundplaying soundvolume soundvolumeleft soundvolumeright stack syscpummx syscpuraw syscpuspeed syscputype sysctrlaltdel sysdiskmax sysdpms sysesc syslockinput sysmessagedelay sysmessageskip sysos2 sysrunback syssleep sysspace sysswappath sysyield textcenter textclip textcolorcodes textdraw textdrawback textfontcodes textfromstrip texthtml texthtmlantifont texthtmltabs texthtmlwinfont textindent textjustified textkern textkernsize textleft textmonospace textposx textposy textquick textright textrtf textscroll textshadowfilter texttabsize textwrap textwrappunct time timer timeraw true variables videobenchmark videoscale videoscalex videoscaley whenbackground whenenabled whenfirstonly wheninsub whenlastfirst whenoffscreen win31 win32 win32fileaccess win95 win98 win2000 winbuild winclassname windirectory windowbackposx windowbackposy windowbacksizex windowbacksizey windowbitdepth windowposx windowposy windowrefreshrate windowscaled windowscaledx windowscaledy windowsizex windowsizey winframeadr winframedib winframedibhdc winframehdc winframehdib winframelen winhandle wininstance wininstanceprev winnt winshowstyle winstyle winsystemdirectory winversion winytoporigin ---------------------------------------------------------------------------- Wed, 13 December 2006 Three new command line options for AGPLAY.EXE /R which registers AGPLAY.EXE as a COM component, and will prevent AGPLAY.EXE from remaining in memory waiting for COM requests. /U which unregisters AGPLAY.EXE as a COM component, and will prevent AGPLAY.EXE from remaining in memory waiting for COM requests. -Embedding is normally provided by windows when AGPLAY.EXE is run as a COM component. It makes AGPLAY.EXE exit once the last COM object it creates is destroyed. If AGPLAY.EXE is run with no command line parameters, and it will remain in memory until killed with task manager. If AGPLAY.EXE is launched with the "-Embedding" option The only feature available via COM is a simple set/get string buffer to ensure that everything is working correctly. Next build will have more "real" functions enabled. A crude example would be: ' A VBscript example of using AGPLAY.EXE set wshShell = WScript.CreateObject ("WSCript.shell") wshshell.run "agplay /r", 6, True set myObj = CreateObject("IAfterGRASP.object") myObj.Buffer = "Hello world" MsgBox myObj.Buffer, 0, "GetString return" wshshell.run "agplay /u", 6, True A "AfterGRASP.TLB" file is now included with AGPLAY for ease of COM access to AGPLAY. ---------------------------------------------------------------------------- Mon, 11 December 2006 XMLLOAD changed to created a numeric array for duplicate tagged entries, this will break previous projects that duplicate tags. For instance: AUTOEXEC.BAT CONFIG.MSI CONFIG.SYS ph.dll Previously would look like this when loaded with XMLLOAD (notice the missing duplicate tag records): FILES[Exclude][REC] = "CONFIG.SYS" FILES[Exclude][REC] = "ph.dll" And, now looks like this: FILES[Exclude][REC][0] = "AUTOEXEC.BAT" FILES[Exclude][REC][1] = "CONFIG.MSI" FILES[Exclude][REC][2] = "CONFIG.SYS" FILES[Exclude][REC] = "ph.dll" Large number of internal changes to AGPLAY runtime on the road to it working as a AfterGRASP COM Object Server when run a standalone (no script, or GL). Running AGPLAY.EXE with no command line parameters no longer brings up an empty window, instead it activates the COM server module. ---------------------------------------------------------------------------- Wed, 15 November 2006 New internal data type BSTR, matches the Microsoft OLE BSTR data type. It is a string that is 16bits per character, with a 32bit length before the first character, and a 16bit null after the last character. New command BSTR converts any value into a BSTR, the result is an pointer to the first character in the BSTR. ---------------------------------------------------------------------------- Sun, 12 November 2006 Coding for COM support started. Internal FileOpen FileAppend and FileCreate functions now look for a optional prefix that specifies the instance address. This is added so that outside libraries linked into AfterGRASP can still function correctly with AG's file I/O even with multiple instances of the AG's primary object. The syntax of the prefix is: "INS:ADDRESS:FILENAME" The address can be decimal or hex. Like this: "INS:0x3825F22A:example.txt" or "INS:9967239:bitmap.bmp" The "INS:" must be uppercase. FONTSAVECOMPRESSED, all Print commands, and a few other modules rewritten to stop using any kind of static instance data so that they won't crash if more than one instance of the primary AfterGRASP object is created. ---------------------------------------------------------------------------- Tue, 07 November 2006 HOTDISABLE changed so that is now removes any pending rollover, clickdown images, and hotcursor for that hotspot. This is to fix a problem with lingering rollover, clickdown, and hotspot cursors that wouldn't go away until another hotspot was activated.. ---------------------------------------------------------------------------- Wed, 01 November 2006 Bug in SYSTRAYCLICK where return values from subroutines would be left on the stack. Fixed. ---------------------------------------------------------------------------- Tue, 31 October 2006 Happy Halloween! PNG Load was mistakenly inverting the Alpha channel masks, corrected. Creating a PNG with alpha channel mask in Photoshop will now correctly load and display in AfterGRASP (if you enable IMAGEALPHA). Example: drawCLEAR red color black imageload "logo-ps.png" imagealpha on "logo-ps.png" imageput "logo-ps.png" wait exitnow You can find the logo-ps.png image here: http://www.axialis.com/tutorials/sample/logo-ps.png IMAGEALPHA ON (no image buffer) was crashing. Fixed. ---------------------------------------------------------------------------- Fri, 06 October 2006 Bug in COLORHUE which could return a invalid value (divide by zero result). Fixed. This could cause COLORSATURATIONSET (which calls COLORHUE) to hang. NEGATE (function that handles negative sign) fixed for some cases on measurements. ABS now works on measurements. ---------------------------------------------------------------------------- Wed, 04 October 2006 Labels passed to SYSTRAYMENU can now include parameters like: label:(parm1,parm2) Corrected autorun problem in AGSETUP caused by upgrading most recent release of WINRAR (used to compress the AGSETUP distribution). Updated to InnoSetup v5.1.7 in creation of AGSETUP. ---------------------------------------------------------------------------- Tue, 26 September 2006 New option in the " tag sometimes not restoring the previous font size is fixed. New code added for preserving the temporary state inside the HTML parser at the end of word wrapped lines. ---------------------------------------------------------------------------- Thu, 14 September 2006 Added STRLINEREPLACE and STRLINEINSERT commands, rewrote STRLINECLEAR and STRLINEREMOVE syntax for all is: RESULT = STRLINEREPLACE(STRING, LINENUMBER, LINESTRING1, [LINESTRING2], ...) RESULT = STRLINEINSERT(STRING, LINENUMBER, LINESTRING1, [LINESTRING2], ...) RESULT = STRLINECLEAR(STRING, LINENUMBER, LINECOUNT) RESULT = STRLINEREMOVE(STRING, LINENUMBER, LINECOUNT) All handle strings that use either CR, CRLF or just LF as the end of line terminator. Bug in STRLINE fixed where it was not working with strings that use LF alone as the end-of-line. ---------------------------------------------------------------------------- Wed, 13 September 2006 Crashing bug in FILESEND and FILESENDLN fixed. Caused when using a constructed filename (not a constant one, or one read from a variable). STRLINENUMBER was broken, it was always returning 0. Fixed. ---------------------------------------------------------------------------- Tue, 12 September 2006 New FOR option, INARRAY, functions much like IN except that it reads values from an array instead of a string list. for value inarray array(a,b,c,d,e,f) textln @value next The performance of FOR/INARRAY is quite a bit faster than FOR/IN since no string searching or building is required. FOR/INARRAY also allows loops with values other than strings, such as picture arrays arrays of arrays. Three new commands added, ARRAYSINGLEITEM ARRAYSINGLEINDEX and ARRAYSINGLEATTRIB used to walk through an array reading single items, indexs, or attributes. ARRAYSINGLEINDEX was added to support the FOR INARRAY feature, the others were added for future use. example = array(a,b,c,d,e,f) for n from 1 to example->dim1 value = arraysingleitem(example,@n) textln value next Quirk in handling of scaling anti-aliased fonts in FONTDEFINE fixed. ---------------------------------------------------------------------------- Sun, 10 September 2006 You can now use a loaded font as the face name in FONTDEFINE, and it will scale that font to whatever size you specify. The resulting font is always anti-aliased. FONTSAVE changed to create fonts which include 2 more fields, the original font height used in FONTDEFINE, and the width table scaling in floating point (previously only an integer value was permitted) . Fonts saved with this version of AfterGRASP will not load into previous builds of AfterGRASP. FONTLOAD will still load older fonts. Example of using a single large non-anti-aliased font for many smaller sizes: windowsize 960 724 32 drawclear white sizelist = array(36,24,18,14,12,10,8) fontstyle init bold render fontdefine cs72b "corpoS" 72 fontsavecompressed cs72b free cs72b fontload cs72b newscaledtestsingle cs72b fontstyle init underline render fontdefine cs72u "corpoS" 72 fontsavecompressed cs72u free cs72u fontload cs72u newscaledtestsingle cs72u wait exitnow newscaledtestsingle: declare sourcefont for newsize in strlist(@sizelist) fontstyle init anti fontdefine cs$@newsize @sourcefont @newsize font cs$@newsize color black textln "Scaled from non-anti-aliased 72pt to fontsize "$@newsize endloop return ---------------------------------------------------------------------------- Wed, 06 September 2006 Crashing bug in WINFONT and FONTDEFINE when an incorrect font name is used (a font not installed on your system) is finally fixed. Had to do with an uninitialized buffer used for the alternate method of calculating a font width table. FONTCHARPUT and FONTCHARGET commands added. Syntax is not the same as GLPRO as there are more options for start/end draw offsets, and position offsets. FONTCHARPUT FONT PICBUF CHAR [START] [END] [LEFTOFS] [RIGHTOFS] [TOTAL] FONTCHARGET FONT NEWPICBUF CHAR [VARSTART] [VAREND] [VARLEFTOFS] [VARRIGHTOFS] [VARTOTAL] START starting pixel to draw from END ending pixel to draw from LEFTOFS add before drawing (can be negative) RIGHTOFS add after drawing (can be negative) TOTAL total character width Two new commands, FONTNEW and FONTCOPY. FONTSTYLE settings for first and last character in font, and anti-alias settings apply to FONTNEW. FONTCOPY DESTBUF SOURCEBUF FONTNEW FONTBUF [WIDTH] [HEIGHT] [OFFSETMULTIPLIER] FONTGAPS command has an additional parameter which is the value to add to Y coordinate before drawing each character. FONTGAPS GAP SPACEGAP VERTICALGAP YOFFSET ---------------------------------------------------------------------------- Wed, 30 August 2006 With HTMLTEXT ON and PRINTSET (writing HTML text to a printer), if the printer is a postscript device, then "A HREF" tags now generate the PDFMARK code for weblinks. If the URL uses the prefix of "page:" then a page link is generated, otherwise a standard internet URL is assumed. ---------------------------------------------------------------------------- Tue, 29 August 2006 Bug in tabs and bullet text showing odd empty squares at the tab point on some machines is fixed. ---------------------------------------------------------------------------- Tue, 22 August 2006 SCRIPTMERGE now supports filenames in quotes, and when quoted the filename can now include spaces. Bug in STRREPLACE where null/blank values could cause a crash is fixed. ARRAYREMOVE now works with multi-dimensional arrays, for instance: drawclear white a[hello][1] = ok a[hello][2] = test a[hello][3] = again arrayremove a[hello] 2 set variables on wait exitnow ---------------------------------------------------------------------------- Sun, 20 August 2006 New MASK option for DRAWGRADIENT avoids the normal flood fill action of DRAWGRADIENT, instead the mask image defines which pixels to draw. DRAWFLOOD and DRAWGRADIENT when done when PRINTSET is kept from hanging. They don't work (they cannot work without reading the image buffer which does not exist on a printer), but at least they don't hang. ---------------------------------------------------------------------------- Thu, 10 August 2006 The STRHTMLTOFLASH command now only adds target="_blank" if the url starts with a http:. SET TEXTTABSIZE was not applying to PRINTSET (instead the default value of 8 was always used), this is fixed to carry forward the last TEXTTABSIZE setting. This also applies to other drawing variables such as TEXTCENTER, TEXTLEFT, TEXTRIGHT, TEXTJUSTIFY, and DRAWFILTER. SET TEXTTABSIZE now keeps measurments in their original form until the text is actually drawn. This allows you to set the tabsize at the start of your program, and maintain the same size when printing or otherwise changing the resolution. For example: windowsize 640 720 drawclear white set texthtml on set texttabsize -0.85in for dpi from 60 to 180 step 5 imagedensity @dpi textln "HelloThere"$@dpi$"dpi" next wait exitnow ---------------------------------------------------------------------------- Fri, 04 August 2006 With TEXTHTML ON, using to each forces a specific tabstop regardless of font size. ---------------------------------------------------------------------------- Thu, 28 July 2006 With TEXTHTML the "Hello
    " The tag from FLASH is now recognized including the BLOCKINDENT, INDENT, LEADING, LEFTMARGIN, RIGHTMARGIN and TABSTOPS attributes. Numerical values provided for any of the attributes can be a measurement like 10pct, or 5mm, as well as pixel X coordinates. Only the TABSTOPS= attribute is actually functional at this time, the rest do nothing. For example: windowsize 640 720 drawclear white set texthtml on text "" for i from 1 to 8 textln "HelloGoodbye" next wait exitnow DELAY/WAIT were broken in the 16 July 2006 build (they used the GREATERTHAN command, which had it's parameters reversed, so AGCOMP had to be changed to generate a LESSTHAN command instead). ---------------------------------------------------------------------------- Mon, 17 July 2006 Bug in INC/DEC when used with measurements is fixed (was introduced in yesterdays build) ---------------------------------------------------------------------------- Sun, 16 July 2006 ************ DRASTIC CHANGE ************ All code compiled with previous builds of AGCOMP will not work in this and all future builds of AfterGRASP. The order of all math operators has been reversed to make using functions like SUBTRACT and DIVIDE (useful with STREVAL for instace) easier to understand. Previously if you tried subtract(100,5) you would get -95 instead of 95 since it worked in reverse. Here is the test script for this change: windowsize 640 720 drawclear white set texthtml on text "" textln "subtract(100,5)="$subtract(100,5) textln "(100-5)="$(100-5) textln "subtract(100.,5)="$subtract(100.,5) textln "(100.-5)="$(100.-5) textln "subtract(100pct,5pct)="$subtract(100pct,5pct) textln "(100pct-5pct)="$(100pct-5pct) textln "subtract(100pct,5)="$subtract(100pct,5) textln "(100pct-5)="$(100pct-5) textln textln "divide(100,5)="$divide(100,5) textln "(100/5)="$(100/5) textln "divide(100.,5)="$divide(100.,5) textln "(100./5)="$(100./5) textln "divide(100pct,5pct)="$divide(100pct,5pct) textln "(100pct/5pct)="$(100pct/5pct) textln "divide(100pct,5)="$divide(100pct,5) textln "(100pct/5)="$(100pct/5) textln textln "modulus(101,5)="$modulus(101,5) textln "(101%5)="$(101%5) textln "modulus(101.,5)="$modulus(101.,5) textln "(101.%5)="$(101.%5) textln "modulus(101pct,5pct)="$modulus(101pct,5pct) textln "(101pct%5pct)="$(101pct%5pct) wait Modulus of measurements now supported. Only works on like types, for instance: textln "modulus(101pct,5pct)="$modulus(101pct,5pct) textln "(101pct%5pct)="$(101pct%5pct) Conversion of measurment to string after a multiply or divide was done to a measurement is fixed. For instance: textln "divide(100pct,5)="$divide(100pct,5) textln "(100pct/5)="$(100pct/5) Conversion of measurements with a negative pixel count now puts the pixel count at the end so that 100pct-5 is no longer displayed as -5+100pct, instead it's shown as 100pct-5. Crashing bug when using

      tags fixed. ---------------------------------------------------------------------------- Wed, 05 July 2006 !!SERIOUS RISK OF BUGS IN TEXT IN THIS BUILD!! Routines which handle text drawing (TEXTFROM TEXT LAYERTEXT), and text calculation (TEXTHEIGHT, TEXTLINESHEIGHTFROM, TESTSTRPOSITIONHEIGHT) are now merged into a single common block of code. All the duplicate code has been eliminated. This eliminates some inconsistencies between text drawing and calculation, but more importantly it drasticly simplifies adding text features, getting rid of a whole round of checking and debugging each time substantial changes were made to either set of code in the past. Start of Table support, not functional yet. TEXTHTML now recognizes these Table tags: // table // table row // groups of table columns // the attribute values for one or more columns in a table // table head // table body // table footer
      // doc division The
      // table header
      // table cell
      // table caption
      tag recognizes these attributes, the values are parsed, pushed onto a table stack, and restored after a
      tag. BORDER= WIDTH= CELLSPACING= ALIGN= BGCOLOR= ---------------------------------------------------------------------------- Thu, 29 June 2006 WINDOWSTYLE HIDDEN support removed, it was based on false assumptions made based on article that talked about creating windows with no taskbar text requiring a hidden parent. All that is false (and led me to waste a HUGE amount of time debugging what would never work!). WINDOWSTYLE with all the EX styles now work, they NEVER did in the past not in GLPRO, nor in AfterGRASP. My entire understanding of how the extended window attributes are set was completely incorrect. Fixed! This includes the TOOLWINDOW setting, which you can see functioning correctly with this small example: windowstyle popup drawclear white set texthtml on textln "A Window" delay 200 textln "Changed to TOOLWINDOW" windowshowstyle hide windowstyle TOOLWINDOW windowshowstyle show wait exitnow ---------------------------------------------------------------------------- Tue, 27 June 2006 JPEG support replaced with code from libjpeg-6c provided by Guido Vollbeding of the JPEG Club. http://jpegclub.org/libjpeg-6c.tar.gz Message posted June 20th, 2006. http://groups.google.com/group/comp.compression/msg/77d99c47ec1736da?hl=en& The last updated to LIBJPEG (version 6b) was over 8 years ago! The code which handles JPEG quality is rewritten to give far higher quality results at the higher percentages. Saving an image near 100% quality will now give results as good or better than Photoshop. Here is the test script I used to watch for JPEG quality (it XOR's a saved JPEG with an original, colored areas are mismatches): windowsize 800 600 32 drawclear white imageload original timerset timecount for i from 10 to 100 imageload original blah filedelete blah.jpg imagesavejpeg @i blah.jpg imagefree blah imageload blah imageset blah set drawxor on imageput original set drawxor off imageset imageput blah imagefree blah set texthtml on text "" color red layer hah text @i next layer hah text @timecount wait exitnow ---------------------------------------------------------------------------- Tue, 20 June 2006 HTML Text that wraps on a
    1. line now wraps under the previous text not under the bullet. So for example, in the past it did this: 0 this is some silly text as an example. It now wraps this way: 0 this is some silly text as an example. ---------------------------------------------------------------------------- Mon, 19 June 2006 Bug in AGCOMP introduced on 14 June 2006 build which broke the compiling of HEX constants is fixed. messagebox 0x08000000 ; was displaying x08000000 - WRONG! messagebox 0x08000000 ; Now displays 0x8000000 ---------------------------------------------------------------------------- Thu, 15 June 2006 For HTMLTEXT, the bullet list support is rewritten fixing several serious bugs in the display of bullet lists, and correcting the spacing. This also streamlines some of the HTML parsing which was overly complicated based on some incorrect assumptions. Here is the test script I used where the output is very close to the same HTML shown in Internet Explorer and FireFox. windowsize 800 800 drawclear white imagedensity 80 set texthtml on text "" text "
    2. one
      one
        one
      • one
      • two
      • three
      • four four four four four four four four four four four four four four four four four four four four four four four four four four four four four four
      • five
          a
        • b

        a
      b
      zello
      " wait exitnow ---------------------------------------------------------------------------- Wed, 14 June 2006 AGCOMP now treats numeric constants with leading or trailing zeros as numbers not strings if they are not in quotes. For instance: messagebox "145.00000" ; displays 145.00000 messagebox 145.00000 ; displays 145. messagebox 0000145.00000 ; displays 145. messagebox "00000145" ; displays 00000145 messagebox 00000145 ; displays 145 ---------------------------------------------------------------------------- Mon, 12 June 2006 New command STRHTMLTAGEXTRACT which will search through a string finding all the matching tags, and return the matching attributes. It returns multiple values, so you would commonly use functions like ARRAY or STRLIST on the return values. RESULTARRAY = ARRAY(STRHTMLTAGEXTRACT(HTMLSTRING,TAGNAME,ATTRIBNAME1,....)) RESULTARRAY = STRLIST(STRHTMLTAGEXTRACT(HTMLSTRING,TAGNAME,ATTRIBNAME1,....)) HTMLSTRING is the HTML text to search TAGNAME is the TAG name to search for ATTRIBUTENAME1 is the first attribute to extract (multiple attributes are supported) For example: drawclear white html get page "http://www.yahoo.com/index.htm" messagebox strlist(strhtmltagextract(@page,font,face)) exitnow Or: windowsize 800 800 drawclear white windowshowstyle shownormal set teststring "uHello" set texthtml on text "" set texthtml off set textwrap off text strlist(strhtmltagextract(@teststring, font, face, size)) wait exitnow New option for WINDOWSTYLE, HIDDEN. When the HIDDEN option is used, the background window becomes a fixed 8 pixel by 8 pixel window that is always hidden. Our main window is made a child of this window. This allows you to create a window that is visible, but is not shown on the taskbar. Unfortunately, it's not working yet, still under development. The
      • bullet tables with HTML TEXT now use different symbols for different levels of indent: Disc (first level of indent): l Circle (second level of ident): ¡ Square (3rd and all higher levels of ident): n Text inside
         tags now have the tab size forced to the standard
        8 spaces wide.
        
        ----------------------------------------------------------------------------
        Thu, 08 June 2006
        
        Replaced SOUND loading code with same base code as used for IMAGES and
        other files.
        
        
        SOUNDPLAY was sometimes not playing any more sounds until program exit.
        Fixed.
        
        
        SOUNDSTOP was unreliable, fixed.
        
        ----------------------------------------------------------------------------
        Wed, 07 June 2006
        
        WINDOWSTYLE CHILD now actually sets the style to CHILD (previously it
        would just use POPUP). But this actually crashes right now because there
        is no window to be a child of! (yet).
        
        
        New system variable @WINSTYLE, is the integer version of a window
        style set with the WINDOWSTYLE command.
        
        ----------------------------------------------------------------------------
        Tue, 06 June 2006
        
        SET TEXTFROMSKIP changed to NOT strip leading spaces or tabs. It now only
        strips extra linefeeds.
        
        
        
        Bug in STRCAT (the '$' operator) was throwing away trailing zeros on
        strings that were valid floating point numbers. For instance:
        
          textln "50."$"0000"
        
        Was displaying "50." instead of the expected "50.0000".
        
        This bug also affected the INC and DEC commands when used with HEX values
        (was not working correctly).
        
        ----------------------------------------------------------------------------
        Mon, 05 June 2006
        
        The default character set for FONTSTYLE INIT and with no character set
        ever set with FONTSTYLE is now DEFAULT (used to be ANSI).
        
        This allows symbol fonts to work without setting the character set to
        SYMBOL. For example, this test now works:
        
          drawclear white
          set texthtml on
          text "u"
          wait
          exitnow
        
        ----------------------------------------------------------------------------
        Sun, 04 June 2006
        
        The DRAWDENSITY command has been removed, same functionality is provided
        by IMAGEDENSITY with no image specified.
        
        
        IMAGEDENSITY command with no images specified sets.the current system
        density (dots per inch).  
        
         IMAGEDENSITY XYSIZE
         IMAGEDENSITY XSIZE YSIZE 
         IMAGEDENSITY XYSIZE IMAGEBUF [IMAGEBUF ...]
         IMAGEDENSITY XSIZE YSIZE IMAGEBUF [IMAGEBUF ...]
        
        
        
        Memory corruption bug in STREVAL (overwriting one byte beyond end of a
        temporary buffer) fixed.
        
        Memory read error in STRLIST which could try to read memory that was
        previously free'd (and could have changed value) is fixed.
        
        Serious memory leak in STRREPLACE fixed. Also STRREPLACE when using
        10 or fewer pairs of search/replace values on short strings has dramaticly
        less overhead (runs faster).
        
        ----------------------------------------------------------------------------
        Thu, 01 June 2006
        
        Bug in TEXTHEIGHT which ignored the last character in a string is fixed.
        
        Bug in TEXT/TEXTLN which did not correctly take the rightoffset for each
        character into account when wrapping is fixed.
        
        Two new commands LOCALDEPTH and LOCALDEPTHS, function much like
        LOCALUNDER and LOCALUNDERS. They allow you to create local variables at
        a lower depth in the call tree.
        
         LOCALDEPTH DEPTH VARNAME VALUE [VARNAME VALUE] [VARNAME VALUE] ...
         LOCALDEPTHS DEPTH VARNAME [VARNAME] [VARNAME] ... VALUE [VALUE] [VALUE] ...
        
         LOCALDEPTH 0 VARNAME VALUE
         is identical to
         LOCAL VARNAME VALUE
        
         LOCALDEPTH 1 VARNAME VALUE
         is identical to
         LOCALUNDER VARNAME VALUE
        
        ----------------------------------------------------------------------------
        Wed, 31 May 2006
        
        STREVAL now handles strings in quotes as well a escaped quotes ("\"")
        
        Here is a complex example:
        
          sfontsize = 40
          global pdate streval("strcat(\"Prepared Date: \",strright(@date,2),\"/\",strmid(@date,5,2),\"/\",strmid(@date,3,2),\"\")")
        
        
        Previously, the '$' operator (which concatinated two strings) passed the
        two strings to the STRCAT function in reverse.  In order to make STRCAT
        easier to use on it's own. The compiler (AGCOMP) is changed to reverse
        that, passing the parameters in the same order a human being would use.
        The STRCAT command is updated to concatinate multiple strings in
        the expected order, so:
        
                        messagebox strcat(a,b,c,d,e)
        
        Displays "abcde".  (previously it would have displayed "edcba").
        
        This means any GL or EXE compiled before this build of AfterGRASP will
        not run correctly if used with this or later runtimes (strings will
        be concatinated in backwards order).
        
        ----------------------------------------------------------------------------
        Wed, 17 May 2006 (Update)
        
        The updated list of what STRHTMLTOFLASH does is as follows:
        
          1. Strip CRLFs and tabs (replace with spaces)
          2. Strip excess spaces and leading spaces
          3. Replaces   with space
          4. Replace all &name; with &#asciicode;
          5. Removes all 

        6. Replaces all

        with
        7. Replaces all with 8. Replaces all with 9. Replaces all
        ... with ... 10. Encodes all characters above 127 or below 32 using &#asciicode; 11. Replaces all "
        " with " " (works around a bug in FLASH handling of bold tag that crosses a link). 12. Replaces all long hyphens '–' with short hypens '-'. ---------------------------------------------------------------------------- Wed, 17 May 2006 (Update) Bug in STRHTMLTOFLASH and STRHTMLSTRIP reversing it's handling of leading spaces on a line (was not stripping them, and was instead stripping them from in front of all other tags). Fixed. STRHTMLTOFLASH and STRHTMLSTRIP now treat   as a space. STRHTMLTOFLASH now encodes ASCII characters above 127, and below 32 using &#asciicode;. The updated list of what STRHTMLTOFLASH does is as follows: 1. Strip CRLFs and tabs (replace with spaces) 2. Strip excess spaces and leading spaces 3. Replaces   with space 4. Replace all &name; with &#asciicode; 5. Removes all

        6. Replaces all

        with
        7. Replaces all with 8. Replaces all with 9. Replaces all ... with ... 10. Encodes all characters above 127 or below 32 using &#asciicode; 11. Replaces all " " with "
        " (works around a bug in FLASH handling of bold tag that crosses a link). ---------------------------------------------------------------------------- Wed, 17 May 2006 AGEDIT updated to put quotes around the filenames with path it passes to the AG Compiler (AGCOMP.EXE). This should correct the problems some were having using directories with spaces in them. STRHTMLSTRIP and STRHTMLTOFLASH now strip out CRLF, and excess spaces (correctly). STRHTMLTOFLASH extensively rewritten so that it now does this: 1. Strip CRLFs and tabs (replace with spaces) 2. Strip excess spaces and leading spaces 3. Strips   4. Replace all &name; with &#asciicode; 5. Removes all

        6. Replaces all

        with
        7. Replaces all with 8. Replaces all with 9. Replaces all ... with ... ---------------------------------------------------------------------------- Tue, 16 May 2006 STRSEARCHHTML and STRSEARCHREVERSEHTML command removed. Instead, we have the new STRHTMLPOSITION and STRPOSITIONHTML commands. HTMLPOS = STRHTMLPOSITION(HTMLSTRING, STRIPPEDPOS) STRIPPEDPOS = STRPOSITIONHTML(HTMLSTRING, HTMLPOS) STRHTMLPOSITION converts a stripped string position into a HTML string position. STRHTMLPOSITION converts a stripped string position into a HTML string position. For instance: htmlstring = "The names John&Ed are two names" stripped = strhtmlstrip(@htmlstring) pos = strhtmlposition(@htmlstring, strsearch(@stripped, "John&Ed")) ---------------------------------------------------------------------------- Sun, 14 May 2006 Two new string commands STRSEARCHHTML and STRSEARCHREVERSEHTML, they effectively do the search on the string after a STRHTMLSTRIP is done, but returns the string position in the original HTML string. This is useful for finding text in an complex HTML string. Crashing bug in STREVAL when passed a NULL string is fixed. Crashing bug in SET VARIABLES ON when using large array indexes is fixed. New command IMAGEEXISTS, checks to see if an image is loaded into memory or available for loading: RESULT = IMAGEEXISTS(IMAGENAME) IMAGEEXISTS can be passed more than one image name, and returns true only if all the images exist. This is different from the FILEEXISTS command which returns true if any of the files exist. RESULT = IMAGEEXISTS(IMAGENAME1,IMAGENAME2,IMAGENAME3) ---------------------------------------------------------------------------- Wed, 10 May 2006 @NETCONNECTED was always returning 6 (leftover from before @NETCONNECTED was supported). When @NETCONNECTED fails, the WININET.DLL is now freed from memory until the next internet command is used. @NETCONNECTED now provides a value less than 0 for errors. Possible values: -1 for no internet DLLs -2 for IsNetworkAlive failure -3 for InternetGetConnectedState failure 0 for no connection 1 Modem connection 2 LAN connection 4 Proxy connection 5 Modem Proxy connection 6 LAN Proxy connection The HTTP commands now zero HTTPERROR if there was no error (previously any error code was left in HTTPERROR). ---------------------------------------------------------------------------- Tue, 09 May 2006 Three new string commands for dealing with URLs and Adobe FLASH strings. STRURLENCODE Translates all characters not letters or numbers (a..z A..Z and 0..9) into %HH where HH is the two digit hex code. This includes control characters like @CRLF. For example: STRURLENCODE("Hello There"$@crlf) becomes "Hello%20There%0D%0A". STRURLDECODE Translates all %HH where HH is a two digit hex code into ascii. For example: STRURLDECODE("Hello%20There") becomes "Hello There". STRHTMLTOFLASH Translates all &charname; sequences into &#asciicode; Translates all "" to "", and "" to "". Translates all "" to "", and "" to "". Translates all "

         


        " to "". Translates all "

        " to "" and "

        " to "
        ". Working example of all three: drawclear white color black fontdefine arial textln "strurlencode(\"Hello There\"$@crlf)" textln strurlencode("Hello There"$@crlf) textln textln "strurldecode(\"Hello%20There\")" textln strurldecode("Hello%20There") textln textln "strhtmltoflash(\"&Test \")" textln strhtmltoflash("&Test ") textln textln "strurlencode(strhtmltoflash(\"&Test £ \"))" textln strurlencode(strhtmltoflash("&Test £ ")) textln wait exitnow STRHTMLSTRIP is now supported (was an empty stub). Untested. All mouse/keyboard events are now ignored while a systray menu is active. This avoids some odd errors when clicking inside a menu that overlaps the main app window. ---------------------------------------------------------------------------- Fri, 05 May 2006 Bug in STRREPLACE which would give incorrect results (sometimes not finding a string) if the string it was searching for started with a character who's ascii value was greater than 127. Fixed. ---------------------------------------------------------------------------- Fri, 28 Apr 2006 Results of math with measurements is now cleaned up so that zero values are removed. Like 2pct-2pct now gives 0 instead of 0pct, and 2in+0 now gives 2in instead of "0+2in". ---------------------------------------------------------------------------- Thu, 27 Apr 2006 STRSORT with the numeric option "#" now skips any leading non-numeric characters on strings being compared. For example: drawclear white drawslist = strlist("draw10", "draw1", "draw11", "draw10.5", "draw0.2", "draw2", "draw1.2") strsort drawslist messagebox @drawslist "Sorted normally" strsort "#" drawslist messagebox @drawslist "Sorted numericly" exitnow ---------------------------------------------------------------------------- Wed, 26 Apr 2006 New command SYSTRAYCLICK which controls what clicking with the left mouse button, right mouse button, and double clicking on the system tray icon (set with SYSTRAYICON command) does. SYSTRAYCLICK LEFTLABEL SYSTRAYCLICK LEFTLABEL RIGHTLABEL SYSTRAYCLICK LEFTLABEL RIGHTLABEL DOUBLELABEL If a blank label is used, then nothing is done for that type of click. If the label "menu" is used, then the menu created by the SYSTRAYMENU is used. Otherwise it's label that is gosub'd when that type of mouse click occurs on the system tray icon. TEXTSTRPOSITIONFROM was not reseting the X position at the start of text to be written. TEXTSTRPOSITIONFIT was off by 1 byte (was returning a base 0 result), and was not handling word wrap correctly on the last line. The INC and DEC commands now support measurements and percentages, both in the variable being incremented or decremented, and in the value added to the variable. DRAWBOX and DRAWRECT when drawing to a printer no longer have rounded corners, the corners are now squared (Window's default pen has always been rounded, had to change some calls to use ExtCreatePen to create a non-rounded pen). Corners on both are now correctly squared even at high resolutions. ---------------------------------------------------------------------------- Mon, 24 Apr 2006 The return values from IMAGEPUT (which are the XPOS and YPOS where the image was actually placed) are now corrected for DRAWOFFSET. Two new commands ARRAYPAIR and ARRAYPAIRS. ARRAYRESULT = ARRAYPAIR(ITEM1, ATTRIB1, ITEM2, ATTRIB2, ITEM3, ATTRIB3, ..., ...) ARRAYRESULT = ARRAYPAIRS(ITEM1, ITEM2, ITEM3, ..., ATTRIB1, ATTRIB2, ATTRIB3, ...) They function like ARRAY, creating a sequential array starting with index 0 onward. But they take both values and attributes, so for instance: MENUARRAY[0] = "About" MENUARRAY{0} = labelshowabout MENUARRAY[1] = "Speed" MENUARRAY{1} = &SPEEDMENUARRAY MENUARRAY[2] = "Exit" MENUARRAY{2} = labelexitnow Can now be written as: MENUARRAY = ARRAYPAIR("About", labelshowabout, "Speed", &SPEEDMENUARRAY, "Exit", labelexitnow) Or using ARRAYPAIRS like this: MENUARRAY = ARRAYPAIRS("About", "Speed", "Exit", labelshowabout, &SPEEDMENUARRAY, labelexitnow) SYSTRAYMENU now working, and has support for grayed and checked entries. Grayed and checked use a prefix (which is not displayed) on the menu text. "GRAY:" for grayed out, and "CHECK:" for checked. You can use both at the same time if you like: SPEEDMENUARRAY[0] = "1 Second" SPEEDMENUARRAY{0} = label1sec SPEEDMENUARRAY[1] = "CHECK:2 Seconds" SPEEDMENUARRAY{1} = label2sec SPEEDMENUARRAY[2] = "5 Seconds" SPEEDMENUARRAY{2} = label5sec SPEEDMENUARRAY[3] = "10 Seconds" SPEEDMENUARRAY{3} = label10sec SPEEDMENUARRAY[4] = "30 Seconds" SPEEDMENUARRAY{4} = label30sec SPEEDMENUARRAY[5] = "1 Minute" SPEEDMENUARRAY{5} = label1min SPEEDMENUARRAY[6] = "2 Minutes" SPEEDMENUARRAY{6} = label2min SPEEDMENUARRAY[7] = "5 Minutes" SPEEDMENUARRAY{7} = label5min SPEEDMENUARRAY[8] = "10 Minutes" SPEEDMENUARRAY{8} = label10min MENUARRAY = ARRAYPAIR("About", labelshowabout, "Speed", &SPEEDMENUARRAY, "Exit", labelexitnow) ---------------------------------------------------------------------------- Wed, 19 Apr 2006 Three new commands to support System Tay icons, SYSTRAYICON, SYSTRAYTIP and SYSTRAYMENU. SYSTRAYMENU is not written yet (doesn't do anything). SYSTRAYICON and SYSTRAYTIP both are tested and working. SYSTRAYICON ICONFILENAME XHOTSPOT YHOTSPOT SYSTRAYICON ICONFILENAME XHOTSPOT YHOTSPOT SYSTRAYTIP TOOLTIPSTRING SYSTRAYMENU MENUARRAY Example: SPEEDMENUARRAY[0] = "1 Second" SPEEDMENUARRAY{0} = label1sec SPEEDMENUARRAY[1] = "2 Seconds" SPEEDMENUARRAY{1} = label2sec SPEEDMENUARRAY[2] = "5 Seconds" SPEEDMENUARRAY{2} = label5sec SPEEDMENUARRAY[3] = "10 Seconds" SPEEDMENUARRAY{3} = label10sec SPEEDMENUARRAY[4] = "30 Seconds" SPEEDMENUARRAY{4} = label30sec SPEEDMENUARRAY[5] = "1 Minute" SPEEDMENUARRAY{5} = label1min SPEEDMENUARRAY[6] = "2 Minutes" SPEEDMENUARRAY{6} = label2min SPEEDMENUARRAY[7] = "5 Minutes" SPEEDMENUARRAY{7} = label5min SPEEDMENUARRAY[8] = "10 Minutes" SPEEDMENUARRAY{8} = label10min MENUARRAY[0] = "About" MENUARRAY{0} = labelshowabout MENUARRAY[1] = "Speed" MENUARRAY{1} = &SPEEDMENUARRAY MENUARRAY[2] = "Exit" MENUARRAY{2} = labelexitnow SYSTRAYTIP "AfterGRASP Example" SYSTRAYMENU &MENUARRAY WINDOWFORCETOP has a new option, NOTOPMOST, same as ON except it does not make the window the absolute topmost window. WINDOWFORCETOP ; same as ON WINDOWFORCETOP ON WINDOWFORCETOP OFF WINDOWFORCETOP NOTOPMOST WINFINDBYCLASS and WINFINTBYTITLE now support 2 more optional parameters: RESULTHWND = WINFINDBYCLASS(CLASS) RESULTHWND = WINFINDBYCLASS(CLASS) RESULTHWND = WINFINDBYCLASS(CLASS,HWNDPARENT) RESULTHWND = WINFINDBYCLASS(CLASS,HWNDPARENT,HWNDCHILDAFTER) RESULTHWND = WINFINDBYCLASS(CLASS,HWNDPARENT,HWNDCHILDAFTER,TITLE) RESULTHWND = WINFINDBYTITLE(TITLE) RESULTHWND = WINFINDBYTITLE(TITLE,HWNDPARENT) RESULTHWND = WINFINDBYTITLE(TITLE,HWNDPARENT,HWNDCHILDAFTER) RESULTHWND = WINFINDBYTITLE(TITLE,HWNDPARENT,HWNDCHILDAFTER,CLASS) HWNDPARENT Handle to the parent window whose child windows are to be searched. If hwndParent is NULL, the function uses the desktop window as the parent window. The function searches among windows that are child windows of the desktop. HWNDCHILDAFTER Handle to a child window. The search begins with the next child window in the Z order. The child window must be a direct child window of hwndParent, not just a descendant window. If hwndChildAfter is NULL, the search begins with the first child window of hwndParent. Example which reads the Windows Task Bar height: drawclear white dllsetup user32.dll dword "GetWindowRect" GetWindowRect hwnd farptr memnew rect 16 GetWindowRect WinFindByClass("Button", WinFindByClass("Shell_TrayWnd")) @rect taskbarheight = @desktopsizey-#rect[4] messagebox "TaskBarHeight = "$@taskbarheight wait ---------------------------------------------------------------------------- Thu, 13 Apr 2006 New command WINDOWPOSITIONSTYLE, controls what style attributed are passed to Windows each time the WINDOWPOSITION command is used. The default value is: WINDOWPOSITIONSTYLE SHOWWINDOW NOZORDER NOCOPYBITS FRAMECHANGED HWNDTOP INVALIDATERECT Possible options are: ASYNCWINDOWPOS DEFERERASE DRAWFRAME FRAMECHANGED HIDEWINDOW NOACTIVATE NOCOPYBITS NOMOVE NOOWNERZORDER NOREDRAW NOREPOSITION NOSENDCHANGING NOSIZE NOZORDER SHOWWINDOW HWNDTOP HWNDBOTTOM HWNDTOPMOST HWNDNOTOPMOST INVALIDATERECT Some notes on these flags: ASYNCWINDOWPOS If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request. DEFERERASE Prevents generation of the WM_SYNCPAINT message. DRAWFRAME Draws a frame (defined in the window's class description) around the window. FRAMECHANGED Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed. HIDEWINDOW Hides the window. NOACTIVATE Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter). NOCOPYBITS Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned. NOMOVE Retains the current position (ignores X and Y parameters). NOOWNERZORDER Does not change the owner window's position in the Z order. NOREDRAW Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing. NOREPOSITION Same as the NOOWNERZORDER flag. NOSENDCHANGING Prevents the window from receiving the WM_WINDOWPOSCHANGING message. NOSIZE Retains the current size (ignores the cx and cy parameters). NOZORDER Retains the current Z order (ignores the hWndInsertAfter parameter). SHOWWINDOW Displays the window. HWNDBOTTOM Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows. HWNDNOTOPMOST Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window. HWNDTOP Places the window at the top of the Z order. HWNDTOPMOST Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated. INVALIDATERECT Forces a InvalidateRect API call before the SetWindowPosition to force the screen to be updated. ---------------------------------------------------------------------------- Wed, 12 Apr 2006 FONTLOAD of AGF fonts was broken in the 06 Apr 2006 build. Fixed. ---------------------------------------------------------------------------- Mon, 10 Apr 2006 Long standing bug in HTML processing where tag was not entirely reseting the HTML parser is fixed. This could cause odd errors when using TEXTFROM to display sections of text where a tag pair crossed the boundry of the end of a section. Fixed. ---------------------------------------------------------------------------- Thu, 06 Apr 2006 TEXTFIT and TEXTFROM commands removed (replaced with TEXTLINESFIT and TEXTLINESFROM) New set of commands (and documentation for TEXTLINES): TEXTLINES TEXTLINESFIT TEXTLINESFROM TEXTLINESHEIGHT TEXTSTRPOSITIONFIT TEXTSTRPOSITIONFROM TEXTSTRPOSITIONHEIGHT TEXTSTRPOSITIONLINES LINES = TEXTLINES(TEXTSTRING) LINES = TEXTLINES(TEXTSTRING, STARTLINE) LINES = TEXTLINES(TEXTSTRING, STARTLINE, WIDTH) LINES = TEXTLINES(TEXTSTRING, STARTLINE, WIDTH, HEIGHT) LINES = TEXTLINESFIT(TEXTSTRING) LINES = TEXTLINESFIT(TEXTSTRING, STARTLINE) LINES = TEXTLINESFIT(TEXTSTRING, STARTLINE, WIDTH) LINES = TEXTLINESFIT(TEXTSTRING, STARTLINE, WIDTH, HEIGHT) TEXTLINESFROM TEXTSTRING STARTLINE TEXTLINESFROM TEXTSTRING STARTLINE LINECOUNT YPIXELS = TEXTLINESHEIGHT(TEXTSTRING, WIDTH, STARTLINE) YPIXELS = TEXTLINESHEIGHT(TEXTSTRING, WIDTH, STARTLINE, LINECOUNT) CHARPOS = TEXTSTRPOSITIONFIT(TEXTSTRING, WIDTH, HEIGHT, STARTSTRPOSITION) CHARPOS = TEXTSTRPOSITIONFIT(TEXTSTRING, WIDTH, HEIGHT, STARTSTRPOSITION, ENDSTRPOSITION) TEXTSTRPOSITIONFROM TEXTSTRING STARTSTRPOSITION TEXTSTRPOSITIONFROM TEXTSTRING STARTSTRPOSITION ENDSTRPOSITION YPIXELS = TEXTSTRPOSITIONHEIGHT(TEXTSTRING, WIDTH, STRPOSITION) YPIXELS = TEXTSTRPOSITIONHEIGHT(TEXTSTRING, WIDTH, STRPOSITION, ENDSTRPOSITION) LINES = TEXTSTRPOSITIONLINES(STR, WIDTH, HEIGHT, STRPOSITION) LINES = TEXTSTRPOSITIONLINES(STR, WIDTH, HEIGHT, STRPOSITION, ENDSTRPOSITION) HTML ASCII code support "&#NUMBER;" fixed, was broken for the last few builds. Limited Unicode support for HTML text has been added. ASCII codes above 255 are permitted for "&#NUMBER;". This is not supported for anti-aliased text, or for fontdefine. It only works on WINFONT fonts. You still cannot create a AGF font with more than 256 characters. This support works in all text operations that support HTML text including textwidth, textheight, textfrom and so on. ---------------------------------------------------------------------------- Fri, 24 Mar 2006 Extensive error checking added to all string functions to check for possible null strings (could have caused CRASH errors). Numerous small tweaks made to TEXTHEIGHT to make it match the exact height of TEXT commands. TEXTFROMSTRIP now applies to TEXTHEIGHT and TEXTLINES. ---------------------------------------------------------------------------- Thu, 23 Mar 2006 Bug in Modular compiler was never including the XML library if XML was used. Modular compiler now excludes TIFF library if no load or save TIFF is used, PNG library is no load or save PNG are used, JPEG library is no load or save JPEG is used, and XML library is no XML commands are used. This doesn't actually reduce runtime size, but does slightly speed up link time, and helps me to catch bugs. Two calls in Direct NET code were referencing WSOCK32.DLL directly which would have forced TCP/IP networking to be installed in order to run AfterGRASP. Fixed. ---------------------------------------------------------------------------- Wed, 22 Mar 2006 Fixed a crashing bug (divide by zero) in scrollboxes. Had to do with elevator position on a scroll box where the area below the text (to be scrolled) was 0 pixels high. More error checking added for opening NET: filenames, and NETOPEN. NETREADCOUNT support written. New command NETLOOKUP, takes a domain name and returns the IP address as a string, four integers seperated by periods. If it fails it returns a NULL string (blank). ---------------------------------------------------------------------------- Tue, 21 Mar 2006 FILECLOSE FILEREAD* FILEWRITE* and FILESEEK commands now accept a variable name for a handle, for example: fs = fileopen("test.txt") result = fileread(fs) fileclose fs WHEN NETSERVE, NETREADREADY and NETCLOSED partially done, not working yet. FILEREADLINE now supported (previous did nothing at all). RESULT = FILEREADLINE(HANDLE) FILEREAD now supports reading all remaining bytes and returning the result as a string, and reading N number of bytes, also returning the result as a string: FILEREAD HANDLE BUFFERADDRESS BYTECOUNT RESULT = FILEREAD(HANDLE) RESULT = FILEREAD(HANDLE, BYTECOUNT) NET:FILENAME is in and working, here is a runable example that uses fileappend with a net:filename and fileread with just the handle to read whatever data is available: drawclear white color green textln "making connection" set file fileappend("net:www.aftergrasp.com:80") ; set file netopen("www.aftergrasp.com", 80) ; same thing textln "sending GET string" color black filewriteline file "GET /test.htm HTTP/1.0" filewriteline file "Host: www.aftergrasp.com" filewriteline file "" set textwrap off timerset start contentlength = 0 while @start<10000 s = filereadline(file) textln @s if strlen(@s)==0 break cl = "Content-Length: " if strleft(@s, strlen(@cl))==@cl contentlength = strleftright(@s, strlen(@cl)) endif endloop textln "" color blue text fileread(file, @contentlength) color red text "done" fileclose file wait exitnow FileOpen/FileAppend no longer check for GZIP compression when opening FTP: HTTP: or NET: files (didn't make sense). ---------------------------------------------------------------------------- Fri, 17 Mar 2006 New function HTTPQUERYS, returns an array of all HTTPQUERY results. RESULTARRAY = HTTPQUERY() RESULTARRAY = HTTPQUERY(URL) Runable example: drawclear white color black url = "http://www.aftergrasp.com/test.htm" fullstring = "URL = "$@url$@crlf$@crlf http getvar @url test query = httpquerys() filedelete httpresults.txt fileputvariables httpresults.txt query filesendln httpresults.txt @@test appshell open httpresults.txt wait 100 exitnow Results look like this: query[ACCEPT_RANGES] = bytes query[CONTENT_LENGTH] = 217 query[CONTENT_TYPE] = text/html query[DATE] = "Tue, 14 Mar 2006 18:49:57 GMT" query[ETAG] = """514c113-d9-440f023b""" query[LAST_MODIFIED] = "Wed, 08 Mar 2006 16:11:39 GMT" query[RAW_HEADERS] = "HTTP/1.1 200 OK" query[RAW_HEADERS_CRLF] = "HTTP/1.1 200 OK Date: Tue, 14 Mar 2006 18:49:57 GMT Server: Apache Last-Modified: Wed, 08 Mar 2006 16:11:39 GMT ETag: ""514c113-d9-440f023b"" Accept-Ranges: bytes Content-Length: 217 Content-Type: text/html " query[REQUEST_METHOD] = GET query[SERVER] = Apache query[STATUS_CODE] = 200 query[STATUS_TEXT] = OK query[VERSION] = HTTP/1.1 Close to finalized syntax for new NET commands for direct TCP/IP networking, not working yet (partially written): Three new WHEN types, NETSERVE, NETREADREADY and NETCLOSED. The The first parameter passed to the trigger subroutine for all three of these new WHEN types is the handle for TCP/IP connection. NETSERVE is triggered for each incoming connection on the given TCP/IP port. WHEN NETSERVE PORT DECLARE HANDLE ... ENDWHEN NETREADREADY is triggered when N number of bytes are ready to be read from the given TCP/IP connection associated with HANDLE. If the COUNT option is given, it's the number of bytes to wait for until triggering the WHEN. If not given, a count of 1 is assumed. WHEN NETREADREADY HANDLE DECLARE HANDLE ... ENDWHEN WHEN NETREADREADY HANDLE COUNT DECLARE HANDLE ... ENDWHEN NETCLOSED is triggered when a TCP/IP connection is closed. WHEN NETCLOSED HANDLE ; First parameter passed to subroutine is HANDLE DECLARE HANDLE ... ENDWHEN Keep in mind that since an array index can be any type of value, you can use a TCP/IP connection handle as an array index to store connection specific information. For example: when servesub netserve 80 declare handle when closewhens[@handle] netclosed @handle free closewhens[@handle] readwhens[@handle] filenames[@handle] endwhen global filenames[@handle] netreadline(@handle) when readwhens[@handle] netreadready @handle declare handle filesend @filenames[@handle] netread(@handle) endwhen endwhen All file oriented commands support direct network I/O, just prepend the prefix "NET:" and the ":PORTNUM" after the address. HANDLE = FILECREATE("NET:ADDRESS:PORTNUM") HANDLE = FILEOPEN("NET:ADDRESS:PORTNUM") HANDLE = FILEAPPEND("NET:ADDRESS:PORTNUM") FILECLOSE HANDLE HANDLE = NETOPEN(ADDRESS,PORTNUM) ; Opens outgoing connection for read/write BYTECOUNT = NETREADCOUNT(HANDLE) ADDRESS = NETADDRESS(HANDLE) HANDLE->ACTIVE NETREAD HANDLE BUFFERADDRESS COUNT BYTECOUNT = NETWRITECOUNT(HANDLE) WAITNET HANDLE WAITNET HANDLE TIMEOUT WAITNETCLOSE HANDLE WAITNETCLOSE HANDLE TIMEOUT ---------------------------------------------------------------------------- Fri, 10 Mar 2006 STREVAL now supports these unirary operators: ! logical not # memgetlong $ str % memgetword * memgetbyte - negate + positive & variable reference ~ bitwise not For example: drawclear white color black textln streval("-!!@true") ; displays -1 wait exitnow STRLINE (and some other string functions) would accidently convert the string "." into "0.", they thought "." was a valid number. Fixed. Comparison of floating point numbers now returns an integer value. For instance 10.5!=10.0 used to return "1.0", but now returns "1" All system variables that expect integer values will now accept "ON" (same as "1") and "OFF" (same as "0") when passed those values as a string, or via STREVAL. This is a complete list of all system variables that are based on integer values. MANY are obscure unused 0 value stubs to prevent errors when porting GLPRO scripts. Many of those unused obscure variables are incorrectly treated as integers (they really should be strings or other special types). @ANIMABORT @APPUSESHELL32 @DATACOUNT @DBSKIPDELETED @DBUSEASCII @DEBUGEXIT @DEBUGMP3 @DEBUGNET @DEBUGPROFILE @DEBUGSYSTEMLIST @DEBUGTRACK @DEBUGWAV @DESKTOPBITS @DESKTOPBITSREAL @DESKTOPSIZEX @DESKTOPSIZEXREAL @DESKTOPSIZEY @DESKTOPSIZEYREAL @EMAILBYTES @EMAILCOUNT @EMAILDNSERROR @EMAILDNSSERVER @EMAILDNSTIMEOUT @EMAILERROR @EMAILFROM @EMAILMAILER @EMAILPRIORITY @EMAILPROXY @EMAILREPLY @EMAILTO @ERRORCRITICAL @ERRORLINE @ERRORLOAD @ERRORMESSAGE @ERRORNUMBER @ERRORSCRIPT @ERRORSTACK @ERRORTYPE @FALSE @FILEGZIP @FILEINDEXOPEN @FILEINDEXSAVE @FILELONGNAME @FILESHARE @FLOATDEGREES @FLOATDIGITS @FLOATEUROPEAN @FLOATROUND @FONTNAME @FONTSCANWIDTH @FTPBYTES @FTPCOUNT @FTPERROR @FTPPROXY @GLHANDLE @GLMERGEREVERSE @GLNAMEPREV @GLPROFOCUS @GLPROMULTIPLE @GLPROPLATFORM @GLPROUSER @GLPROWIN32 @HTTPBYTES @HTTPCOUNT @HTTPERROR @HTTPPATH @HTTPPROXY @HTTPTEMPDIR @IMAGECOMPRESSED @IMAGEDITHER @IMAGEEDGECOLOR @IMAGEEDGEENABLED @IMAGEEMFPERCENT @IMAGEEMFTEXTWIDTHS @IMAGEFADEBARSIZE @IMAGEFASTSCALE @IMAGEFLOATLAST @IMAGELOADCMYK @IMAGEPRELOAD @IMAGETRANENABLED @INIINTERNAL @INPUTABORT @INPUTBEGIN @INPUTCHANGE @INPUTFULLEXIT @INPUTINSERT @INPUTPASSWORD @INPUTPOSITION @INPUTRESTORE @INPUTSTRING @INPUTTIMEOUT @INPUTWRAP @KEYABORTDELAY @KEYCLEAR @KEYDOWNALT @KEYDOWNCTRL @KEYDOWNSHIFT @KEYHOTDELAY @KEYPRESSED @KEYUPALT @KEYUPCTRL @KEYUPSHIFT @LAYERHOTSPOT @LAYERSEPARATE @LAYERSKIPFRAMES @LOOP @MEMAVAILABLE @MEMNEAR @MEMUSED @MOUSE @MOUSEALWAYS @MOUSEDOWN @MOUSEDOWN1 @MOUSEDOWN2 @MOUSEDOWN3 @MOUSEDOWNX1 @MOUSEDOWNX2 @MOUSEKEY @MOUSEMOVED @MOUSEPRESSED @MOUSEUP @MOUSEUP1 @MOUSEUP2 @MOUSEUP3 @MOUSEUPX1 @MOUSEUPX2 @NETPROXYTYPE @NETTIMEOUT @NULL @PALETTEACCURATE @PALETTEEND @PALETTEENDEXCLUDE @PALETTEREMAP @PALETTESTART @PALETTESTARTEXCLUDE @PRINTCMYK @PRINTCOLORRES @PRINTMETRIC @PRINTPIXELSX @PRINTPIXELSY @PRINTRESX @PRINTRESY @PRINTSIZEX @PRINTSIZEY @SCRIPTBUFFER @SCRIPTSIZE @SOUNDBLOCKSIZE @SOUNDCACHEBITS @SOUNDCACHECHANNELS @SOUNDCACHEHEAD @SOUNDCACHERATE @SOUNDCACHESIZE @SOUNDCACHETAIL @SOUNDCLOCK @SOUNDDEVICE @SOUNDELAPSED @SOUNDLEVEL @SOUNDLEVELLEFT @SOUNDLEVELRIGHT @SOUNDMIXLEADTIME @SOUNDPLAYING @SOUNDVOLUME @SOUNDVOLUMELEFT @SOUNDVOLUMERIGHT @STACK @SYSCPUMMX @SYSCPUTYPE @SYSCTRLALTDEL @SYSDISKMAX @SYSDPMS @SYSESC @SYSLOCKINPUT @SYSMESSAGEDELAY @SYSMESSAGESKIP @SYSOS2 @SYSRUNBACK @SYSSLEEP @SYSSPACE @SYSSWAPPATH @SYSYIELD @TRUE @VIDEOBENCHMARK @VIDEOSCALE @VIDEOSCALEX @VIDEOSCALEY @WHENBACKGROUND @WHENENABLED @WHENFIRSTONLY @WHENINSUB @WHENLASTFIRST @WHENOFFSCREEN @WIN2000 @WIN31 @WIN32 @WIN32FILEACCESS @WIN95 @WIN98 @WINBUILD @WINDOWBACKPOSX @WINDOWBACKPOSY @WINDOWBACKSIZEX @WINDOWBACKSIZEY @WINDOWBITDEPTH @WINDOWPOSX @WINDOWPOSY @WINDOWREFRESHRATE @WINDOWSCALED @WINDOWSCALEDX @WINDOWSCALEDY @WINDOWSIZEX @WINDOWSIZEY @WINFRAMEADR @WINFRAMEDIB @WINFRAMEDIBHDC @WINFRAMEHDC @WINFRAMEHDIB @WINFRAMELEN @WINHANDLE @WININSTANCE @WININSTANCEPREV @WINNT @WINSHOWSTYLE @WINSYSTEMDIRECTORY @WINVERSION @WINYTOPORIGIN ---------------------------------------------------------------------------- Wed, 08 Mar 2006 TEXTKERN done before a
      • tag is now supported. SET TEXTKERNSIZE when DRAWOFFSET is in use is fixed. Dividing one measure by another of the same type is fixed, so 12in/4in is 3 (it was returning 3in). Results of measure calculations that have no distance or percentage component are now returned as a plain floating point number. ---------------------------------------------------------------------------- Tue, 07 Mar 2006 Typo in yesterday's build kept COLORMIX COLORSATURATIONSET COLORHUESET and COLORBRIGHTNESSSET from being recognized as valid commands. Fixed. Inaccurate results in COLORSATURATIONSET COLORHUESET and COLORBRIGHTNESSSET fixed. Conversion of metric measurements to text is fixed. ---------------------------------------------------------------------------- Mon, 06 Mar 2006 The Height in IMAGESIZE when using a percentage was incorrect since the 22 Feb 2006 build. Fixed. Six new color functions/commands: COLORRESULT = COLORMIX(PCT1,COLOR1,PCT2,COLOR2 ...) COLORRESULT = COLORSATURATIONSET(PCTADDSUB, COLOR) COLORRESULT = COLORBRIGHTNESSSET(PCTADDSUB, COLOR) COLORRESULT = COLORHUESET(DEGREESADDSUB, COLOR) NEARCOLOR = COLORNEAREST(COLOR, MATCHCOLOR1, MATCHCOLOR2 ...) FARCOLOR = COLORFURTHEST(COLOR, MATCHCOLOR1, MATCHCOLOR2 ...) COLORMIX mixes 2 or more colors (no limit on how many). For instance, these lines all create a color that is 25% white, 50% black, and 25% blue: color colormix(25,white,50,black,25,blue) color colormix(1,white,2,black,1,blue) color colormix(10,blue,10,0xffffff,20,0) COLORSATURATIONSET adjusts the saturation in a color by adding or subtracting percentage count (-100 to +100). COLORBRIGHTNESSSET adjusts the brightness of a color by adding or subtracting percentage count (-100 to +100). COLORHUESET adjusts a color's hue by adding or subtracting an angle in degrees (-360 to +360). COLORNEAREST returns which match color is closest to the color passed. For instance: color colornearest("127,64,0", black, white) ; would return 0 (black) COLORFURTHEST returns which match color is furthest to the color passed. For instance: color colorfurthest("127,64,0", black, white, red) ; would return 0xffffff (white) STREVAL now handles function calls, for example: textln streval("max(1,2,3,4,abs(-5))") ; displays 5 New function/command used to get information on an HTTP connection: RESULT = HTTPQUERY(QUERYTYPE) RESULT = HTTPQUERY(QUERYTYPE, INDEX) RESULT = HTTPQUERY(QUERYTYPE, INDEX, URL) Query Types: ACCEPT Retrieves the acceptable media types for the response. ACCEPT_CHARSET Retrieves the acceptable character sets for the response. ACCEPT_ENCODING Retrieves the acceptable content-coding values for the response. ACCEPT_LANGUAGE Retrieves the acceptable natural languages for the response. ACCEPT_RANGES Retrieves the types of range requests that are accepted for a resource. AGE Retrieves the Age response-header field, which contains the sender's estimate of the amount of time since the response was generated at the origin server. ALLOW Receives the methods supported by the server. AUTHORIZATION Retrieves the authorization credentials used for a request. CACHE_CONTROL Retrieves the cache control directives. CONNECTION Retrieves any options that are specified for a particular connection and must not be communicated by proxies over further connections. COOKIE Retrieves any cookies associated with the request. CONTENT_BASE Retrieves the base URI for resolving relative URLs within the entity. CONTENT_ENCODING Receives any additional content codings that have been applied to the entire resource. CONTENT_ID Receives the content identification. CONTENT_LANGUAGE Receives the language that the content is in. CONTENT_LENGTH Receives the size of the resource, in bytes. CONTENT_LOCATION Retrieves the resource location for the entity enclosed in the message. CONTENT_MD5 Retrieves a MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) for the entity-body. CONTENT_RANGE Retrieves the location in the full entity-body where the partial entity-body should be inserted and the total size of the full entity-body. CONTENT_TRANSFER_ENCODING Receives the additional content coding that has been applied to the resource. CONTENT_TYPE Receives the content type of the resource (such as text/html). DATE Receives the date and time at which the message was originated. ETAG Retrieves the entity tag for the associated entity. EXPIRES Receives the date and time after which the resource should be considered outdated. FROM Retrieves the e-mail address for the human user who controls the requesting user agent if the From header is given. HOST Retrieves the Internet host and port number of the resource being requested. IF_MATCH Retrieves the contents of the If-Match request-header field. IF_MODIFIED_SINCE Retrieves the contents of the If-Modified-Since header. IF_NONE_MATCH Retrieves the contents of the If-None-Match request-header field. IF_RANGE Retrieves the contents of the If-Range request-header field. This header allows the client application to check if the entity related to a partial copy of the entity in the client application's cache has not been updated. If the entity has not been updated, send the parts that the client application is missing. If the entity has been updated, send the entire updated entity. IF_UNMODIFIED_SINCE Retrieves the contents of the If-Unmodified-Since request- header field. LAST_MODIFIED Receives the date and time at which the server believes the resource was last modified. LOCATION Retrieves the absolute URI used in a Location response-header. MAX Retrieves the maximum value of an HTTP_QUERY_* value. MAX_FORWARDS Retrieves the number of proxies or gateways that can forward the request to the next inbound server. MIME_VERSION Receives the version of the MIME protocol that was used to construct the message. PRAGMA Receives the implementation-specific directives that may apply to any recipient along the request/response chain. PROXY_AUTHENTICATE Retrieves the authentication scheme and realm returned by the proxy. PROXY_AUTHORIZATION Retrieves the header that is used to identify the user to a proxy that requires authentication. PUBLIC Receives methods available at this server. RANGE Retrieves the byte range of an entity. RAW_HEADERS Receives all the headers returned by the server. Each header is terminated by "\0". An additional "\0" terminates the list of headers. RAW_HEADERS_CRLF Receives all the headers returned by the server. Each header is separated by a carriage return/line feed (CR/LF) sequence. REFERER Receives the URI of the resource where the requested URI was obtained. REQUEST_METHOD Receives the verb that is being used in the request, typically GET or POST. RETRY_AFTER Retrieves the amount of time the service is expected to be unavailable. SERVER Retrieves information about the software used by the origin server to handle the request. SET_COOKIE Receives the value of the cookie set for the request. STATUS_CODE Receives the status code returned by the server. STATUS_TEXT Receives any additional text returned by the server on the response line. TRANSFER_ENCODING Retrieves the type of transformation that has been applied to the message body so it can be safely transferred between the sender and recipient. UPGRADE Retrieves the additional communication protocols that are supported by the server. URI Receives some or all of the Uniform Resource Identifiers (URIs) by which the Request-URI resource can be identified. USER_AGENT Retrieves information about the user agent that made the request. VARY Retrieves the header that indicates that the entity was selected from a number of available representations of the response using server-driven negotiation. VERSION Receives the last response code returned by the server. VIA Retrieves the intermediate protocols and recipients between the user agent and the server on requests, and between the origin server and the client on responses. WARNING Retrieves additional information about the status of a response that may not be reflected by the response status code. WWW_AUTHENTICATE Retrieves the authentication scheme and realm returned by the server. Here is a working example of HTTPQUERY: drawclear white color black list = array( ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, AGE, ALLOW, AUTHORIZATION, CACHE_CONTROL, CONNECTION, COOKIE, CONTENT_BASE, CONTENT_ENCODING, CONTENT_ID, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_RANGE, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, DATE, ETAG, EXPIRES, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LOCATION, MAX, MAX_FORWARDS, MIME_VERSION, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PUBLIC, RANGE, REFERER, REQUEST_METHOD, RETRY_AFTER, SERVER, SET_COOKIE, STATUS_CODE, STATUS_TEXT, TRANSFER_ENCODING, UPGRADE, URI, USER_AGENT, VARY, VERSION, VIA, WARNING, WWW_AUTHENTICATE) url = "http://www.aftergrasp.com" fullstring = "URL = "$@url$@crlf$@crlf http getvar @url test for item in strlist(@list) result = httpquery(@item) if strlen(@result) textln @item$" = "$@result fullstring = @fullstring$@item$" = "$@result$@crlf endif next filedelete httpresults.txt filesendln httpresults.txt @fullstring appshell open httpresults.txt wait 100 exitnow ***NOT WRITTEN YET*** New NET commands for direct TCP/IP networking: WHEN NETSERVE port @NETHANDLES @NETHANDLE HANDLE = NETOPEN(address,port) NETCLOSE HANDLE NETREAD HANDLE BUFFERADDRESS COUNT RESULT = NETREADBYTE(HANDLE) RESULT = NETREADWORD(HANDLE) RESULT = NETREADLONG(HANDLE) RESULT = NETREADFLOAT(HANDLE) RESULT = NETREADLINE(HANDLE) NETWRITE HANDLE BUFFERADDRESSS COUNT NETWRITEBYTE HANDLE BYTEVAL NETWRITEFLOAT HANDLE FLOATVAL NETWRITELINE HANDLE STRING NETWRITELONG HANDLE LONGVAL NETWRITEWORD HANDLE WORDVAL NETWAIT TIMEOUT NETWAITCLOSE TIMEOUT RESULT = NETACTIVE(HANDLE) ---------------------------------------------------------------------------- Fri, 03 Mar 2006 Constant used to calculate metric distances was slightly off (about 0.01%), corrected to be 5000/127 inches per meter. The variable not found error now displays the variable name. The COLORGET command when passed no coordinates now returns the color read from pixel location (0,0) instead of just returning color 0. New command, IMAGECOLORGET, first parameter is an image buffer, the parameters which follow are identical to the COLORGET command: COLORRESULT = IMAGECOLORGET(IMAGEBUF) COLORRESULT = IMAGECOLORGET(IMAGEBUF,XPOS,YPOS) IMAGECOLORGET IMAGEBUF VARNAME IMAGECOLORGET IMAGEBUF XPOS YPOS VARNAME IMAGECOLORGET IMAGEBUF XPOS YPOS RVARNAME GVARNAME BVARNAME ---------------------------------------------------------------------------- Thu, 02 Mar 2006 PM All commands that accept colors will now accept a single string of 3 decimal numbers seperated by spaces or commas as a RGB color value. Like this: set colornum "128,0,128" color "255 255 0" New command VARSYSTEM, returns true if a variable is a system variable. If passed more than 1 parameter, then the system variable is set. For example: varsystem colornum black if varsystem(colornum) text "ColorNum is a system variable" endif set varname colornum set value 0 if !varsystem(@varname,@value) set @varname @value endif The STREVAL function now handles system variables, for instance: color 127 textln streval("@colornum") ; displays 127 ---------------------------------------------------------------------------- Thu, 02 Mar 2006 DRAWOFFSET with no parameters was not restoring the previous draw offset, it was reseting back to the original draw offset (like DRAWOFFSETRESET). Fixed. DRAWOFFSET with just two parameters now shifts the draw offset area, instead of shrinking it. DRAWOFFSET allows you to create a draw offset that is outside the bounds of the window. It does not bounds checking. ---------------------------------------------------------------------------- Tue, 28 Feb 2006 Debug VARIABLES ON display of measurements that include a percentage was broken. Fixed. Four new system variables DRAWWIDTH DRAWHEIGHT DRAWOFFWIDTH and DRAWOFFHEIGHT @DRAWWIDTH is the same as 1+@DRAWMAXX-@DRAWMINX @DRAWHEIGHT is the same as 1+@DRAWMAXY-@DRAWMINY @DRAWOFFWIDTH is the same as 1+@DRAWOFFMAXX-@DRAWOFFMINX @DRAWOFFHEIGHT is the same as 1+@DRAWOFFMAXY-@DRAWOFFMINY New command IMAGESIZEFIT, same exact syntax as IMAGESIZE except it will size an image so that it fits within the given size without distorting, maintaining the original aspect ratio. All these variables and commands which accepted "ON" and "OFF" are fixed to allow those strings even when passed in a variable or via the WITH command. @DRAWAND @DRAWOR @DRAWXOR @TEXTCENTER @TEXTCLIP @TEXTCOLORCODES @TEXTDRAW @TEXTDRAWBACK @TEXTFONTCODES @TEXTFROMSTRIP @TEXTHTML @TEXTHTMLANTIFONT @TEXTHTMLTABS @TEXTHTMLWINFONT @TEXTINDENT @TEXTJUSTIFIED @TEXTLEFT @TEXTMONOSPACE @TEXTQUICK @TEXTRIGHT @TEXTRTF @TEXTSCROLL @TEXTWRAP @TEXTWRAPPUNCT DRAWFLOOD For instance: with texthtml on text @sometext Now works as expected. ---------------------------------------------------------------------------- Fri, 24 Feb 2006 IMAGESIZE when used with DRAWOFFSET was broken, fixed. ---------------------------------------------------------------------------- Wed, 22 Feb 2006 DRAWBOX completely rewritten to be dramaticly faster for thicker widths. In the past 4 x WIDTH number of filled rectangles were drawn for each box. Now a maximum of 4 filled rectangles are drawn. Also for all bit depths below 24bits per pixel, and for print devices a single windows Rectangle() API call is used with a hollow brush. DRAWBOXROUND DRAWRECTROUND were drawing images too small by one pixel on the bottom and right sides. DRAWRECT when used on a printer, or bit depths bellow 24 was drawing images too small by a 1 or more pixels depending on the size of the rectangle. Runable test which showed the problems (and that they are fixed now): windowsize 800 600 8 drawclear white color 0 imagenew test 101 101 imageput 100 100 test imageput 100 220 test imageput 220 100 test imageput 220 220 test color yellow drawbox 101 101 199 199 drawboxround 221 101 319 199 drawrect 101 221 199 319 drawrectround 221 221 319 319 wait exitnow ---------------------------------------------------------------------------- Tue, 21 Feb 2006 New command, FILESTRREPLACE, used to replace strings in a file. Useful for working with large files that would require a huge amount of memory to process if you loaded them into memory as a string. Uses 64bit counts, so it will handle files larger than 4GB, and will work with binary data. FILESTRREPLACE SOURCEFILENAME DESTINATIONFILENAME STRA STRB ... New commands TOSIZEX and TOSIZEY, go along with new operators, (VALUE)SIZEX and (VALUE)SIZEY. Works primarily the same as the existing TOSIZE command (VALUE)SIZE operator, except with axis specific values, such as percentages. Example: drawbox 100 100 (50pct)sizex (50pct)sizey TOSIZE and (VALUE)SIZE were broken when used with a DRAWOFFSET, fixed. ---------------------------------------------------------------------------- Thu, 16 Feb 2006 topixelsx and topixelsy functions, and )pixelsx and )pixelsy operators are fixed when used with a DRAWOFFSET (they now subtract @DRAWOFFMINX/@DRAWOFFMINY from the pixel value). Postscript image mask compressed was accidently disabled, it's re-enabled. DRAWOFFSET changed so that it is relative to any previous draw offset. DRAWOFFSET with no parameters now reverts to the previous draw offset. The list of draw offsets is kept up to 16 deep. New command DRAWOFFSETRESET, resets the draw offset to the maximum (original image boundries). Also flushes any previous draw offsets. It accepts the same parameters as DRAWOFFSET, so you can create a new draw offset with a single command. This is very much like the old behavior of the DRAWOFFSET command. New system variables which are the bounds of the current draw offset: @DRAWOFFMINX @DRAWOFFMINY @DRAWOFFMAXX @DRAWOFFMAXY ---------------------------------------------------------------------------- Wed, 15 Feb 2006 INC/DEC with a string was corrupting any previous use of that string (it was destroying the actual token's original value). Fixed. STREVAL with no value or a NULL value would crash. SET VARIABLES ON was broken in last build for variables with a NULLT value (nothing was shown). Now the "varname = NULLT" will appear. NULLT means "NULL Token", a non value, not zero, not a string, not a number. Subreferences with arrays were broken in many cases, flakey in others. Entire array subreference code, and variable name search code is rewritten to handle nested subreferences. Here is a small example that now works correctly, it failed completely in previous builds: set test[john][a][m] aaa ; made following code fail set test[john][b] bbb set test[john][c] ccc set test[john][d] ddd set test[john]{x} xxx set test[john]{y} yyy set test[john]{z} zzz set david test[john] ; failed on some multi-dimensional arrays, fixed. set vicky strlist(@david) ; didn't work, fixed. set edward &david[a] ; didn't work, fixed. set bob @edward ; didn't work, fixed. set variables on wait exit ---------------------------------------------------------------------------- Thu, 09 Feb 2006 XMLLOAD no longer creates lots of single element arrays for single text elements. Bug in SET PRINTNAME fixed, it was leaving the printname on the stack. STREVAL is now supported, but only for a very limited subset of features for now. The only two features supported for now are variables using '@' and measurements. result = streval("22in") testvar = goodbye result = streval("@testvar") ; gives "goodbye" testvar = varname varname = hello result = streval("@@testvar") ; gives "hello" Two new commands LOCALUNDER and LOCALUNDERS. Work exactly like LOCAL and LOCALS except they create a variable that is local to the calling function. For example: test1 if !vardef(goodbye) messagebox "goodbye undefined" endif exitnow test1: test2 messagebox goodbye1 @goodbye return test2: localunder goodbye hello messagebox goodbye2 @goodbye return The ARRAYATTRIB command is changed to display the indexes for attributes in an array. The ARRAYINDEX command now only shows indexes for an array where the array's element has a valid value. It does not display indexes for attributes in an array. For example: set test{1} a set test{2} b set test{3} c set test[1] a set test[4] b textln strlist(arrayindex(test)) ; Displays "1 4" textln strlist(arrayattrib(test)) ; Displays "1 2 3" Using INC or DEC where the variable contains a string with digits in it will no longer force the string to be converted into a number. For example: value = item3 for 5 ; Displays "item3 item5 item7 item9 item11" text @value$" " inc value 2 next For decrementing or negative values, the prefix 999 is prepended to the numerical part. value = item3box for 4 ; Displays "item3box item0box item9997box item9994box" text @value$" " inc value -3 next ---------------------------------------------------------------------------- Mon, 06 Feb 2006 Crashing bug with unicode characters in HTML fixed. Unicode characters are now processed correctly, but igored (AG doesn't support non-8bit character sets). ---------------------------------------------------------------------------- Thu, 02 Feb 2006 ->root wasn't being filled in correctly by XML load. New command TOMEASURE, it takes a string and if it's a numeric constant followed by a measurement suffix it will output a measurement object. xpos = tomeasure("50pct") ypos = tomeasure("3.2in") imageput @xpos @ypos example.gif The routine which translates ASCII into float had a small rounding error now fixed. For example 100.547 was being stored as 100.5470000001 This was preventing some floating point constants from being compiled correctly by AGCOMP. AGCOMP was storing floating point constants as 30 bit floating point. If a number could not be accurated represented in 30 bits (23bit frac, 6bit exp, and 1 bit sign), then the original string version of the number was stored. Now AGCOMP will also try fixed point scaled integer based on INT23BITVALUE/1000. To store this in place of a 30 bit floating point value, it uses the invalid exponent of 0 with sign of 1. This allows common base ten values to be stored more accurately without resorting to storing the original string version. AGCOMP now generates BASECMD encoding for all the measurement commands including: centimeters inches millimeters percentage picas pixels pixelsx pixelsy points size This allows these commands to take up one less 32bit word each use when encoded into compiled AGC file. Also allows for more complex compound commands (like 12.5pct being stored in a single 32bit word). AGCOMP when combining a constant with a BASECMD used to only support a signed 23bit integer. Now it supports a 21bit intger, with flags for scaled integers (divided by 1000), and for a leading tail. This allows an expression like 12.5pct, which compiles into (12.5 topct) to be encoded as a single 32bit word. Previously it would be encoded as pushtail, pushnumber 12.5, call cmd_topct. Three 32bit words. All these changes mean that any AGC files compiled with older versions of AGCOMP may not play correctly in the new AGPLAY runtime. Also AGC files compiled with this new version of AGCOMP absolutely will not play correctly with older AGPLAY runtimes. ---------------------------------------------------------------------------- Mon, 30 Jan 2006 New element for arrays, ->root. This is used for XML loading and saving, and is the root element from the XML tree. This means you must not specify the root element when referencing an XML document you've loaded. For example: drawclear white color black xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test set variables on textln done textln test->root ; displays "PCHealthProtect" excludes = array(@test["FILES"]["Exclude"]["REC"]) healthfiles = test["FILES"] includes = array(@healthfiles["Include"]["REC"]) firstexclude = @test["FILES"]["Exclude"]["REC"][0] forever AfterGRASP elements are now setable, for example: drawclear white color black xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test set test->root "NotPCHealthProtect" xmlsave "C:\WINDOWS\system32\Restore\filelist.xml" test forever The following AfterGRASP elements are setable (be careful, some are internal variables that may cause crashing or unpredictable results if changed): ->bits ->edgeaveragex ->edgeaveragey ->edgecenterx ->edgecentery ->edgeradiusx ->edgeradiusy ->imagedensityx ->imagedensityy ->imagehbitmap ->imagehdc ->layerbusy ->origsizex ->origsizey ->panoangle ->panotilt ->panoview ->root ->sizex ->sizey ->textoffx ->textoffy ->virtsizex ->virtsizey ->x1 ->x2 ->y1 ->y2 ---------------------------------------------------------------------------- Thu, 26 Jan 2006 Multi-dimensional arrays can now go 32 levels deep (previously it was 10). DIRDELETE fixed! (always been broken). Return code is the window's error code returned by GetLastError(). Typical error is "5", for Access Denied. Setup updated to use Innosetup 5.1.6 Crash when errors found during an XML load are fixed. XML Element attributes are now handled by the XML load. They are referenced like this: text @doc[image]{test} VARIABLES ON displays attributes with the {} around the attribute name Attributes apply to any array, so you can do: set example{test} 100 set example[test] 200 textln @example{test} ; displays 100 textln @example[test] ; displays 200 ---------------------------------------------------------------------------- Thu, 19 Jan 2006 Install updated to add missing registry entries that AGEDIT wanted. Internally the XMLDOC type is now the same as an array. XML Access now working. Changes are not written back with an XMLSAVE (the changes made to the array are not reflected into the XML tree structure yet). Here is a working example: drawclear white color black xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test set variables on textln done excludes = array(@test["PCHealthProtect"]["FILES"]["Exclude"]["REC"]) healthfiles = test["PCHealthProtect"]["FILES"] includes = array(@healthfiles["Include"]["REC"]) firstexclude = @test["PCHealthProtect"]["FILES"]["Exclude"]["REC"][0] forever Notice the XML tag names are in quotes to preserve their mixed (upper and lower) case. ---------------------------------------------------------------------------- Mon, 16 Jan 2006 First new commands to support XML: XMLNEW VARNAME XMLLOAD FILENAME XMLLOAD FILENAME VARNAME XMLLOAD HTTPFTPURL XMLLOAD HTTPFTPURL VARNAME XMLSAVE FILENAME XMLFREE VARNAME The XMLLOAD actually works (If you SET VARIABLES ON you will see it's been loaded). drawclear white color black xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test set variables on textln done forever Access syntax unfinished. Expected syntax is: xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test excludes = array(@test[PCHealthProtect][FILES][Exclude][REC]) healthfiles = test[PCHealthProtect][FILES] includes = array(@healthfiles[Include][REC]) firstexclude = test[PCHealthProtect][FILES][Exclude][REC][0] The XML support requires WINSOCK Support, so AGPLAY is now directly linked to call WSOCK32.DLL. This may prevent AGPLAY from working on old versions of Win95. Let me know if this is an issue. If so, then I can create an interface layer that looks for the DLL, much like the calls to WININET.DLL that are done in AGPLAY right now. New modular option XMLDOC to disable all XML support. If no XML commands are used then AGCOMP will set XMLDOC to OFF. ---------------------------------------------------------------------------- Tue, 02 Jan 2006 Happy New Year! A couple big speed improvements made over the holidays. PostScript images, either printed or generated with IMAGEPOSTSCRIPT now use LZW compression for the mask (on images that have a mask set with IMAGEMASKSET). This results in DRASTICLY faster printing on large images since injecting the huge hex streams for an uncompressed mask could take minutes (and now take a few seconds). PALETTEOPTIMIZE rewritten almost entire from scratch to use double indexed sparse lookup tables to drasticly speed up the color search code. What could take minutes now takes a couple seconds, with more accurate cleaner results! This new code also has special cases to handle very large numbers of colors (greater than 65536 colors) in the source images. Copyright messages updated to 2006 ---------------------------------------------------------------------------- Wed, 14 Dec 2005 The IMAGELOADCMYK option now defaults to on since so many image operations now support CMYK directly. Two new system variables, provide the filenames for new CMYK to RGB and RGB to CMYK conversion support. The files are expected to be 48MB for the convert to RGB (6 bit accuracy, interpolation used to fill in missing values), and 64MB to convert to CMYK (full 8 bit accuracy). The files are basicly flat arrays, giant lookup tables read from disk when first needed, and kept in memory until program exit. @IMAGECONVERTTABLECMYK Default value is "sRGB IEC61966-2.1 to CMYK US Web Coated (SWOP) v2.array" @IMAGECONVERTTABLERGB Default value is "CMYK US Web Coated (SWOP) v2 to sRGB IEC61966-2.1.array" If the table cannot be loaded, then a algorithmic block of code is used instead. The results do NOT look entirely correct since the algorithmic code does not understand color spaces only generic raw CMYK values. IMAGECONVERT now supports a value of -32 for bits allowing conversion to CMYK (IMAGENEW already supported this). All imageput operations now support converting colorspace from CMYK to RGB and from RGB to CMYK. This includes IMAGECONVERT. New element for images ->imagecmyk Is zero for most images, and 1 for CMYK images. Example: drawclear white color black iscmyk[0] = "RGB" iscmyk[1] = "CMYK" set imageloadcmyk on imageload cmyktest messagebox @iscmyk[cmyktest->imagecmyk] imageconvert 24 cmyktest messagebox @iscmyk[cmyktest->imagecmyk] imageput cmyktest wait imageconvert -32 cmyktest messagebox @iscmyk[cmyktest->imagecmyk] imageput 100 100 cmyktest wait exitnow The ->imagepaletteadr and ->imageheadadr elements are now supported. The ->imageheadadr points to the BITMAPINFOHEADER for an image. The ->imagepaletteadr points to the 1024 byte palette in RGBQUAD format (standard windows). All file opens in AG, will search "C:\DigiLib" if the open fails. This means the color translation files can be stuck in C:\DigiLib and AG will find them. Without this new feature you would have to stick something like this in: set imageconverttablergb "C:\DigiLib\\"$@imageconverttablergb set imageconverttablecmyk "C:\DigiLib\\"$@imageconverttablecmyk AGEDIT data files updated for new variables and element. ---------------------------------------------------------------------------- Sun, 11 Dec 2005 PALETTEOPTIMIZE has a series of special cases added for large numbers of colors (many thousands). This is to speed up those cases which were taking minutes to run. This sacrifices a small amount of accuracy in those cases. IMAGESIZE (and image scaling in general) had a rounding error which would slightly reduce the brightness of some colors in some cases. Fixed. Drawing a 24bit/32bit hicolor image to a 8bit buffer is now dramaticly higher quality. It's also very slow since it calculates each pixel by finding the best match in the palette. This corrects incorrect results when using IMAGECONVERT 8, and IMAGESIZE on 8bit images. ---------------------------------------------------------------------------- Thu, 08 Dec 2005 AGEDIT replaced with older build from last December recompiled without the expiration date. AGEDIT Data files for commands, variables and elements are all updated. DRAWPIXEL with a color fixed, it was treating the color and coordinate pair as a RGB triplet. DRAWPIXEL, COLORGET, and IMAGESIZE all fixed to correctly handle CMYK images (true 32 bits per pixel). ---------------------------------------------------------------------------- Tue, 06 Dec 2005 NETOPENWEBPAGE used to create a temp file called "AG.HTM" in the Windows directory. The problem is, if you are a user without administrator privilages this will fail. So NETOPENWEBPAGE now uses the TEMP directory (and if that's not defined it uses C:\) Two new commands, APPCREATESHORTCUT and APPRESOLVESHORTCUT. APPCREATESHORTCUT FILENAME DESCRIPTION PATH Example: appcreateshortcut "c:\\example.exe" "My Example" "C:\\Documents and Settings\\Administrator\\Desktop\\Example.lnk" TRUEPATH = APPRESOLVESHORTCUT(PATH) Example: text appresolveshortcut("C:\\Documents and Settings\\Administrator\\Desktop\\Example.lnk") ; displays "c:\example.exe" ---------------------------------------------------------------------------- Sun, 04 Dec 2005 The IMAGEPOSTSCRIPT now works with decompressed images (ones loaded without IMAGECOMPRESSED ON), it also works with CMYK decompressed images, and images with IMAGEMASKSET. New system variable IMAGELOADCMYK, defaults to OFF, when ON, a CMYK JPEG when loaded will NOT be converted to RGB, it will be left as CMYK. This is mainly to be used for special printing applications and modifying CMYK images. Defaults to OFF SET IMAGELOADCMYK ON SET IMAGELOADCMYK OFF New option for IMAGECOMPRESSED, can now be set to BOTH which whenloading JPEGs will decompress the PEG as if IMAGECOMPRESSED was OFF, but will also load the compressed image file as well. All operations will use the decompressed image data except when writing to a PostScript printer where the compressed JPEG data will be used instead. Defaults to OFF Still has problems with some commands like IMAGESIZE. SET IMAGECOMPRESSED ON SET IMAGECOMPRESSED OFF SET IMAGECOMPRESSED BOTH Runable example: drawclear white color black imageload cmyktest.jpg test imageflood test pkgmask top left 8 ; create a mask (8% match) imagemaskset test pkgmask drawclear red imageput test imagefree test set imagecompressed on imageload cmyktest.jpg test set imagecompressed off imagemaskset test pkgmask imagefree pkgmask ; ; create a PostScript EPS file ; fname = "test.eps" pshead = "%!PS-Adobe-3.0 EPSF-3.0"$@crlf psmedia = "%%DocumentMedia: CustomMedia @XSIZE @YSIZE 0 white CustomMedia"$@crlf psmedia = strreplace(@psmedia, "@XSIZE", test->sizex, "@YSIZE", test->sizey) psbounding = "%%BoundingBox: 0 0 @XSIZE @YSIZE"$@crlf psbounding = strreplace(@psbounding, "@XSIZE", test->sizex, "@YSIZE", test->sizey) pscomments = "%%DocumentData: Clean7Bit"$@crlf$"%%LanguageLevel: 2"$@crlf$"%%EndComments"$@crlf$"%%BeginProlog"$@crlf$"%%EndProlog"$@crlf$"%%Page: 1 1"$@crlf$"%%PageMedia: CustomMedia"$@crlf pspagesize = "<< /PageSize [@XSIZE @YSIZE] >> setpagedevice"$@crlf pspagesize = strreplace(@pspagesize, "@XSIZE", test->sizex, "@YSIZE", test->sizey) psimage = imagepostscript(0, 0, test->sizex, test->sizey, test) pstail = "%%EOF"$@crlf postimage = @pshead$$@psmedia$@psbounding$@pscomments$@pspagesize$@psimage$@pstail filedelete "c:\test.eps" filesend "c:\test.eps" @postimage ; ; create a PostScript file of just this image, masked, original JPEG ; set printfilename "c:\test.ps" printstart printstartpage printset imagesize 100pct 0 test imageput test imageset printendpage printend exitnow Four new system variables for debugging: @DEBUGLINE returns current linenumber in script @DEBUGLINES returns the last 100 linenumbers executed in script @DEBUGSCRIPT returns current scriptname @DEBUGSCRIPTS returns the scriptname for the last 100 lines executed @DEBUGLINES and @DEBUGSCRIPTS would normally used with ARRAY() ARRAY(@DEBUGLINES)[0] gives the same result as @DEBUGLINE ARRAY(@DEBUGSCRIPTS)[0] gives the same result as @DEBUGSCRIPT ---------------------------------------------------------------------------- Thu, 17 Nov 2005 Long standing bugs in TEXTHEIGHT and TEXTWIDTH where the results could be incorrect if done after complex HTML/RTF text is fixed. ---------------------------------------------------------------------------- Wed, 09 Nov 2005 New option for the HTTP command, HTTP GET, returns the web page as a string. For example: messagebox http(get,"http://www.google.com") Or to detect a connection: connected = @FALSE if @netconnected http get "http://www.google.com" connected = !@httpERROR endif if !@connected messagebox "Internet Connection Not Working" exitnow endif @NETCONNECTED variable now supported. Valid return values are either -1 for no available (no networking). or a integer between 0 and 7 that is one or more of these flags added together. ; Local system uses a modem to connect to the Internet. GLOBAL INTERNET_CONNECTION_MODEM 1 ; Local system uses a local area network to connect to the Internet. GLOBAL INTERNET_CONNECTION_LAN 2 ; Local system uses a proxy server to connect to the Internet. GLOBAL INTERNET_CONNECTION_PROXY 4 NETCONNECT command now supported NETCONNECT AUTODIAL NETCONNECT AUTOHANGUP NETCONNECT DIAL ; unsupported NETCONNECT HANGUP ; does the same as AUTOHANGUP Two new system variables @HTTPGETFLAGS and @HTTPPUTFLAGS, They control the HTTP GET* and HTTP PUT* commands. Default values are: SET HTTPGETFLAGS TRANSFER_BINARY RELOAD DONT_CACHE SET HTTPPUTFLAGS NO_CACHE_WRITE All the options available are: ASYNC CACHE_ASYNC CACHE_IF_NET_FAIL EXISTING_CONNECT FORMS_SUBMIT FROM_CACHE HYPERLINK KEEP_CONNECTION MAKE_PERSISTENT NEED_FILE NO_AUTH NO_AUTO_REDIRECT NO_CACHE_WRITE NO_COOKIES NO_UI PASSIVE PRAGMA_NOCACHE RAW_DATA READ_PREFETCH RESYNCHRONIZE SECURE TRANSFER_ASCII TRANSFER_BINARY Details on these options specific to GET/PUT: HTTPGETFLAGS: EXISTING_CONNECT Attempts to use an existing InternetConnect object if one exists with the same attributes required to make the request. This is useful only with FTP operations, since FTP is the only protocol that typically performs multiple operations during the same session. The WinINet API caches a single connection handle for each HINTERNET handle generated by InternetOpen. InternetOpenUrl uses this flag for HTTP and FTP connections. HYPERLINK Forces a reload if there was no Expires time and no LastModified time returned from the server when determining whether to reload the item from the network. IGNORE_CERT_CN_INVALID Disables checking of SSL/PCT-based certificates that are returned from the server against the host name given in the request. WinINet functions use a simple check against certificates by comparing for matching host names and simple wildcarding rules. IGNORE_CERT_DATE_INVALID Disables checking of SSL/PCT-based certificates for proper validity dates. IGNORE_REDIRECT_TO_HTTP Disables detection of this special type of redirect. When this flag is used, WinINet transparently allows redirects from HTTPS to HTTP URLs. IGNORE_REDIRECT_TO_HTTPS Disables the detection of this special type of redirect. When this flag is used, WinINet transparently allows redirects from HTTP to HTTPS URLs. KEEP_CONNECTION Uses keep-alive semantics, if available, for the connection. This flag is required for Microsoft Network (MSN), NTLM, and other types of authentication. NEED_FILE Causes a temporary file to be created if the file cannot be cached. NO_AUTH Does not attempt authentication automatically. NO_AUTO_REDIRECT Does not automatically handle redirection in HttpSendRequest. NO_CACHE_WRITE Does not add the returned entity to the cache. NO_COOKIES Does not automatically add cookie headers to requests, and does not automatically add returned cookies to the cookie database. NO_UI Disables the cookie dialog box. PASSIVE Uses passive FTP semantics. InternetOpenUrl uses this flag for FTP files and directories. PRAGMA_NOCACHE Forces the request to be resolved by the origin server, even if a cached copy exists on the proxy. RAW_DATA Returns the data as a GOPHER_FIND_DATA structure when retrieving Gopher directory information, or as a WIN32_FIND_DATA structure when retrieving FTP directory information. If this flag is not specified or if the call was made through a CERN proxy, InternetOpenUrl returns the HTML version of the directory. RELOAD Forces a download of the requested file, object, or directory listing from the origin server, not from the cache. RESYNCHRONIZE Reloads HTTP resources if the resource has been modified since the last time it was downloaded. All FTP and Gopher resources are reloaded. SECURE Uses secure transaction semantics. This translates to using Secure Sockets Layer/Private Communications Technology (SSL/PCT) and is only meaningful in HTTP requests. HTTPPUTFLAGS: CACHE_IF_NET_FAIL Returns the resource from the cache if the network request for the resource fails due to an ERROR_INTERNET_CONNECTION_RESET (the connection with the server has been reset) or ERROR_INTERNET_CANNOT_CONNECT (the attempt to connect to the server failed). HYPERLINK Forces a reload if there was no Expires time and no LastModified time returned from the server when determining whether to reload the item from the network. IGNORE_CERT_CN_INVALID Disables checking of SSL/PCT-based certificates that are returned from the server against the host name given in the request. WinINet functions use a simple check against certificates by comparing for matching host names and simple wildcarding rules. IGNORE_CERT_DATE_INVALID Disables checking of SSL/PCT-based certificates for proper validity dates. IGNORE_REDIRECT_TO_HTTP Disables detection of this special type of redirect. When this flag is used, WinINet functions transparently allow redirects from HTTPS to HTTP URLs. IGNORE_REDIRECT_TO_HTTPS Disables detection of this special type of redirect. When this flag is used, WinINet functions transparently allow redirects from HTTP to HTTPS URLs. KEEP_CONNECTION Uses keep-alive semantics, if available, for the connection. This flag is required for Microsoft Network (MSN), NT LAN Manager (NTLM), and other types of authentication. NEED_FILE Causes a temporary file to be created if the file cannot be cached. NO_AUTH Does not attempt authentication automatically. NO_AUTO_REDIRECT Does not automatically handle redirection in HttpSendRequest. NO_CACHE_WRITE Does not add the returned entity to the cache. NO_COOKIES Does not automatically add cookie headers to requests, and does not automatically add returned cookies to the cookie database. NO_UI Disables the cookie dialog box. PRAGMA_NOCACHE Forces the request to be resolved by the origin server, even if a cached copy exists on the proxy. RELOAD Forces a download of the requested file, object, or directory listing from the origin server, not from the cache. RESYNCHRONIZE Reloads HTTP resources if the resource has been modified since the last time it was downloaded. All FTP and Gopher resources are reloaded. SECURE Uses secure transaction semantics. This translates to using Secure Sockets Layer/Private Communications Technology (SSL/PCT) and is only meaningful in HTTP requests. ---------------------------------------------------------------------------- Mon, 07 Nov 2005 Serious bug in AGCOMP not correctly compressing compiled scripts is fixed. This bug has been in since the upgrade to a newer ZLIB in Jul 2005. The modular compiler "OPTION" command now has 2 other possible parameters. Previously only "ON" and "OFF" were accepted. Now, "FORCEON" and "FORCEOFF" are also accepted. "ON" and "OFF" work as before, they can be overidden by AGCOMP if it thinks a block code is required or not required. FORCEON and FORCEOFF are absolute, they will not be overridden. If you use for instance OPTION LAYERS FORCEOFF, the code to handle layers will absolutely not be linked into the modular runtime. FORCEON/FORCEOFF also works with "ALL" but it not particularly useful. OPTION ALL FORCEON will include all modular code (except for commands not used), and OPTION ALL FORCEOFF will force all modular code to be excluded. AGCOMP is now a great deal smarter about what modular options should automaticly enabled or disabled. For instance OPTION ALL OFF will now allow the SCROLLBOX command to work correctly. ---------------------------------------------------------------------------- Sun, 30 Oct 2005 Small memory leak in WINFONT/FONTDEFINE fixed (one extra instance of font's variable name was created). Three new FONTSTYLE/WINFONTSTYLE options: VARIATION, VARIATIONS and ALLVARIATIONS FONTSTYLE VARIATION SUFFIX STYLE STYLE STYLE SUFFIX is the up to 16 character suffix added to the variable name for this variation of the base font variable name. STYLE is one or more styles, only weight, italic, underline and strikeout are accepted, others are ignored. The variation ends with the next variation command, or the end of the fontstyle parameters. Two shortcut options to create common multiple variations: FONTSTYLE VARIATIONS The same as: VARIATION B BOLD VARIATION I ITALIC VARIATION U UNDERLINE VARIATION S STRIKEOUT FONTSTYLE ALLVARIATIONS The same as: VARIATION B BOLD VARIATION I ITALIC VARIATION U UNDERLINE VARIATION S STRIKEOUT VARIATION BI BOLD ITALIC VARIATION BU BOLD UNDERLINE VARIATION BS BOLD STRIKEOUT VARIATION IU ITALIC UNDERLINE VARIATION IS ITALIC STRIKEOUT VARIATION US UNDERLINE STRIKEOUT VARIATION BIU BOLD ITALIC UNDERLINE VARIATION BIS BOLD ITALIC STRIKEOUT VARIATION BUS BOLD UNDERLINE STRIKEOUT VARIATION IUS ITALIC UNDERLINE STRIKEOUT Runable example: drawclear white color black fontstyle anti allvariations variation l light fontdefine aarial22 "Arial" 22 set variables on for fn in strlist(varmatch("aarial22*")) font @fn textln @fn next drawregion 50pct 0 100pct 100pct fontstyle init allvariations variation l light fontdefine arial22 "Arial" 22 set variables on for fn in strlist(varmatch("arial22*")) font @fn textln @fn next forever ---------------------------------------------------------------------------- Thu, 27 Oct 2005 New command STRSPLIT, takes a one or more strings followed by a split value. It splits the strings into multiple strings where ever the split value is found. For instance: for word in strlist(strsplit("Hello there this is a string"," ")) textln @quote$@word$@quote next Displays: "Hello" "there" "this" "is" "a" "string" Using multiple strings: words = array(strsplit("Hello there this is a string","and this is another string"," ")) textln @words[0] ; Displays Hello textln @words[6] ; Displays and Using a multiple character split value: words = array(strsplit(strlist(1,2,3,4),@crlf)) for i in strlist(@words) text @i next The comparison operators (less than, greater than, less than or equal, greater than or equal, equal and not equal) now work on measurements. They do not handle different measurements. So for instance you cannot compare inches to percentage. But you can compare inches to mm. Multiply and Divide of Measurements now handles like measurements, so for instance you can say 10pct*3pct. This is in addition to Multiply and Divide of numbers, which already worked, like this: (10pct+5)*1.5 or 11in/3. Problems with adding/subtracting measurements that were previously multiplied or divided are fixed. The SET VARIABLES ON display is brought up to date, it had not been updated since early 2003! In particular the MEASURE type is fully displayed. Other types displayed (but only minimally): VECTORDATA INPUT IMAGEFADE SOUND DATABASE DBFIELDNAME DBINDEX DBCACHE DBRECORDCACHE SCROLLBOX The mm and cm measurements now remember they are metric so the VARIABLES display will show them in mm instead of inches. If you add mm to inches the resulting value will display as metric in the VARIABLES display. LIBXML2 library added to project as part of investigating XML support, (not linked in yet). ---------------------------------------------------------------------------- Tue, 18 Oct 2005 The error message for an invalid label used with GOSUB/WHEN/HOTSPOT now gives the name of the incorrect label. This is extremely useful for tracking down a incorrect WHEN/HOTSPOT when you've done a SCRIPTLINK to a script without the label for a active WHEN/HOTSPOT. DRIVEFILELIST with long paths was broken since (13 Oct 2005) build. Fixed. ---------------------------------------------------------------------------- Sun, 16 Oct 2005 Two new commands, IMAGEROW and IMAGECOLUMN. They take one or more images and returns a single image with all the images passed to it lined up in a column column or row. Accepts wildcards and arrays of images. Example: diaw = array(diaw1, diaw2, diaw3, diaw4, diaw5) for pic in strlist(@diaw) imageload @pic next global diawrow imagerow(@diaw) ---------------------------------------------------------------------------- Thu, 13 Oct 2005 Huge number of fixes for NULL or Blank parameters, all these commands are affected (they would crash back to windows): ARRAYEXCEPT ARRAYEXTRACT DESKTOPWALLPAPER FILECOPY FILEDELETE IMAGEALPHASET IMAGECENTER IMAGEFINDCENTER IMAGEFINDEDGES IMAGESPOTCOLOR IMAGETRIM INIGET INISET MEMGETSTRING NETOPENWEBPAGE PRINTSTART RANDOM SCREENSAVER SCRIPTLINK STRASC STRSORT STRWILDSEARCH WINDOWSIZE WINFONT WINFONTSTYLE Three commands added: STRENCRYPTBLOWFISH STRDECRYPTBLOWFISH UNGLOBAL The BLOWFISH commands have the exact same syntax as STRENCRYPTAES256 and STRDECRYPTAES256 UNGLOBAL removes a global variable. Much like FREE except the variable is completely removed. ---------------------------------------------------------------------------- Tue, 11 Oct 2005 SCROLLBOX has a new TEXTELEVATORGAP option which is how many pixels to offset the elevator shaft from the text (reducing the size of the text area). SCROLLBOX TEXTOFFSET now supports measurements SET TEXTTABSIZE now supports measurements Negative now works on measurements, so for instance: set texttabsize -(20pct) ---------------------------------------------------------------------------- Thu, 06 Oct 2005 Bug with a trailing "<" character in a text string causing the next text statement to hang fixed. ---------------------------------------------------------------------------- Wed, 05 Oct 2005 New command VECSIZE calculates the distance between two points: HYP = VECSIZE(X1,Y1,X2,Y2) Same as: hyp = sqrt((@x1-@x2)*(@x1-@x2)+(@y1-@y2)*(@y1-@y2)) DRAWBOXROUND now accepts measurements for all parameters. ---------------------------------------------------------------------------- Mon, 26 Sep 2005 Memory leaks found in: SCRIPTMERGE - was leaving zeros on the stack DRAWANTIBOX - All DrawAnti commands were leaving junk on stack DRAWANTIBOXROUND DRAWANTICIRCLE DRAWANTICIRCLEFILLED DRAWANTILINE DRAWANTIPOLYGON DRAWANTIPOLYGONFILLED DRAWANTIRECT DRAWANTIRECTROUND LAYERLEVEL was leaving ones and zeros on the stack All of these could cause crashes and other errors as AG runs out of stack space. ---------------------------------------------------------------------------- Thu, 15 Sep 2005 IMAGESIZE now scales the IMAGEPOSITION IMAGECOPY now correctly copies the IMAGEPOSITION IMAGESAVEGIF now saves the IMAGEPOSITION (other programs may not like negative offsets). New command VECROTATE, rotates a point around another point given an angle. SETS NEWXPOS NEWYPOS VECROTATE(CENTXPOS CENTYPOS XPOS YPOS ANGLE) Example routine that rotates the coordinates of a filled rectangle, creating a masked image of the rotated rectangle: rotatedimage: declare xs ys angle box = rotatebox(0, 0, @xs, @ys, @angle) color white imagenew masktemp @box[width] @box[height] imageset masktemp color 0 drawpolygonfilled @box[x1] @box[y1] @box[x2] @box[y2] @box[x3] @box[y3] @box[x4] @box[y4] imageset imageposition @box[areax1] @box[areay1] masktemp color white imagenew recttemp @box[width] @box[height] imageset recttemp color (@textfield[@pagenum][@f][rectcolor]) drawpolygonfilled @box[x1] @box[y1] @box[x2] @box[y2] @box[x3] @box[y3] @box[x4] @box[y4] imageset imageposition @box[areax1] @box[areay1] recttemp$@f imagemaskset recttemp masktemp imagefree masktemp return @masktemp rotatebox: declare cx cy width height angle local result[xs] @width local result[ys] @height local result[cx] @cx local result[cy] @cy locals result[x1] result[y1] vecrotate(@cx, @cy, 0, 0, @angle) locals result[x2] result[y2] vecrotate(@cx, @cy, @width-1, 0, @angle) locals result[x3] result[y3] vecrotate(@cx, @cy, @width-1, @height-1, @angle) locals result[x4] result[y4] vecrotate(@cx, @cy, 0, @height-1, @angle) local result[areax1] min(@result[x1],@result[x2],@result[x3],@result[x4]) local result[areay1] min(@result[y1],@result[y2],@result[y3],@result[y4]) local result[areax2] max(@result[x1],@result[x2],@result[x3],@result[x4]) local result[areay2] max(@result[y1],@result[y2],@result[y3],@result[y4]) local result[width] 1+@result[areax2]-@result[areax1] local result[height] 1+@result[areay2]-@result[areay1] result[x1] = @result[x1]-@result[areax1] result[y1] = @result[y1]-@result[areay1] result[x2] = @result[x2]-@result[areax1] result[y2] = @result[y2]-@result[areay1] result[x3] = @result[x3]-@result[areax1] result[y3] = @result[y3]-@result[areay1] result[x4] = @result[x4]-@result[areax1] result[y4] = @result[y4]-@result[areay1] return &result ---------------------------------------------------------------------------- Sun, 11 Sep 2005 Long standing bug in WINDOWSIZE used to resize a window that has active layers is fixed. This eliminates wierd glitches and missing sections of the window. ---------------------------------------------------------------------------- Wed, 07 Sep 2005 Bug in Modular compiler not including LAYERTEXT, LAYERTEXTWIDTH, LAYERTEXTHEIGHT, and LAYERTEXTOFFSET for use by the SCROLLBOX command is fixed. Bug in Modular compiler not doing a MEASURE ON if the NUMBERsize operator is used is fixed. Freeing of SCROLLBOXes was broken (didn't happen until program exit). Fixed. Memory leak in WHENs with labels, HOTSPOTs and SCROLLBOXes is fixed. They were all gobbling up dictionary entries and memory, this bug dates back to December 2002! ---------------------------------------------------------------------------- Tue, 06 Sep 2005 Complete list of Modular options (SCROLLBOXES is new as of a few builds ago): ALL BMPLOAD DATABASE DEBUG FADES FONTDEFINE FONTLOAD FTP GIFLOAD GIFSAVE GLILOAD HOTSPOTS HTMLLINK HTMLTEXT HTTP ICOLOAD IMAGESCALE INPUT INTERNET JPEGLOAD JPEGSAVE LAYERS MEASURE PANVIEW PNGLOAD PNGSAVE PRINT RTFTEXT SCROLLBOXES SOUND TIFFLOAD TIFFSAVE WHENS WINFONT Bug in stretched elevator cars (SCROLLBOX), wasn't stretching on small images, fixed. AGCOMP now handles enabling modular options required for SCROLLBOXES. ---------------------------------------------------------------------------- Sun, 04 Sep 2005 Two new commands MOUSECURSORSCROLL and MOUSECUSTOMSCROLL. They work exactly like MOUSECURSORHOT and MOUSECUSTOMHOT except the cursor they define is used for scrollboxes when you roll the mouse inside the arrows or elevator. ---------------------------------------------------------------------------- Thu, 01 Sep 2005 Extensive special case support for SCROLLBOX added. It now handles any combination of: different sized arrow images different sized click down arrow images a different sized elevator boxcar image a different elevatorwidth parameter Any combination will work, the images are centered within their alloted space, and the entire arrow/scrollbox area is enlarged to handle how even large is needed for all the images. If the scrollbar will not fit (images are too tall, or the scrollbox is too short), then no arrows or scrollbox is displayed, it's treated the same as if the text fit entirely in the scrollbox. ---------------------------------------------------------------------------- Tue, 30 Aug 2005 SCROLLBOX has the elevator car slightly more attractive (rounded corners) SSCROLLBOX ELEVATORSTRETCH now stretches an ELEVATORIMAGE. It duplicates the bottom half of the original elevator car image, duplicates the center scan line over and over to fill the extra space, and then duplcates the top half of the original car image. The generated elevator car is limited to no shorter than 5 pixels tall. If the text in a SCROLLBOX is shorter than the scrollbox, then no arrows or elevator are displayed, and the additional space where the arrows and elevator would be are used to display the text. Here is the text script I used to ensure the stretch elevator works: width = 640 height = 600 windowsize @width @height drawclear white color black textln "Scrollbox test" fontstyle anti fontdefine "Arial" 20 set variables on color red drawregion 50 50 (@width-100)size (@height-100)size drawbox @drawminx @drawminy @drawmaxx @drawmaxy 5 drawregion @drawminx+6 @drawminy+6 @drawmaxx-6 @drawmaxy-6 color black scrollbox test text strline(fileget(potter.txt),1,1) elevatorimage elevatorcar.bmp delay 200 scrollbox test text strline(fileget(potter.txt),1,5) forever ---------------------------------------------------------------------------- Mon, 29 Aug 2005 New SCROLLENABLE and SCROLLDISABLE to enable/disable scrollboxes (much like HOTENABLE and HOTDISABLE for hotspots). SCROLLBOX command in and working: Options are: POSITION XPOS YPOS [X2 Y2] SIZE WIDTH HEIGHT TEXT STRING TEXTADD STRING TEXTLINE LINENUM TEXTOFFSET [XOFFSET] YOFFSET TEXTSTEP YPIXELS ; default is 3 TEXTDELAY DELAYTIME1000 ; default is 1000/60 ELEVATORCOLOR COLOR ELEVATORCOLORBACK COLOR ELEVATORCOLOREDGE COLOR ELEVATORIMAGE IMAGEBUF ELEVATORSTRETCH ; default is STRETCH (not FIXED) ELEVATORFIXED ELEVATORWIDTH WIDTH ; default is 32 ARROWCOLOR COLOR ARROWCOLORBACK COLOR ARROWCOLOREDGE COLOR ARROWCLICKCOLOR COLOR ARROWCLICKCOLORBACK COLOR ARROWCLICKCOLOREDGE COLOR ARROWIMAGEUP IMAGEBUF ARROWIMAGEDOWN IMAGEBUF ARROWCLICKIMAGEUP IMAGEBUF ARROWCLICKIMAGEDOWN IMAGEBUF Elements available for scrollbox bufs: ->SIZEX ->SIZEY ->X1 ->Y1 ->X2 ->Y2 ->TEXT ->TEXTLINE ->TEXTOFFX ->TEXTOFFY ->X1, ->Y1, ->X2, ->Y2 are also supported for IMAGES and LAYERS as well as SCROLLBOXES ->TEXT, ->TEXTLINE, ->TEXTOFFX, ->TEXTOFFY are also supported for LAYERS as well as SCROLLBOXES. ->LAYERTEXT, ->LAYERTEXTLINE, ->LAYERTEXTOFFX and ->LAYERTEXTOFFY are removed (they were always returning zero anyway). width = 640 height = 600 windowsize @width @height drawclear white color black textln "Scrollbox test" fontstyle anti fontdefine "Arial" 20 set variables on color red drawregion 50 50 (@width-100)size (@height-100)size drawbox @drawminx @drawminy @drawmaxx @drawmaxy 5 drawregion @drawminx+6 @drawminy+6 @drawmaxx-6 @drawmaxy-6 color black scrollbox test text fileget(potter.txt) forever Know issues: The Elevator Car is ugly, and the stretch code isn't done yet. When clicking outside the Elevator Car within the Elevator Shaft, the Pageup & Pagedown work, but do not auto-repeat, and there is no "blink" of the empty shaft to show the click "worked". My attempts at auto-repeat were very quirky, so I disabled that for now. Performance near the bottom of long documents can be quite slow, this requires optimizing the text formatting engine, perhaps storing "way points" to speed up formatting of long documents. I'll have to run it through a profiler to get some real idea on where the majority of time is spent. The TEXTDELAY autorepeat when holding down an arrow button is sometimes quirky. I suggest a very small TEXTDELAY, and adjust TEXTSTEP instead. There are no keyboard shortcuts yet, no arrow keys, no pageup/down, no home/end. The TEXTOFFSET on the X Axis is not supported, it will not work correctly, and there are no plans for horizontal arrows/elevators. There may be odd quirks if displaying a document shorter than the scrollbox. In future it will not display arrows or elevator if the text fits. ---------------------------------------------------------------------------- Mon, 12 Aug 2005 Bug in drawregion which was not reseting the search for leading spaces in HTML text is fixed. This also applies to using IMAGENEW, and then IMAGESET to draw text in an image. New command SCROLLFREE, much like HOTFREE except it's for SCROLLBOXES created with the SCROLLBOX command. ---------------------------------------------------------------------------- Sat, 30 Jul 2005 Further rewrites of ZLIB support so that only one tiny change to ZCONF.H is now required to switch ZLIB versions. ZLIB upgraded to v1.23. FILEZIPAS and FILEZIP now correctly store the file date and time in the ZIP that is created. If the source file has no date (is from memory or a GL/EXE), then the current system date and time are used. ---------------------------------------------------------------------------- Fri, 29 Jul 2005 FILEZIPAS and FILEZIP were broken by the ZLIB upgrade. Numerous changes required in the MINIZIP code (which has quite a few hardcoded references to the standard C library). ---------------------------------------------------------------------------- Thu, 28 Jul 2005 New system variable: SET TEXTFROMSTRIP ON/OFF Defaults to OFF. When enabled (ON), any leading spaces, or line feeds will be stripped before text when using the TEXTFROM command. Useful for splitting up documents, and eliminating extra leading whitespace. New SCROLLBOX command started, not functional. ---------------------------------------------------------------------------- Thu, 21 Jul 2005 Loading of PNG images is working! LIBPNG reverted to original source code for LIBPNG 1.2.8, now uses compiler defines for changes. Method of passing file handle to LIBPNG rewritten to avoid odd errors. Rewrote code which copies PNG images to work with more recent LIBPNG. Numerous checks added for unusual PNG formats to convert them into something that AfterGRASP can handle (like greyscale with alpha gets converted to RGBA, and 16bit greyscale gets converted to 8bit). Work around added for "png_read_end" bug (call removed for now). ---------------------------------------------------------------------------- Wed, 20 Jul 2005 HTML Text now supports the
         
        tags. They switch the current font to "Courier New", and allow all tabs, spaces and newlines to be drawn. For example: drawclear white set htmltext on text "Table

        text "
                 1 Shoe	 2001
                 2 Cat	  2002
                 3 Horse	2003
                 4 Cabinet  2004
          
        " wait exitnow More error checking for GIF loading added, particularly in the width/height fields. Bug when ERRORLOAD OFF where the variable would be created, but no value stored in it is fixed. For instance this would have displayed "1" even if bad_gif_file.gif was corrupt. Now it correctly will display "0". drawclear white set errorload off imageload bad_gif_file.gif test messagebox vardef(test) exitnow ---------------------------------------------------------------------------- Tue, 19 Jul 2005 Treat this build as a true beta, there was extensive work required to update ZLIB. There may be new bugs as a result. ZLIB version 1.14 replaced with 1.22. This unfortunately does not fix the PNG load, it still fails. Clipping bug in DRAWCLEAR fixed, it now always clips to the current drawregion (it wasn't doing so sometimes). ---------------------------------------------------------------------------- Mon, 18 Jul 2005 New LAYER command: LAYER LEVEL to set the exact depth of a layer. So instead of above or below you can set the exact level of a layer: It takes a single parameter, an integer which can be any value. Giving two layers the same level will not work (the command will be ignored). You cannot have two layers with the same level. Returns either 0 (failure), or 1 (success). The default LEVEL for a newly created layer is 1 more than the highest level is use (if none, then 0). LAYER ABOVE sets the LEVEL to be 1 more than the highest, LAYER BELOW is 1 less than the lowest level in use. ---------------------------------------------------------------------------- Sun, 17 Jul 2005 4 new commands added! COLORDIALOG COLORVARIABLE COLORDIALOGOPTIONS OPTION1 OPTION2 OPTION3... Color Dialog Options: ANYCOLOR ENABLEHOOK ENABLETEMPLATE ENABLETEMPLATEHANDLE FULLOPEN PREVENTFULLOPEN RGBINIT SHOWHELP SOLIDCOLOR COLORDIALOGSET and COLORDIALOGGET are to set and retrieve the color dialog's fixed 16 color palette (which a user can change): RESULTARRAY16 = ARRAY(COLORDIALOGGET()) COLORVALUE = COLORDIALOGGET(INDEX) If COLORDIALOGGET is passed no parameters, it returns all 16 colors from the color dialog's palette. Otherwise it can be passed 1 or more indexes (from 0 to 15) COLORDIALOGSET @ARRAY16 (16 color values, no names or R G B) COLORDIALOGSET INDEX COLORVALUE If COLORDIALOGSET is passed 16 colors (integers), then it sets the 16 palette colors in the COLORDIALOG to those 16 colors. Otherwise, it treats the first parameter as an index from 0 to 15, and the 2nd parameter as a color value (names, and R, G, B triplets are acceptable). Runable example: drawclear white color black colordialogoptions fullopen anycolor for idx from 0 to 15 colordialogset @idx @idx*16+15 @idx*16+15 @idx*16+15 next colordialog colorvalue drawclear @colorvalue wait exitnow ---------------------------------------------------------------------------- Tue, 12 Jul 2005 FILEZIP and FILEZIPAS were not closing files opened to be copied into the ZIP. This meant they could not be deleted until your program exited. Fixed. New commands REGGETLIST and REGGETKEYLIST: RESULT = STRLIST( REGGETLIST(KEYROOT APPNAME) ) RESULT = ARRAY( REGGETLIST(KEYROOT APPNAME) ) messagebox strlist(reggetlist(LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts")) RESULT = STRLIST( REGGETKEYLIST(KEYROOT APPNAME) ) RESULT = ARRAY( REGGETKEYLIST(KEYROOT APPNAME) ) messagebox strlist(reggetkeylist(LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion")) ---------------------------------------------------------------------------- Thu, 07 Jul 2005 Two new commands, FONTDIALOG and FONTDIALOGOPTIONS FONTDIALOG FONTNAMEVAR FONTSIZEVAR FONTSTYLEVAR FONTNAMEVAR - variable name for string variable that will contain the name of the font. FONTSIZEVAR - variable name for the integer variable that will contain the height of the font. FONTSTYLEVAR - variable name for the array variable that will contain an array of font style options suitable for the FONTSTYLE and WINFONTSTYLE commands. Example: drawclear white fontdialog fontnamevar fontsizevar fontstylevar fontstyle init anti @fontstylevar fontdefine myfont @fontnamevar @fontsizevar font myfont color black text "Hello There" wait exitnow FONTDIALOGOPTIONS OPTION1 OPTION2 OPTION3.... Options for FONTDIALOGOPTIONS Control options: ANSIONLY BOTH EFFECTS ENABLEHOOK ENABLETEMPLATE ENABLETEMPLATEHANDLE FIXEDPITCHONLY FORCEFONTEXIST INITTOLOGFONTSTRUCT LIMITSIZE NOFACESEL NOOEMFONTS NOSCRIPTSEL NOSIMULATIONS NOSIZESEL NOSTYLESEL NOVECTORFONTS NOVERTFONTS PRINTERFONTS SCALABLEONLY SCREENFONTS SCRIPTSONLY SELECTSCRIPT SHOWHELP TTONLY USESTYLE WYSIWYG Fonttype options: BOLDTYPE ITALICTYPE OPENTYPETYPE PRINTERTYPE REGULARTYPE SCREENTYPE SIMULATEDTYPE TYPE1TYPE ---------------------------------------------------------------------------- Sun, 03 Jul 2005 New LAYER option, LAYER REGION, provides a clipping draw region for objects in a layer. For instance: drawregion @imageareax1 @imageareay1 @imageareax2 @imageareay2 imageput 50 75 example This layer will be clipped in the same way: layer testlay position 50 75 layer testlay region @imageareax1 @imageareay1 @imageareax2 @imageareay2 layer testlay image example New command IMAGEREAD. Works just like IMAGELOAD except it returns the image buffers, like this: images = array(imageread(base1.jpg, base2.jpg, base3.jpg)) local imagebuf imageread(example.gif) IMAGECOPY command now supports multiple destination buffers, so you can make multiple copies of the same image, for instance: imagecopy mainpage16 mainpage8 mainpage4 mainpage2 mainpage pagesizex = mainpage->sizex pagesizey = mainpage->sizey imagesize @pagesizex/2 @pagesizey/2 32 mainpage2 imagesize @pagesizex/4 @pagesizey/4 32 mainpage4 imagesize @pagesizex/8 @pagesizey/8 32 mainpage8 imagesize @pagesizex/16 @pagesizey/16 32 mainpage16 ---------------------------------------------------------------------------- Tue, 29 Jun 2005 Extensive error checking added to GIF load code. SET ERRORLOAD now supported. When set to OFF, no error is generated by a corrupt image file. New error code passed to AGEDIT when loading a corrupt image file: AGERROR_CORRUPTIMAGE -17 CORRUPTIMAGE errors are supported by PNG, GIF and JPEG load code. drawclear white set errorload off imageload "W1K6LD.gif" test1 ; a corrupt GIF imageload "W85DB.gif" test2 ; a corrupt GIF imageload "box6.gif" test3 ; a normal GIF imageput test3 ; displays "0 0 1" messagebox vardef(test1)$" "$vardef(test2)$" "$vardef(test3) exitnow ---------------------------------------------------------------------------- Sun, 20 Jun 2005 New types supported for DLLSETUP LENANDSTRINGARRAY int argc, char *argv[] STRINGARRAYANDLEN char *argv[], int argc STRINGARRAY char *argv[] NULL always provides a NULL value, useful for parameters that are always NULL like a CALLBACK address. STRINGANDLEN char *string, int stringlen LENANDSTRING int stringlen, char *string WINHANDLE HWND hwnd - always provides @WINHANDLE ---------------------------------------------------------------------------- Thu, 16 Jun 2005 Long standing bug in GLOPEN which would create extra instances of the GL filename, and of the GL tracking information fixed. This would prevent the GL from ever closing completely. So you could never delete, rename or write to a GL once you had ever used GLOPEN on it. This also resulted in a minor memory leak when the GL filename would never disappear if it was constructed (not a fixed name). ---------------------------------------------------------------------------- Wed, 01 Jun 2005 Bizarre text spacing on the 2nd (and later) page when using HTML TEXT and some fonts, when printing is fixed. ---------------------------------------------------------------------------- Tue, 31 May 2005 Occasional crashes with '&' used in HTML text fixed. ---------------------------------------------------------------------------- Tue, 24 May 2005 New command IMAGEPOSTSCRIPT returns an image encoded as PostScript. This only works with JPEG images loaded with the IMAGECOMPRESSED option. Supports IMAGESPOTCOLOR as well. RESULT = IMAGEPOSTSCRIPT(XPOS, YPOS, XSIZE, YSIZE, IMAGEBUF) Runable example: drawclear white color black set imagecompressed on imageload sharptest.jpg pshead = "%!PS-Adobe-3.0"$@crlf fileput sharptest.ps @pshead$imagepostscript(0, 0, sharptest->sizex, sharptest->sizey, sharptest) appshell open sharptest.ps ; will view with GSView or Acrobat exitnow RTF tags for quotes now support open and close, single and double quotes using the extended ASCII characters (LATIN 1): \lquote 145 Opening Single Quotation Mark \rquote 146 Closing Single Quotation Mark \ldblquote 147 Opening Double Quotation Mark \rdblquote 148 Closing Double Quotation Mark ---------------------------------------------------------------------------- Sun, 15 May 2005 Four new String commands designed for comparing strings and extracting the the differences or identical parts. All take the same parameters, two or more strings. SET STRINGRESULT STRDIFF(STRING1, STRING2, ...) SET STRINGRESULT STRSAME(STRING1, STRING2, ...) SET STRINGRESULT STRSAMEEND(STRING1, STRING2, ...) SETS STARTPOS LENGTH SETSTRDIFFPOSITION(STRING1, STRING2, ...) Example: drawclear white color black str1 = "Hello There, this is not a test string, that is all" str2 = "Hello There, this is a very test string, and that is all" textln @quote$strdiff(@str1, @str2)$@quote ;"not a test string," sets pos len strdiffposition(@str1, @str2) textln @pos$" "$@len ;22 18 textln @quote$strmid(@str1, strdiffposition(@str1, @str2))$@quote ;"not a test string," textln @quote$strdiff(@str2, @str1)$@quote ;"a very test string, and" sets pos len strdiffposition(@str2, @str1) textln @pos$" "$@len ;22 23 textln @quote$strmid(@str2, strdiffposition(@str2, @str1))$@quote ;"a very test string, and" textln @quote$strsame(@str1, @str2)$@quote ;"Hello There, this is " textln @quote$strsameend(@str1, @str2)$@quote ;" that is all" forever ---------------------------------------------------------------------------- Tue, 10 May 2005 "mailto:" urls linked to in HTML text now use "appshell open" instead of "netopenwebpage". This eliminates the extra browser window that was being opened. Color hi-lite on link words in HTML text is now done with a seperate color stack instead of using the same stack as the tags to eliminate interfering with other font/color changes. Hack/Kludge to fix text color in HTML links when word wrapped just before the link. It forces the text color back to black if the text color when starting the link is already the link color. This is just to fix an immediate problem, and will be fixed correctly soon. ---------------------------------------------------------------------------- Mon, 09 May 2005 Drastic changes to HTML parsing code required to allow HTML code to be stuff back into the stream of HTML being parsed. This allows the
      • tag to use the symbol font to display bullets. There is a strong likelyhood of new bugs in HTML support because of these extensive changes. STRREPLACE now supports multiple search/replace pairs of strings. All the search/replace operations are done in a single pass, so for instance: strreplace("Hello John", "Jo", "Joe", "John", "Ed") gives "Hello Joehn" strreplace("Hello John", "John", "Ed", "Jo", "Joe") gives "Hello Ed" strreplace("Hello John", "Jo", "Zoe", "Zoe", "Ed") gives "Hello Zoehn" Runable test: windowsize 800 600 drawclear white color black textln strreplace("Hello John", "Jo", "Joe", "John", "Ed")$" Hello Joehn" textln strreplace("Hello John", "John", "Ed", "Jo", "Joe")$" Hello Ed" textln strreplace("Hello John", "Jo", "Zoe", "Zoe", "Ed")$" Hello Zoehn" forever An unlimited number of search/replace pairs are supported. The performance of using a single STRREPLACE instead of a a series of multiple STRREPLACE statements is dramaticly faster, particularly with large source strings (a megabyte or more). ---------------------------------------------------------------------------- Tue, 03 May 2005 A new command and new element (for images). Used for printing color separations with spot colors. Only works with CMYK JPEG images loaded with IMAGECOMPRESSED ON. IMAGEBUF->SPOTCOLOR ; returns color names and values IMAGESPOTCOLOR IMAGEBUF "Spot Color Name" CYAN MAGENTA YELLOW BLACK ... CYAN MAGENTA YELLOW and BLACK are from 0 to 1, floating point values, PostScript style. Up to four spot colors can be specified. First replaces CYAN channel, Second replaces the MAGENTA channel and so on. Unfortunately Photoshop won't let you save a custom channel image as JPEG (where you can actually see the spot colors displayed correctly in Photoshop). You have to cut/paste each channel into a new CMYK image, and then save that as JPEG. Example: set imagecompressed on imageload ibmlogo_cmyk.jpg imagespotcolor ibmlogo_cmyk "PANTONE 299 CVC" 0.87 0.18 0 0 imagesize 10pct 12pct ibmlogo_cmyk imageput 30pct 43pct ibmlogo_cmyk ---------------------------------------------------------------------------- Tue, 26 Apr 2005 HTMLTEXT enhanced: tags now support urls with "mailto:"
        tag supported, identical to
          tag tag supported, creates strikeout font tag supported, creates subscript font tag supported, creates superscritpt font Font name suffixes for fonts created by HTMLTEXT are as follows (and are added in this order, so bold italic font would have a suffix of "bi"): b Bold i Italic u Underline s Strikeout sub Subscript sup Superscript Simple example: windowsize 800 600 drawclear white set texthtml on text "Hello Strong Emphasis Strikeout SubScript SuperScript" forever ---------------------------------------------------------------------------- Mon, 25 Apr 2005 HTMLTEXT now supports the and tags. ---------------------------------------------------------------------------- Thu, 21 Apr 2005 New command line option, /SET:VARNAME=VALUE,VARNAME=VALUE... works on any EXE build with AfterGRASP. Supports system variables, as well as user variables. Supports ON/OFF/STEP/TRUE/FALSE, just like in compiled scripts. Supports quotes for values with spaces, and to preserve upper/lowercase Values not in quotes are converted to lowercase If no value is given, the default will be whatever is expected by that command. So for instance /set:debug will turn debug on. /SET can be used anywhere on the command line, and will disappear as far as the running script is concerned. The /SET option and values will not be visible in the @COMMANDLINE system variable, or in the initial values of @1, @2, @3, @4 (command line parameters). /SET is limited to 100 variable name/variable value pairs. Any more than that, and the additional /SETs will be ignored (but still removed from the command line). Each set is done in the order written to the command line, any successive set will replace the first set. Numbers, including floating point (but not with exponents) are valid for the value. Expressions (including measurements) and other variables are not supported. So 21in or 5+8 or @fred are invalid values. Sets of user variables are done exactly as if done with the SET script command. You cannot create local, global or common variables with /SET. Examples: testprogram.exe /set:debug, variables, startname="John Bridges" testprogram.exe /set:debug,variables,startname="John Bridges" testprogram.exe /set:debug /set:variables /set:startname="John Bridges" testprogram.exe /set:debug,variables /set:startname="John Bridges" agplay.exe /set:debug=on startup.agc /set:errormessage=off agplay.exe startup.agc /set:errormessage=off agplay.exe /set:errormessage=off startup.agc ---------------------------------------------------------------------------- Tue, 19 Apr 2005 FONTGAPS when used with DRAWOFFSET is fixed. FONTSHADOW, TEXTFIT, TEXTHEIGHT, TEXTLINES now all support measurements (like 50pct, or 2mm) for width/height (X/Y) values. ---------------------------------------------------------------------------- Mon, 18 Apr 2005 WINDOWSIZE and WINDOWPOSITION were forcing a default window to be created, Fixed. ---------------------------------------------------------------------------- Sun, 17 Apr 2005 *WARNING* This build has a very large number of source changes (over 60 source files, hundreds of lines of code modified). Although I've double checked most of the changes, it's quite possible there are new (minor) bugs in this build. For instance in reviewing the code today, I found 6 mistakes I made yesterday. DRAWOFFSET now fully supported by all commands that take coordinates. DRAWOFFSET DRAWOFFSET XOFFSET YOFFSET DRAWOFFSET X1 Y1 X2 Y2 DRAWOFFSET works much like DRAWREGION except all coordinates and percentages are modified relative to the Drawing offset. So for instance: drawoffset 50 100 drawrect 100 100 200 200 would actually draw a rectangle at the real coordinates of 150 200 250 300 DRAWOFFSET now has four parameters allowing you to create a virtual smaller virtual window like this: windowsize 800 600 drawclear white color black textsizetest drawoffset (800-640)/2 (600-480)/2 640size 480size color green textsizetest drawoffset (800-320)/2 (600-240)/2 320size 240size color red textsizetest forever textsizetest: for i from 5 to 13 step 1 winfont "Times" "Times" 0 topercentage(@i) 90 text "Times "$@i$"pct" fontdefine "Times" "Times" 0 topercentage(@i) 90 textln 50pct @textposy "Times "$@i$"pt" next return Virtually all drawing commands now support measurements (I had to made sure all of them use the GetX/GetY coordinate code internally so that DRAWOFFSET would work with all commands). Also any command that takes a size that is not a coordinate, such as the size of a new image buffer, or the radius for a circle uses new code that doesn't offset the value, but does take into account the virtual width (set via the later 2 parameters to DRAWOFFSET). ---------------------------------------------------------------------------- Wed, 13 Apr 2005 IMAGESIZE command now resizes the Image Mask if one was set before using IMAGESIZE. Previously the Image Mask was lost. IMAGESIZE now works on JPEG images loaded with IMAGECOMPRESSED ON (was bug in printer image injection code not using the original image size). ---------------------------------------------------------------------------- Mon, 11 Apr 2005 New system variable: SET IMAGEREGIONMASK ON/OFF ; defaults to ON When putting images to a printer that have an IMAGEMASK, normally a windows region (HRGN) is generated by scanning the IMAGEMASK. But there is a serious buf in some Windows printer drivers when converting the HRGN into a clipping path used on PostScript and some other printers. The Printer Driver will accidently subtract 1 from the upper left hand corner of all the rectangles in a HRGN causing a 1 pixel ring to appear in the left and top of a masked IMAGEPUT. When you SET IMAGEREGIONMASK OFF, the HRGN generating code is bypassed to use code that breaks an image into short segments putup one at a time. This method may produce odd striped artifacts on some output devices so it is not the default. ---------------------------------------------------------------------------- Wed, 06 Apr 2005 IMAGEIMAGEDISTANCE when the images don't overlap is sped up (area calculation is eliminated in more cases). More optimizations to IMAGEIMAGEDISTANCE to reduce the number of redundant point searches. If a point is more distance than the area that surrounds an image, no search is done. IMAGEIMAGEDISTANCE now has an optional parameter, a minimum distance. If given, then the distance calculation is avoided if the crude distance (calculated by the rectanglular area of the image) is larger than the minimum distance. ---------------------------------------------------------------------------- Tue, 05 Apr 2005 All POSITION commands changed to no longer support variable names for the results. You must now use the SETS command to get the results. All POSITION commands now support optional ADDX/ADDY parameters which are values to add to the final position. Useful for sliding objects along the edge of another object while still maintaining the same distance. ADDX and ADDY are floating point values, and can be measurements or percentages as well as plain numbers. SETS XPOS YPOS POSITIONBOXBOX(XPOS1, YPOS1, BOXWIDTH1, BOXHEIGHT1, BOXWIDTH2, BOXHEIGHT2, ANGLE, DISTANCE, ADDX, ADDY) SETS XPOS YPOS POSITIONBOXPOINT(XPOS1, YPOS1, BOXWIDTH, BOXHEIGHT, ANGLE, DISTANCE, ADDX, ADDY) SETS XPOS YPOS POSITIONCIRCLEBOX(XCENT, YCENT, RADIUSX, RADIUSY, BOXWIDTH, BOXHEIGHT, ANGLE, DISTANCE, ADDX, ADDY) SETS XPOS YPOS POSITIONCIRCLECIRCLE(XCENT, YCENT, RADIUSX1, RADIUSY1, RADIUSX2, RADIUSY2, ANGLE, DISTANCE, ADDX, ADDY) SETS XPOS YPOS POSITIONCIRCLEPOINT(XCENT, YCENT, RADIUSX, RADIUSY, ANGLE, DISTANCE, ADDX, ADDY) SETS XPOS YPOS POSITIONIMAGEBOX( IMGXPOS, IMGYPOS, IMAGEBUF, BOXWIDTH, BOXHEIGHT, ANGLE, DISTANCE, ADDX, ADDY) SETS XPOS YPOS POSITIONIMAGECIRCLE( IMGXPOS, IMGYPOS, IMAGEBUF, RADIUSX, RADIUSY, ANGLE, DISTANCE, ADDX, ADDY) SETS XPOS YPOS POSITIONIMAGEIMAGE( IMGXPOS, IMGYPOS, IMAGEBUF1, IMAGEBUF2, ANGLE, DISTANCE, ADDX, ADDY) SETS XPOS YPOS POSITIONIMAGEPOINT( IMGXPOS, IMGYPOS, IMAGEBUF, ANGLE, DISTANCE, ADDX, ADDY) ---------------------------------------------------------------------------- Sun, 03 Apr 2005 New command PRINTINJECT designed for use with PostScript printing, it will inject 1 or more strings into the PostScript stream. Useful for complex PostScript commands (like CMYK drawing). Each string passed has a CR/LF appended to it when written to the postscript stream. Example: drawclear white set mydpi 300 paperwidth = 1200 paperheight = 1200 mmperpixel = @mydpi/254. printsettings dpi @mydpi papersize @paperwidth/@mmperpixel @paperheight/@mmperpixel PDFfilename = "c:\\digi-pdf.pdf" PSfilename = "c:\\digi-pdf.ps" set printfilename @PSfilename printstart printstartpage printset printinject "1 .57 0 .02 setcmykcolor 0 0 300 100 rectfill" printinject "0 0 0 1 setcmykcolor 200 200 500 600 rectfill" imageset printendpage printend appexec "c:\\gs\\gs8.14\\bin\\gswin32c.exe" "-sDEVICE=pdfwrite -q -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.3 -dNOPAUSE -dBATCH -sOutputFile="$@quote$@PDFfilename$@quote$" -c save pop -f "$@quote$@PSfilename$@quote exitnow ---------------------------------------------------------------------------- Thu, 31 Mar 2005 IMAGEPOINTDISTANCE had bugs in it's search for starting point fixed, this also made IMAGEIMAGEDISTANCE and IMAGEIMAGEPOSITION incorrect. IMAGEFINDEDGE is now doubled in speed (was scanning edges twice as far as required). IMAGEFINDEDGE was not working on images that were very wide or tall, fixed. Code inside IMAGEPOINTDISTANCE (used by numerous other functions) fixed to return the correct coordinates when the point is closest on the Y axis. Images with a mask (IMAGEMASKSET, or IMAGETRAN) were not clipping near the edge of the window correctly on Win2000/WinXP machines. A bug in the MaskBlt API call. Calls to MaskBlt have been removed to fix it. Fixed crashing bug in IMAGEFINDEDGE/IMAGEFINDEDGES when the source image has no bitmask (and one in generated with the current TRAN color). All -> operators that work on images are updated to handle images that are part of an array. DRAWOFFSET is now supported, takes X and Y values including measurements, default is 0,0 (no offset). Only commands (so far) which support DRAWOFFSET are: DRAWPOLYGON DRAWPOLYGONFILLED I've been using DRAWOFFSET it to test IMAGEFINDEDGES by using DRAWPOLYGON to show the edges that were found. ---------------------------------------------------------------------------- Mon, 28 Mar 2005 IMAGESET and PRINTSET rewrittten to be nestable up to 64 levels deep. For instance now you can do complex image building operations with IMAGESET from within a block of code that is drawing to a printer with PRINTSET. ---------------------------------------------------------------------------- Wed, 23 Mar 2005 Updated agcmd.dat, agele.dat and agvar.dat to be fully up to date (they are used by AfterGRASP Editor). Finished coding of: DISTANCECIRCLEPOINT DISTANCEBOXPOINT POSITIONIMAGEPOINT POSITIONCIRCLEPOINT POSITIONBOXPOINT Syntax for POINT based DISTANCE and POSITION commands is: SETS RESULTX RESULTY POSITIONBOXPOINT(CENTX CENTY RADIUSX RADIUSY ANGLE DISTANCE) POSITIONBOXPOINT CENTX CENTY RADIUSX RADIUSY ANGLE DISTANCE RESULTX RESULTY RESULT = DISTANCEBOXPOINT(CENTX CENTY RADIUSX RADIUSY XPOS2 YPOS2) SETS RESULTX RESULTY POSITIONCIRCLEPOINT(XPOS1 YPOS1 BOXWIDTH BOXHEIGHT ANGLE DISTANCE) POSITIONCIRCLEPOINT XPOS1 YPOS1 BOXWIDTH BOXHEIGHT ANGLE DISTANCE RESULTX RESULTY RESULT = DISTANCECIRCLEPOINT(XPOS1 YPOS1 BOXWIDTH BOXHEIGHT XPOS2 YPOS2) SETS RESULTX RESULTY POSITIONIMAGEPOINT(IMGXPOS IMGYPOS IMAGE ANGLE DISTANCE) POSITIONIMAGEPOINT IMGXPOS IMGYPOS IMAGE ANGLE DISTANCE RESULTX RESULTY RESULT = DISTANCEIMAGEPOINT(IMGXPOS IMGYPOS IMAGE XPOS YPOS) ---------------------------------------------------------------------------- Tue, 22 Mar 2005 WindowSize limit of no smaller than 32x32 is removed, you can now create a window as small as 1x1. Any size smaller than 1 is changed to 1. 6 New elements for images: ->EdgeAverageX ->EdgeAverageY ->EdgeCenterX ->EdgeCenterY ->EdgeRadiusX ->EdgeRadiusY EDGEAVERAGEX/EDGEAVERAGEY is set by IMAGEFINDEDGES, it's the average of all the edge coordinates, an approximate center point. EDGECENTERX/EDGECENTERY is set by IMAGEFINDEDGE, it's center point of a circle that is closest fit to the edge of the image. EDGERADIUSX/EDGERADIUSY is set by IMAGEFINDEDGE, it's x/y radius of the circle that is the closest fit to the edge of the image. 6 New commands added: DISTANCEIMAGEPOINT DISTANCECIRCLEPOINT DISTANCEBOXPOINT POSITIONIMAGEPOINT POSITIONCIRCLEPOINT POSITIONBOXPOINT All 6 are still under development except DISTANCEIMAGEPOINT which is finished. ---------------------------------------------------------------------------- Thu, 17 Mar 2005 IMAGEFINDEDGE is dramaticly improved for irregular shapes, it finds a much tighter circle. Unfortunately this means it's slower. DISTANCEBOXBOX was giving incorrect results (the square root of the real results). POSITIONBOXBOX was giving often incorrect results because it depends on the code that was incorrect in DISTANCEBOXBOX. DISTANCECIRCLEBOX is now more accurate (measures against box sides, not just corners). DISTANCEIMAGECIRCLE and POSITIONIMAGECIRCLE both coded and working. DISTANCEIMAGEIMAGE and POSITIONIMAGEIMAGE written. Need further testing. DISTANCEIMAGEIMAGE and POSITIONIMAGEIMAGE fall through to worst cases if less edge information is available. So for instance: DISTANCEIMAGEIMAGE only uses full comparison code if IMAGEFINDEDGES was done on both images. Otherise: IMAGEFINDEDGES on one and IMAGEFINDEDGE on the other, it uses DISTANCEIMAGECIRCLE code. IMAGEFINDEDGE on both images, it uses DISTANCECIRCLECIRCLE code. IMAGEFINDEDGE on one image, nothing on the other, it uses DISTANCECIRCLEBOX code. No edge detection done on either image, it uses DISTANCEBOXBOX code. ---------------------------------------------------------------------------- Mon, 14 Mar 2005 IMAGEFINDEDGES has some unusual cases fixed, was ending the edge search early in a deep crevasse. Example I used to detect error: drawclear white imageload bic3.jpg test imageflood test pkgmask top left 4 imagemaskset test pkgmask imagefree pkgmask imagefindedges test color black drawpolygonfilled array(test->edgecounts) test->edges color green drawpolygon array(test->edgecounts) test->edges 2 set textwrap off color black drawregion 50pct 0 100pct 100pct textln @textposx @textposy test->edgecounts forever DRAWPOLYGON and DRAWPOLYGONFILLED now support an optional first parameter that is an array of coordinate counts. This allows drawing multiple polygons with a single command, and helps when using IMAGE->EDGE. For example: drawclear white imagetran on white color red drawcirclefilled 200 200 100 150 drawcirclefilled 400 300 100 150 color white drawcirclefilled 320 250 190 120 imageget test imagefindedges test color black drawpolygonfilled array(test->edgecounts) test->edges color green drawpolygon array(test->edgecounts) test->edges 2 set textwrap off textln 0,0 test->edgecounts forever ---------------------------------------------------------------------------- Sun, 13 Mar 2005 DRAWINSIDE now supports the size suffix. For example: if drawinside(100, 100, 100size, 200size, @xpos, ypos) ... endif Renamed all POSITION and DISTANCE calculation commands to use the prefix POSITION/DISTANCE instead of a suffix: DISTANCECIRCLEBOX DISTANCECIRCLECIRCLE DISTANCEIMAGEBOX POSITIONCIRCLEBOX POSITIONCIRCLECIRCLE POSITIONIMAGEBOX The following are still not finished (under development): POSITIONIMAGECIRCLE POSITIONIMAGEIMAGE DISTANCEIMAGECIRCLE DISTANCEIMAGEIMAGE Five new commands: POSITIONBOXBOX DISTANCEBOXBOX DRAWFITBOX DRAWFITCIRCLE DRAWFITIMAGE Syntax is: SETS RESULTX RESULTY POSITIONBOXBOX(XPOS1 YPOS1 BOXWIDTH1 BOXHEIGHT1 BOXWIDTH2 BOXHEIGHT2 ANGLE DISTANCE) POSITIONBOXBOX XPOS1 YPOS1 BOXWIDTH1 BOXHEIGHT1 BOXWIDTH2 BOXHEIGHT2 ANGLE DISTANCE RESULTX RESULTY RESULT = DISTANCEBOXBOX(XPOS1 YPOS1 BOXWIDTH1 BOXHEIGHT1 XPOS2 YPOS2 BOXWIDTH2 BOXHEIGHT2) RESULT = DRAWFITBOX(X1 Y1 X2 Y2) RESULT = DRAWFITCIRCLE(XCENT YCENT XRADIUS YRADIUS) RESULT = DRAWFITIMAGE(XPOS YPOS IMAGE) AGCMD.DAT updated with renamed commands and new commands. Runable example using DRAWFITBOX, DISTANCEBOXBOX (and other POSITON/DISTANCE commands): windowsize 980 700 drawclear red imagetran on white imageload logo.gif set textwrap off images = array(bic1.jpg, bic2.jpg, bic3.jpg, bic4.jpg, bic5.jpg, bic6.jpg) xposlist = array(0, 400, 0, 400, 0, 400) yposlist = array(150, 150, 350, 350, 550, 550) color white set floatdegrees on for type from 0 to 1 for i from 0 count images->size distlist[@i] = -999999 textlist[@i] = randwordsW(random(1,4),7) widthlist[@i] = textwidth(@textlist[@i]) heightlist[@i] = textheight(@textlist[@i]) imageload @images[@i] imagesize 20pct 20pct @images[@i] imageflood @images[@i] pkgmask top left 4 ; 4 percent off color allowed imageflood @images[@i] pkgmask top right 4 imageflood @images[@i] pkgmask bottom left 4 imageflood @images[@i] pkgmask bottom right 4 imagemaskset @images[@i] pkgmask imagefree pkgmask if @type imagefindedges @images[@i] else imagefindedge @images[@i] endif imageput @xposlist[@i] @yposlist[@i] @images[@i] next for i from 0 count images->size for angle from 5 to 115 step 1 sets xbox ybox positionimagebox(@xposlist[@i] @yposlist[@i] @images[@i] @widthlist[@i] @heightlist[@i] @angle 8) layer test$@i position @xbox @ybox text @textlist[@i] layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3 dist = 99999 drawregion if drawfitbox(@xbox-6, @ybox-6, (@widthlist[@i]+12)size, (@heightlist[@i]+12)size) for j from 0 to @i if @j==@i continue newdist = distanceboxbox(@xboxpos[@j] @yboxpos[@j], @widthlist[@j] @heightlist[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i]) if @dist<0 if @newdist<0 inc dist @newdist endif else if @newdist<@dist dist = @newdist endif endif next for j from 0 count images->size if @j==@i continue newdist = distanceimagebox(@xposlist[@j] @yposlist[@j], @images[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i]) if @dist<0 if @newdist<0 inc dist @newdist endif else if @newdist<@dist dist = @newdist endif endif next if @dist>@distlist[@i] distlist[@i] = @dist bestangle[@i] = @angle endif endif next sets xboxpos[@i] yboxpos[@i] positionimagebox(@xposlist[@i] @yposlist[@i] @images[@i] @widthlist[@i] @heightlist[@i] @bestangle[@i] 8) layer test$@i position @xboxpos[@i] @yboxpos[@i] next delay 200 next wait exitnow randwordsW: declare linecount wordcount lines = "" for @linecount words = "" for random(4,@wordcount) word = strchr(random(0,25)+strasc("A")) for random(0,8) word = @word$strchr(random(0,25)+strasc("a")) next words = @words$@word$" " next lines = @lines$@words$@crlf next return @lines ---------------------------------------------------------------------------- Thu, 10 Mar 2005 Removed all REGION code for calculating whether a point is inside an image scanned with IMAGEFINDEDGES. Now generates a mask image instead. Turns out Windows REGION code is quite slow and memory hungry, so it had to be removed. This also fixes the numerous problems with the overlap percentage code in IMAGEBOXPOSITION that were causing it to always return 0 for the overlap percentage. Created new crawling tables for IMAGEFINDEDGES to fix problems with irregular edges. In IMAGEFINDEDGES replaced code which keeps track of what areas have been scaned with slower list based code. This fixes problems with images that have sharp points, and narrow sections (1 pixel wide). New code to search for pixel distance against IMAGEFINDEDGES, uses sorted X/Y lists of edge points. Will be used in IMAGEIMAGEPOSITION and IMAGEIMAGEDISTANCE (not yet written). ---------------------------------------------------------------------------- Tue, 08 Mar 2005 IMAGEBOXPOSITION/IMAGEBOXDISTANCE are drasticly sped up, around 50x faster than yesterday's build. They now calculate based on line segments rather than single pixels. Also the monte carlo style percentage of overlap code in IMAGEBOXDISTANCE is much smarter, and doesn't try the test if there is absolutely no overlap. If IMAGEBOXPOSTION and IMAGEBOXDISTANCE are used with IMAGEFINDEDGE instead of IMAGEFINDEDGES, the CIRCLEBOXPOSITION and CIRCLEBOXDISTANCE code is used. This allows either the circle scan method or exact edge method to be used by just changing the single call to IMAGEFINDEDGE/IMAGEFINDEDGES. Runable example that uses both styles of edge following: windowsize 900 700 drawclear red imagetran on white imageload logo.gif set textwrap off images = array(logo.gif, logo.gif, logo.gif, logo.gif, logo.gif, logo.gif) xposlist = array(0, 400, 0, 400, 0, 400) yposlist = array(150, 150, 350, 350, 550, 550) color white set floatdegrees on for type from 0 to 1 for i from 0 count images->size distlist[@i] = -999999 textlist[@i] = randwordsW(random(1,4)) widthlist[@i] = textwidth(@textlist[@i]) heightlist[@i] = textheight(@textlist[@i]) if @type imagefindedges @images[@i] else imagefindedge @images[@i] endif imageput @xposlist[@i] @yposlist[@i] @images[@i] next for angle from 15 to 115 step 1 for i from 0 count images->size sets xbox ybox imageboxposition(@xposlist[@i] @yposlist[@i] @images[@i] @widthlist[@i] @heightlist[@i] @angle 8) layer test$@i position @xbox @ybox text @textlist[@i] layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3 dist = 99999 for j from 0 count images->size if @j==@i continue newdist = imageboxdistance(@xposlist[@j] @yposlist[@j], @images[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i]) if @dist<0 if @newdist<0 inc dist @newdist endif else if @newdist<@dist dist = @newdist endif endif next if @distlist[@i]<@dist distlist[@i] = @dist bestangle[@i] = @angle endif next next for i from 0 count images->size sets xbox ybox imageboxposition(@xposlist[@i] @yposlist[@i] @images[@i] @widthlist[@i] @heightlist[@i] @bestangle[@i] 8) layer test$@i position @xbox @ybox next next wait exitnow randwordsW: declare linecount lines = "" for @linecount words = "" for random(4,7) word = strchr(random(0,25)+strasc("A")) for random(0,6) word = @word$strchr(random(0,25)+strasc("a")) next words = @words$@word$" " next lines = @lines$@words$@crlf next return @lines ---------------------------------------------------------------------------- Mon, 07 Mar 2005 Several filled drawing functions were off by one pixel (or less) on the right hand side of the shape being drawn. This includes: DRAWPOLYGONFILLED DRAWCIRCLEFILLED DRAWRECTROUND DRAWANTIPOLYGONFILLED DRAWANTICIRCLEFILLED DRAWANTIRECTROUND All fixed. IMAGEFINDEDGES now handles images that touch the edges (was crashing and generating incorrect coordinates). IMAGEFINDEDGES now scans all four sides of the image for start points to search from. IMAGEFINDEDGES now stores an average of all edgepoints to be used as a center point in IMAGEBOXPOSITION, IMAGECIRCLEPOSITION and IMAGEIMAGEPOSITION. IMAGEFINDEDGE now stores the centerpoint and radius X/Y in the imagebuffer for future use. IMAGEBOXPOSITION and IMAGEBOXDISTANCE both in place and working. This first version of IMAGEBOXPOSITION is extremely slow (EXTREMELY!) ---------------------------------------------------------------------------- Thu, 03 Mar 2005 LAYER HIDE when a layer contains a RECT, BOX, BOXROUND or RECTROUND is fixed (it wasn't hiding). LAYER TEXT when used LAYER RECT or other drawing commands would have the right hand edge of the text shifted, left or right depending on the start point of the drawing command. Fixed. New commands: IMAGEFINDEDGES IMAGEBUF Searches an image's mask to create a list of edge coordinates for each region of the image. Accepts one or more images. Will add an imagemask if none is defined. IMAGE->EDGES Provides a list of coordinates for all the images found within an image after using the IMAGEFINDEDGES command IMAGE->EDGECOUNTS Provides a list of counts, the number of coordinates for each area in an image after using IMAGEFINDEDGES. On simple images (one with only a single area) this is a single number that is the number of coordinate pairs returned by IMAGE->EDGES. Simple example: drawclear white imagetran on white color red drawcirclefilled 200 200 100 150 color blue drawcirclefilled 320 250 190 120 color green drawcirclefilled 520 350 110 120 imageget test imagefindedges test color black drawpolygonfilled test->edges textln test->edgecounts forever The PRINTENDPAGE command now puts a small for non-commercial use message at the corners of a page (much like the message that is displayed at the end of an application). New commands still under development (not working yet): IMAGECIRCLEDISTANCE IMAGECIRCLEPOSITION IMAGEBOXDISTANCE IMAGEBOXPOSITION IMAGEIMAGEDISTANCE IMAGEIMAGEPOSITION DISTANCE = IMAGECIRCLEDISTANCE(XPOS, YPOS, IMAGEBUF, XCENT, YCENT, XRADIUS, YRADIUS) SETS XPOS YPOS IMAGECIRCLEPOSITION(XPOS, YPOS, IMAGEBUF, XCENT, YCENT, XRADIUS, YRADIUS, ANGLE DISTANCE) IMAGECIRCLEPOSITION XPOS YPOS IMAGEBUF XCENT YCENT XRADIUS YRADIUS ANGLE DISTANCE XRESULT YRESULT DISTANCE = IMAGEBOXDISTANCE(XPOS, YPOS, IMAGEBUF, X1, Y1, X2, Y2) SETS XPOS YPOS IMAGEBOXPOSITION(XPOS, YPOS, IMAGEBUF, X1, Y1, X2, Y2, ANGLE DISTANCE) IMAGEBOXPOSITION XPOS YPOS IMAGEBUF X1 Y1 X2 Y2 ANGLE DISTANCE XRESULT YRESULT DISTANCE = IMAGEIMAGEDISTANCE(XPOS1, YPOS1, IMAGEBUF1, XPOS2, YPOS2, IMAGEBUF712) SETS XPOS YPOS IMAGEIMAGEPOSITION(XPOS1, YPOS1, IMAGEBUF1, XPOS2, YPOS2, IMAGEBUF2, ANGLE DISTANCE) IMAGEIMAGEPOSITION XPOS1 YPOS1 IMAGEBUF1 XPOS2 YPOS2 IMAGEBUF2 ANGLE DISTANCE XRESULT YRESULT ---------------------------------------------------------------------------- Thu, 24 Feb 2005 Small compiler changes for IMAGEFLIPX IMAGEFLIPY and DRAWBOXROUND, to remove redundant handling of return values (none of those commands ever return anything). DRAWCLIPX and DRAWCLIPY commands are now supported. New suffix operators function much like pts, mm, and other suffix operators. pixels same as pixelsx pixelsx value in pixels relative to X axis pixelsy value in pixels relative to Y axis size value added to previous X/Y axis value All have functions that can be called to get the same result: toPIXELS(N) same as Npixels toPIXELSX(N) same as Npixelsx toPIXELSY(N) same as Npixelsy toSIZE(N) same as Nsize Examples: drawregion 100 100 200size 150size imageput 10pct 20pct test (20pct)size (30pct)size xpos = (10pct)pixelsx ypos = (20pct)pixelsy Commands which support toSIZE: drawantibox drawantiboxround drawantiline drawantipolygon drawantipolygonfilled drawantirect drawantirectround drawbox drawboxround drawline drawpolygon drawpolygonfilled drawrect drawrectround drawregion imageput imagealphaset For commands which accept multiple coordinates (drawline, drawpolygon, and so on), each coordinateis relative to the previous coordinate. So for instance: drawline 0 0 50size 50size -20size -50size Is the same as drawline 0 0 149 149 130 100 Bug in text display and formatting when a drawregion is too small to fit even a single character was causing a hang. Fixed. Fixed serious memory bug when reading string system variables that are given a new value such as: set glprodirectory "Hello" text @glprodirectory text @glprodirectory text @glprodirectory text @glprodirectory scriptlink pdfgen ---------------------------------------------------------------------------- Sun, 20 Feb 2005 IMAGEPUT with a Masked image has all new code to not use MASKBLT on non-memory accessable devices (like printers). If possible (if the printer supports it), it uses complex regions to simulate the mask, otherwise it breaks the bitmap into little pieces to similate the masked IMAGEPUT. The REGION based code for IMAGEPUT masked is quite slow, but produces the highest quality results with the smallest output filesize (when dealing with PostScript or PDF). Working example of printing with a masked image: drawclear white set mydpi 300 ; how many pixels per 1/10th of a MM mmperpixel = @mydpi/254. paperwidth = 1200 paperheight = 1200 printsettings dpi @mydpi papersize @paperwidth/@mmperpixel @paperheight/@mmperpixel PDFfilename = "c:\\digi-pdf.pdf" PSfilename = "c:\\digi-pdf.ps" set printfilename @PSfilename imagetran on white imagenew masktest @paperwidth @paperheight imageset masktest drawclear white color yellow fontdefine arial 150 text "1234567890" imageset imagetran off printstart printstartpage printset color blue drawboxround 0 0 @drawmaxx @drawmaxy 9pct color black drawboxround 10pct 10pct @drawmaxx-10pct @drawmaxy-10pct 9pct color red drawboxround 20pct 20pct @drawmaxx-20pct @drawmaxy-20pct 9pct color green drawboxround 30pct 30pct @drawmaxx-30pct @drawmaxy-30pct 9pct imageput masktest imageflipx masktest imageflipy masktest imageput masktest imageset printendpage printend appexec "c:\\gs\\gs8.14\\bin\\gswin32c.exe" "-sDEVICE=pdfwrite -q -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.3 -dNOPAUSE -dBATCH -sOutputFile="$@quote$@PDFfilename$@quote$" -c save pop -f "$@quote$@PSfilename$@quote exitnow ---------------------------------------------------------------------------- Thu, 17 Feb 2005 PM In CIRCLEBOXDISTANCE when the circle and box are intersecting or overlapping the result is no longer a distance (in previous build it was a negative distance). It is now a negative floating point percentage of how much of the box overlaps the circle. The percentage is an approximation done with a montecarlo random sampling (500 points), so results will be slightly different on repeated calls. If comparing the overlap against multiple circles, I recommend adding the negative percentages together rather than using the lowest (most overlap). For example, from the placement of text example modified to add the negative percentages together: for angle from 5 to 105 step 1 for i from 0 count images->size sets xbox ybox circleboxposition(@xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @angle 8) layer test$@i position @xbox @ybox text @textlist[@i] layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3 dist = 99999 for j from 0 count images->size if @j==@i continue newdist = circleboxdistance(@xcentlist[@j], @ycentlist[@j], @xradlist[@j], @yradlist[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i]) if @dist<0 if @newdist<0 inc dist @newdist endif else if @newdist<@dist dist = @newdist endif endif next if @distlist[@i]<@dist distlist[@i] = @dist bestangle[@i] = @angle endif next next See where it adds newdist to dist if the previous dist is negative. ---------------------------------------------------------------------------- Thu, 17 Feb 2005 AM Four new commands for dealing with functions that return multiple values: SETS LOCALS GLOBALS COMMONS Syntax is: SETS VARNAME1 [VARNAME2 ...] VALUE1 [VALUE2 ...] LOCALS VARNAME1 [VARNAME2 ...] VALUE1 [VALUE2 ...] GLOBALS VARNAME1 [VARNAME2 ...] VALUE1 [VALUE2 ...] COMMONS VARNAME1 [VARNAME2 ...] VALUE1 [VALUE2 ...] Each functions like the non-plural named version (LOCALS creates local variables, GLOBALS creates global variables, and so on). But instead of the variable name/values being interleaved, varname, value, varname, value, varname, value. The variable names are passed first, then the values. Syntax Example: drawclear white sets w x y 5 6 7 sets a b c d examplesub(3) sets i j k @d*@w+@a @d*@x+@b @d*@y+@c set variables on wait exitnow examplesub: declare mul return 1*@mul 2*@mul 3*@mul 4*@mul IMAGEPUT now returns the final coordinates where an image was placed. Example: locals xpos ypos imageput(center, center, testimage.gif) Working example using CIRCLEBOXPOSITION and SETS: windowsize 900 700 drawclear red imagetran on white imageload logo.gif set textwrap off images = array(logo.gif, logo.gif, logo.gif, logo.gif, logo.gif, logo.gif) xposlist = array(0, 400, 0, 400, 0, 400) yposlist = array(150, 150, 350, 350, 550, 550) color white set floatdegrees on for i from 0 count images->size distlist[@i] = -999999 textlist[@i] = randwords(random(1,4)) widthlist[@i] = textwidth(@textlist[@i]) heightlist[@i] = textheight(@textlist[@i]) imagefindedge @images[@i] xpos ypos xrad yrad xcentlist[@i] = @xpos+@xposlist[@i] ycentlist[@i] = @ypos+@yposlist[@i] xradlist[@i] = @xrad yradlist[@i] = @yrad imageput @xposlist[@i] @yposlist[@i] @images[@i] drawcircle @xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] 2 next for angle from 5 to 105 step 1 for i from 0 count images->size sets xbox ybox circleboxposition(@xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @angle 8) layer test$@i position @xbox @ybox text @textlist[@i] layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3 dist = 99999 for j from 0 count images->size if @j==@i continue newdist = circleboxdistance(@xcentlist[@j], @ycentlist[@j], @xradlist[@j], @yradlist[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i]) if @newdist<@dist dist = @newdist endif next if @distlist[@i]<@dist distlist[@i] = @dist bestangle[@i] = @angle endif next next for i from 0 count images->size sets xbox ybox circleboxposition(@xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @bestangle[@i] 8) layer test$@i position @xbox @ybox next wait exitnow ---------------------------------------------------------------------------- Wed, 16 Feb 2005 HOTSPOT was dropping the roll over layer when you clicked on a hotspot. Now it leaves it up until the mouse leaves the hotspot area. CIRCLEBOXDISTANCE fixed, was giving the wrong answer half the time. CIRCLEBOXDISTANCE how gives a negative value if the box overlaps the circle. CIRCLEBOXPOSITION and CIRCLECIRCLEPOSITION now base the angle on 0 being the top of the circle, 90 being the right hand side, 180 being the bottom, and 270 being the left hand side. Updated runable example using CIRCLEBOXPOSITION, CIRCLEBOXDISTANCE and IMAGEFINDEDGE windowsize 900 700 drawclear red imagetran on white imageload logo.gif set textwrap off images = array(logo.gif, logo.gif, logo.gif, logo.gif, logo.gif, logo.gif) xposlist = array(0, 400, 0, 400, 0, 400) yposlist = array(150, 150, 350, 350, 550, 550) color white set floatdegrees on for i from 0 count images->size distlist[@i] = -999999 textlist[@i] = randwords(random(1,4)) widthlist[@i] = textwidth(@textlist[@i]) heightlist[@i] = textheight(@textlist[@i]) imagefindedge @images[@i] xpos ypos xrad yrad xcentlist[@i] = @xpos+@xposlist[@i] ycentlist[@i] = @ypos+@yposlist[@i] xradlist[@i] = @xrad yradlist[@i] = @yrad imageput @xposlist[@i] @yposlist[@i] @images[@i] drawcircle @xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] 2 next for angle from 5 to 105 step 1 for i from 0 count images->size circleboxposition @xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @angle 8 xbox ybox layer test$@i position @xbox @ybox text @textlist[@i] layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3 dist = 99999 for j from 0 count images->size if @j==@i continue newdist = circleboxdistance(@xcentlist[@j], @ycentlist[@j], @xradlist[@j], @yradlist[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i]) if @newdist<@dist dist = @newdist endif next if @distlist[@i]<@dist distlist[@i] = @dist bestangle[@i] = @angle endif next next for i from 0 count images->size circleboxposition @xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @bestangle[@i] 8 xbox ybox layer test$@i position @xbox @ybox next wait exitnow ---------------------------------------------------------------------------- Tue, 15 Feb 2005 VECANGLE now accepts floating point values, previously it rounded all values down to integer before doing the vector angle calculation. Four new math oriented commands, all oriented twords calculations done with circles (tied in with yesterdays IMAGEFINDEDGE command). Together, you can use them to evenly place images and text, shifting the position of text near an image to a different start point that is furthest away from other images. CIRCLECIRCLEDISTANCE finds the distance between the edge of two circles. You pass it the center point, and X/Y radius for two circles. RESULT = CIRCLECIRCLEDISTANCE(XCENT1, YCENT1, XRADIUS1, YRADIUS1, XCENT2, YCENT2, XRADIUS2, YRADIUS2) CIRCLEBOXDISTANCE finds the distance from the edge of a circle to whichever corner of a box that is closest. It determines the edge point on the circle based on the angle between the closest box corner and the center of the circle, so the distance may not be exactly as expected. RESULT = CIRCLEBOXDISTANCE(XCENT, YCENT, RADIUSX, RADIUSY, XPOS, YPOS, BOXWIDTH, BOXHEIGHT) CIRCLECIRCLEPOSITION calculates the center point for a circle that is touching the edge of the circle who's center and radius are passed. CIRCLECIRCLEPOSITION XCENT YCENT RADIUSX1 RADIUSY1 RADIUSX2 RADIUSY2 ANGLE DISTANCE RESULTX RESULTY RESULT = ARRAY(CIRCLECIRCLEPOSITION(XCENT, YCENT, RADIUSX1, RADIUSY1, RADIUSX2, RADIUSY2, ANGLE, DISTANCE)) CIRCLEBOXPOSITION calculates the upper left hand corner of a box that is touching the edge of the circle who's center and radius are passed. The angle is at what point ont he circle's edge the box is to touch, and the distance is how far from the circles edge to place the box (0 would be touching, -1 would be one pixel inside, 1 would be one pixel outside the circle). CIRCLEBOXPOSITION XCENT YCENT RADIUSX RADIUSY BOXWIDTH BOXHEIGHT ANGLE DISTANCE RESULTX RESULTY RESULT = ARRAY(CIRCLEBOXPOSITION(XCENT, YCENT, RADIUSX, RADIUSY, BOXWIDTH, BOXHEIGHT, ANGLE, DISTANCE)) You can call CIRCLEBOXPOSITION/CIRCLECIRCLEPOSITION as a command passing it the two variable names for the resulting X and Y coordinates. Or call it as a function which returns two values. Because of the difficulty in dealing with functions with multiple return values, you normally would use CIRCLEBOXPOSITION as a command (not function). Example of CIRCLEBOXPOSITION used with IMAGEFINDEDGE: drawclear red imagetran on white imageload logo.gif example imageput 300 300 example color white imagefindedge example xpos ypos xrad yrad inc xpos 300 inc ypos 300 drawcircle @xpos @ypos @xrad @yrad 3 set textwrap off teststr = "Hello there my name is fuddle, be buddle, and we wuddle as we muddle under the puddle that is tuddle." boxwidth = textwidth(@teststr) boxheight = textheight(@teststr) set floatdegrees on color green layer testing text @teststr layer testing box -3 -3 @boxwidth+2 @boxheight+2 3 for angle from 0 to 360 step .02 circleboxposition @xpos @ypos @xrad @yrad @boxwidth @boxheight @angle 0 xbox ybox layer testing position @xbox @ybox next forever ---------------------------------------------------------------------------- Mon, 14 Feb 2005 Images with a mask (set by IMAGESETMASK) now uses MaskBlt whenever possible (basicly not on Win9x). This gives better results when printing masked images, and is slightly faster in general. New command IMAGEFINDEDGE searches for a circular edge using the Image Mask. If an image is passed to it with no mask, then the color from pixel location 0,0 is used to create a temporary mask (all pixels of that color are set to true within the mask). ImageFindEdge returns the center position, x radius and y radius of an oval. RESULTS = ARRAY(IMAGEFINDEDGE(IMAGEBUF)) IMAGEFINDEDGE IMAGEBUF XPOSVAR YPOSVAR RADIUSVAR IMAGEFINDEDGE IMAGEBUF XPOSVAR YPOSVAR XRADIUSVAR YRADIUSVAR Working example: drawclear red imagetran on white imageload logo.gif example imageput 100 100 example color green color white imagefindedge example xpos ypos xrad yrad drawcircle @xpos+100 @ypos+100 @xrad @yrad 3 imagefindedge example xpos ypos rad color yellow drawcircle @xpos+100 @ypos+100 @rad @rad 3 forever IMAGEFINDEDGE is included in AGCMD.DAT (used by editor). ---------------------------------------------------------------------------- Wed, 09 Feb 2005 IMAGEFLOODSEARCH more than tripled in speed, the extra searches were removed (no 2nd pass), and the bit testing for previously checked areas is now optimized inline. Sytnax for IMAGEFLOODSEARCH corrected to not include reference to EDGECOLOR which is not supported for IMAGEFLOODSEARCH. New code to allow IMAGESETMASK images to be placed onto a printed page. Previously this could not work because AND/XOR to a printer HDC is now allowed by windows (you cannot do any graphic operation that need to "read" or interact with the printer background). The new code scans the image mask and breaks the IMAGEPUT into multiple puts, one for each horizontal line segment. Very complex masked images (like a page of japanese text for instance) will require a LARGE number of Windows BitBlt calls to be written the printer which some printers may not handle. But on simple images like a picture of a cookie (biscuit) that just need to be printed over a complex background, it works fine. ---------------------------------------------------------------------------- Mon, 07 Feb 2005 Some serious overflow and calculation bugs in ImageScaling code when drasticly scaling down (less than 16th the size) are fixed. New command IMAGEFLOODSEARCH, syntax is similar to IMAGEFLOOD except there is an optional radius and percent match within radius parameters. AGCMD.DAT is updated so editor knows about new command. RADIUS is how large an area to search for when trying to identify other regions to mask. If no radius is given then a radius of 4 pixels is assumed. SPERCENT is the search's match percentage, the default is 0 RESULTIMAGE = IMAGEFLOODSEARCH(SOURCEIMAGE) RESULTIMAGE = IMAGEFLOODSEARCH(SOURCEIMAGE,XPOS,YPOS) RESULTIMAGE = IMAGEFLOODSEARCH(SOURCEIMAGE,XPOS,YPOS,PERCENT) RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SOURCEIMAGE) RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SOURCEIMAGE,XPOS,YPOS) RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SOURCEIMAGE,XPOS,YPOS,PERCENT) RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SPERCENT,SOURCEIMAGE) RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SPERCENT,SOURCEIMAGE,XPOS,YPOS) RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SPERCENT,SOURCEIMAGE,XPOS,YPOS,PERCENT) IMAGEFLOODSEARCH SOURCEIMAGE MASKIMAGENAME IMAGEFLOODSEARCH SOURCEIMAGE MASKIMAGENAME XPOS YPOS IMAGEFLOODSEARCH SOURCEIMAGE MASKIMAGENAME XPOS YPOS PERCENT IMAGEFLOODSEARCH RADIUS SOURCEIMAGE MASKIMAGENAME IMAGEFLOODSEARCH RADIUS SOURCEIMAGE MASKIMAGENAME XPOS YPOS IMAGEFLOODSEARCH RADIUS SOURCEIMAGE MASKIMAGENAME XPOS YPOS PERCENT IMAGEFLOODSEARCH RADIUS SPERCENT SOURCEIMAGE MASKIMAGENAME IMAGEFLOODSEARCH RADIUS SPERCENT SOURCEIMAGE MASKIMAGENAME XPOS YPOS IMAGEFLOODSEARCH RADIUS SPERCENT SOURCEIMAGE MASKIMAGENAME XPOS YPOS PERCENT Working example that shows the limits of IMAGEFLOOD, and how IMAGEFLOODSEARCH gets around these limits: basesize = 400 windowsize @basesize*2 @basesize drawclear green imagenew milk 1000 1000 imageset milk drawclear white xpos = 120 ypos = 120 lastxpos = 120 lastypos = 120 beginloop 20 if @xpos>100||@ypos>100 color random(0,255,3) drawanticirclefilled @xpos @ypos 80 drawantiline @xpos @ypos @lastxpos @lastypos 10 endif lastxpos = @xpos lastypos = @ypos inc xpos (random(60)-30)*15 inc ypos (random(60)-30)*15 if @xpos<0 inc xpos @drawmaxx endif if @xpos>@drawmaxx dec xpos @drawmaxx endif if @ypos<0 inc ypos @drawmaxy endif if @ypos>@drawmaxy dec ypos @drawmaxy endif endloop color white drawrect 0 0 10 10 imageset imagecopy smilk milk imageflood milk milkmask 0 0 4 ; 4 percent off color allowed imageprocess milkmask invert imagesize @basesize 0 8 milkmask imagesize @basesize 0 milk imagealphaset milk milkmask imageput milk imagefloodsearch 2 0 smilk smilkmask 0 0 4 ; 4 percent off color allowed imageprocess smilkmask invert imagesize @basesize 0 8 smilkmask imagesize @basesize 0 smilk imagealphaset smilk smilkmask imageput @basesize 0 smilk forever ---------------------------------------------------------------------------- Sun, 30 Jan 2005 Bug found in Microsoft CopyImage() API call which truncates color values. All calls to CopyImage() are removed and replaced with custom scaling code. Some scaling operations may be slower. ---------------------------------------------------------------------------- Thu, 27 Jan 2005 Rebuilt using Visual Studio 6 SP6 (was previously using SP5). STRLEFTHTML STRRIGHTHTML STRLEFTRIGHTHTML and STRMIDHTML all had a memory leak, the first tag it found was never free'd up when the function was exited. Bug in STR*HTML functions which caused duplicate end tags to be generated when the first tag was used again is fixed. STRLEFTRIGHTHTML was giving incorrect results when the position was at the end of the source string. Fixed. Some odd bugs in TEXTFIT when dealing with word wrapping, and html tags are fixed. ---------------------------------------------------------------------------- Tue, 18 Jan 2005 TEXTFIT command implemented, syntax is: CHARPOS = TEXTFIT(STRING) CHARPOS = TEXTFIT(STRING, WIDTH) CHARPOS = TEXTFIT(STRING, WIDTH, HEIGHT) CHARPOS = TEXTFIT(STRING, WIDTH, HEIGHT, FIRSTCHAR) STRTRIM STRTRIMLEFT and STRTRIMRIGHT commands now trim whitespace, not just spaces. Whitespace includes ascii 32 (space), 9 (tab), 10 (linefeed), 13 (carriage return), 0 (null), and 26 (end of file). New unirary '&' operator (which calls the new VARREFERENCE command), used with a variable name it will provide a variable's low level reference. On simple variables like strings or numbers, this is virtually identical to the '@' operator. But with arrays and other complex objects, it allows passing of arrays by reference. Previously, the only way to pass an array was to copy it into another array, which was slow and wasteful, and did not work on multi-dimensional arrays. Example: drawclear white color black a = array(one,array(aa,bb,cc),three,four) testfunc @a ;displays just 'one' testfunc array(@a) ;displays the entire array, but slow and wasteful ; looses 2nd dimension in array testfunc &a ;displays the entire array forever testfunc: declare value text @value text @value[1][2] text @value[1][1] text @value[1][0] textln return FILEPUTARRAYNAMED fixed to correctly write the array in the same order as the named index. For example, this array read with FILEGETARRAYNAMED: page,type,x1,y1,x2,y2 1,text,20,0,98,24 1,text,20,25,98,49 1,text,20,50,98,74 1,text,20,75,98,99 Was being written by FILEPUTARRAYNAMED as: page,type,x1,y1,x2,y2 text,24,98,0,20,1 text,49,98,25,20,1 text,74,98,50,20,1 text,99,98,75,20,1 Now it matches the original file, written in the same order. ---------------------------------------------------------------------------- Thu, 13 Jan 2005 PNG support upgraded to libpng version 1.2.8, but unfortunately there are still problems with PNG loaded (CRC errors on IEND, still baffled as to the cause). GPF crash in FILEGETVARS fixed (bug was introduced in Mon Jan 10 build). Extra checks added to ItemSimplify (used to simplify strings into numbers if the formatting matches) to prevent crash in future. Bug in compiling of loops with a FROM and COUNT, the step would have an invalid value instead of 1. Fixed. IMAGEFADEXY was loosing the Y coordinate in many cases, fixed. Test script for IMAGEFADEXY: drawclear white set texthtml on text "" f = array( imagenew(320 240 32 red) imagenew(320 240 32 green) imagenew(320 240 32 blue) imagenew(320 240 32 yellow) imagenew(320 240 32 cyan) ) xpos = array(center left right) ypos = array(center top bottom) fn = 0 beginloop for x from 0 count xpos->size for y from 0 count ypos->size layer blah text @xpos[@x]$" "$@ypos[@y] imagefadexy @fn%8+1 @xpos[@x] @ypos[@y] @f[@fn%f->size] 150 inc fn next next endloop forever ---------------------------------------------------------------------------- Mon, 10 Jan 2005 TEXTLN when TEXTHTML is enabled and then disabled was not working, it would try to display "
          " when HTML text was disabled. The reverse was also true. If TEXTLN was used before TEXTHTML was enabled, then the correct line breaks would never be displayed when HTML text was enabled. Fixed. Copyright dates moved to 2005. Fade coordinates, such as in the IMAGEFADEXY command now support measurements, as well as top/left/right/bottom/center. Extensive new error checking added to almost all commands preventing accidental use of parameters not passed, or other mistakes. Almost all references to STACK (usually parameters passed back and forth), are now done with code macros that do extra checks to prevent invalid access. New commands added: STRLEFTHTML STRLEFTRIGHTHTML STRMIDHTML STRRIGHTHTML Exact same syntax as STRLEFT, STRLEFTRIGHT, STRMID and STRRIGHT. Strings extracted have tags corrected. So any open tags are closed, and any tags with only closing tag have the leading tag added. Here is a working test example: drawclear white color black set textwrap off set texthtml on teststrhtml textln set texthtml off teststrhtml forever teststrhtml: set teststr = "Hello There Test Subject" textln @teststr textln strlefthtml(@teststr, strsearch(@teststr, "There")-1)$" Left" textln strleftrighthtml(@teststr, strsearch(@teststr, "There")+3)$" Right" textln strmidhtml(@teststr, strsearch(@teststr, "Test"), 4)$" Mid" return ---------------------------------------------------------------------------- Thu, 16 Dec 2004 Under calculation bug in VECANGLE which also affected IMAGEROTATE/IMAGEANTIROTATE (would squish smaller images) is fixed. IMAGEANTIROTATE IMAGEROATE, IMAGEANTIWARP and IMAGEWARP now calculate the coordinates in floating point, and will accept floating point coordinate values. IMAGEANTIROTATE and IMAGEANTIWARP now use a sliding scale for the amount of anti-aliasing to use. It uses a 4x anti-alias (the previous default) for most images, but will increase it to 8x for images with under 800 total pixels, and 16x for images with under 400 total pixels. The CD-ROM Detection variables are now supported: @DRIVECDROM @DRIVECDROMS The SOUNDBEEP command now beeps (single simple beep). Small memory leak when closing files is fixed. Bug in auto searching for .GZ file extension when opening files is fixed. Four new system variables: @MOUSEDOWNX1 @MOUSEDOWNX2 @MOUSEUPX1 @MOUSEUPX2 These provide the mouse click information on the extended Intellimouse buttons (the eXtended Button1 and eXtended Button 2). The Intellipoint end user application software, if installed, may prevent these buttons from working (it let's them be assigned to other tasks). Six new WHEN types: WHEN MOUSEDOWNX1 WHEN MOUSEDOWNX2 WHEN MOUSEUPX1 WHEN MOUSEUPX2 WHEN MOUSEWHEELDOWN WHEN MOUSEWHEELUP Example: windowsize 1024 768 drawclear white color black imageload p6.emf imagesize 1024 0 p6 -2 -2 imageput p6 chunkx = 300 chunky = 175 antimul = 2 zoom = 3 when micezoomup mousewheelup zoom = @zoom*1.1 UpdateZoom soundbeep endwhen when micezoomdown mousewheeldown zoom = @zoom/1.1 UpdateZoom soundbeep endwhen when micemove mousemove gosub UpdateZoom UpdateZoom forever UpdateZoom: mouseget b xpos ypos dec xpos @chunkx/2 dec ypos @chunky/2 imagepiece piece @zoom @antimul center center p6 @xpos @ypos @chunkx @chunky imageprocess piece tint 10 blue imageset piece color white drawbox 0 0 @drawmaxx @drawmaxy 2 imageset layer hello @xpos @ypos image piece filter 68 return The WHEN MOUSEWHEELUP and WHEN MOUSEWHEENDOWN still have a bug that makes them respond poorly when a WHEN MOUSEMOUSE is also active (I'm still working on debugging this odd problem). ---------------------------------------------------------------------------- Sun, 12 Dec 2004 A couple problems with previous builds Modular support fixed (mostly some extra OBJ files left in place). Database support code needed to change a open file from read-only or write-only to read/write put in place. ---------------------------------------------------------------------------- Thu, 09 Dec 2004 New command IMAGEPIECE: IMAGEPIECE NEWIMAGE SRCIMAGE IMAGEPIECE NEWIMAGE SRCIMAGE STARTX STARTY IMAGEPIECE NEWIMAGE SRCIMAGE STARTX STARTY XSIZE YSIZE IMAGEPIECE NEWIMAGE SRCIMAGE STARTX STARTY XSIZE YSIZE VIRTXSIZE VIRTYSIZE IMAGEPIECE NEWIMAGE ZOOM SRCIMAGE IMAGEPIECE NEWIMAGE ZOOM SRCIMAGE STARTX STARTY IMAGEPIECE NEWIMAGE ZOOM SRCIMAGE STARTX STARTY XSIZE YSIZE IMAGEPIECE NEWIMAGE ZOOM SRCIMAGE STARTX STARTY XSIZE YSIZE VIRTXSIZE VIRTYSIZE IMAGEPIECE NEWIMAGE ZOOM ANTIMUL SRCIMAGE IMAGEPIECE NEWIMAGE ZOOM ANTIMUL SRCIMAGE STARTX STARTY IMAGEPIECE NEWIMAGE ZOOM ANTIMUL SRCIMAGE STARTX STARTY XSIZE YSIZE IMAGEPIECE NEWIMAGE ZOOM ANTIMUL SRCIMAGE STARTX STARTY XSIZE YSIZE VIRTXSIZE VIRTYSIZE IMAGEPIECE NEWIMAGE ZOOM ANTIMUL XOFFSET YOFFSET SRCIMAGE IMAGEPIECE NEWIMAGE ZOOM ANTIMUL XOFFSET YOFFSET SRCIMAGE STARTX STARTY IMAGEPIECE NEWIMAGE ZOOM ANTIMUL XOFFSET YOFFSET SRCIMAGE STARTX STARTY XSIZE YSIZE IMAGEPIECE NEWIMAGE ZOOM ANTIMUL XOFFSET YOFFSET SRCIMAGE STARTX STARTY XSIZE YSIZE VIRTXSIZE VIRTYSIZE NEWIMAGE is the image to create (which is a piece of SRCIMAGE) SRCIMAGE is the source image ZOOM is the zoom level (how much the source image is enlarged before taking out a hunk) (defaults to 1) ANTIMUL is the anti-alias multiply, only for vector images (defaults to 1) XOFFSET,YOFFSET are the offset to adjust the startx and starty from, supports LEFT/CENTER/RIGHT TOP/CENTER/BOTTOM as well as numeric coordinates. (defaults to 0,0) STARTX, STARTY is the upper left hand corner of the area to extract as a piece. XSIZE YSIZE is the width and height of the area to extract. VIRTXSIZE, VIRTYSIZE is the virtual size of the SRCIMAGE, the image is blown up to this size before extracting the piece. Useful particularly for vector images. Options for VIRTXSIZE and VIRTYSIZE are the same as for the IMAGESIZE command (if negative the original size is multiplied by the absolute value, if 0 then adjusted to the same ratio as the other axis is scaled). Working example: windowsize 1024 768 drawclear white imageload p6.emf imagesize 1024 0 p6 -2 -2 imageput p6 chunkx = 300 chunky = 175 antimul = 2 zoom = 3 beginloop mouseget b xpos ypos dec xpos @chunkx/2 dec ypos @chunky/2 imagepiece piece @zoom @antimul center center p6 @xpos @ypos @chunkx @chunky imageprocess piece tint 10 blue imageset piece color white drawbox 0 0 @drawmaxx @drawmaxy 2 imageset layer hello @xpos @ypos image piece filter 68 endloop ---------------------------------------------------------------------------- Mon, 06 Dec 2004 Anything beyond the 2nd parameter passed to the AG runtime was being lost (the code which looks for a script filename was trimming the original command line string inside windows!). Fixed. New modular compile OPTION DATABASE Most database commands now active (requires testing), same syntax as GLPRO. I've tried to replicate most of the functionality, but there is no DOS ASCII support. Writing to database still needs some debugging (changing from reading to read/write isn't working). ---------------------------------------------------------------------------- Tue, 30 Nov 2004 The FILEPUTVARIABLES command now supports arrays. For example: drawclear white a[2] = goodbye a[99] = frank a[1] = hello a[blue] = green fileputvariables(test.txt,a) global filegetvariables(test.txt) set variables on exitnow Produces a file with this contents: a[1] = hello a[2] = goodbye a[99] = frank a[blue] = green The FILEGETVARIABLES command now supports arrays, including multi-dimensional arrays. Added two hotkeys always active: SHIFT-CTRL-V toggles the Variables window SHIFT-CTRL-D toggles the Debug window I used SHIFT-CTRL because ALT is so closely tied to being the "System" key. I didn't want it to be shift or ctrl alone because it might be hit accidently. The VARIABLES display can now be opened and closed repeatedly. Previously there was a bug which prevented it from ever being opened again once it had been closed. ---------------------------------------------------------------------------- Mon, 29 Nov 2004 IMAGEEMFSCRIPT now writes images used in SETDIBITSTODEVICE and STRETCHDIBITS EMF records to disk as BMP files (in original format directly from the EMF record). The commands to load/display these images are not correctly generated yet (next build). The images are written as EMF_Image0.bmp EMF_Image1.bmp and so on. Support added for limted version of the tag in HTML text. Only the tag is recognized, other tags are seen, but ignored. Useful for maintaining exact indent levels in HTML text, for example the word "Folks" here lines up exactly on both lines of text. drawclear white set texthtml on text "" textln "Hello There Folks" textln "Hello There Folks" forever When the visibility hidden tag is used, the text is not drawn at all but the text position is advanced as if it was. ---------------------------------------------------------------------------- Wed, 24 Nov 2004 Color was incorrect (Red and Green reversed) in these commands: WinCreateBrushIndirect WinCreatePenIndirect WinExtCreatePen WinExtFloodFill WinSetBkColor WinSetPixelV WinSetTextColor IMAGEEMFSCRIPT no longer generates TRANSFORM commands, it precalculates final coordinates and sizes in floating point. This includes: WinSetWorldTransform WinModifyWorldTransform WinSetWindowExtEx WinSetWindowOrgEx WinSetViewportExtEx WinSetViewportOrgEx Some coordinates are reversed sometimes, but the results are fairly impressive (it actually works!). IMAGEEMFSCRIPT now uses the size set with IMAGESIZE (or if no IMAGESIZE was used, the default image's size) for the coordinates generated. IMAGEEMFSCRIPT now uses a temporary HDC for all transforms, this prevents wierd errors, and resource leaks that were happening. IMAGEEMFSCRIPT now calculates the font heights, and pen sizes based on the final EMF size (they used to be fixed). IMAGEEMFSCRIPT now outputs all integer coordinates as integer, their final value is calculated in floating point, but the result written to the script is rounded to the nearest integer value. Unforunately, although improved, the IMAGEEMFPERCENT option does not produce correctly displaying scripts. (some problems in how AG supports the PCT operator is the likely culprit). ---------------------------------------------------------------------------- Mon, 22 Nov 2004 IMAGEEMFTEXT fixed so that the output from FILEPUTARRAYNAMED correctly lines up with the columns. IMAGEEMFTEXT will now combine text that is adjacent in the same color, font, height and style. It will not combine text across lines (wrapped text). If adjacent text does not include spaces, spaces will be added. Be careful using the FileClose command on anything but a filestream, if you use it on objects (pictures, strings, fonts), it will try to remove them from memory, and cause odd things if you were using them. ---------------------------------------------------------------------------- Sun, 21 Nov 2004 IMAGECOPY if passed a single parameter returns a copy of an image. One example of this usage: imageset imagecopy(pointer) color red drawline 0 0 @drawmaxx @drawmaxy result = imageset() IMAGEANTIROTATE was not correctly moving the image position to maintain the same position as with IMAGEROTATE. IMAGENEW now sets the current drawcolor inside an image to whatever color the image was cleared to. So for instance: drawclear black color red imagenew test 100 100 imageset test imagenew blah 100 100 imageset imageput blah ; displays a red box, used to be white forever Previously, it always defaulted to WHITE. Another example that creates an rotated alphamask: x = 0 for R from -45 step 45 count 3 color black imageset imagenew(pointer->sizex pointer->sizey) imageantirotate pointer @R imagealphaset pointerW1 imageset() layer l1 70 34 image pointerW1 imagefadexy 36 @x 0 go$@loop 100 200 inc x 97 next Numerous fixes to XFORM usage, unfortunately some EMF's still do not play correctly after translation via IMAGEEMFSCRIPT. WinPolyPolygon was not being correctly generated by IMAGEEMFSCRIPT (it was calling WinPolyPolyLine). WinExtTextOut now has the X/Y/TYPE parameters as optional, if all three are left out, they are assumed to be zero. ---------------------------------------------------------------------------- Mon, 08 Nov 2004 New AGEDIT from Dick which fixes the buffer overflow problem created by the sudden and dramatic increase in the number of commands. The WinModifyWorldTransform syntax has changed, it's now: WINMODIFYWORLDTRANSFORM MODE XFORMARRAY The IMAGEEMFSCRIPT command no longer generates a blank entry for XFORMARRAY "array()" in the WinModifyWorldTransform. So for instance to reset the transform to default (no transform), it would generate: WINMODIFYWORLDTRANSFORM 1 "WINSETWORLDTRANSFORM array()" no longer needs the empty array, works fine as just "WINSETWORLDTRANSFORM" with no parameters. IMAGEEMFSCRIPT now eliminates duplicate WinSetTextColor, WinSetBkColor, WinSetTextAlign, WinSetBkMode, WinSelectObject statements. IMAGEEMFSCRIPT now combines font definitions so each font is only defined once, and free'd at the end of the script. Bug in generation of XFORM arrays which left out values in the middle (which confused the code which needed to parse the array) is fixed. ---------------------------------------------------------------------------- Sun, 07 Nov 2004 First EMF Script that plays entirely! Fixed bugs in IMAGEFADE BLEND, the number of steps did not correctly include the final step. The number of steps in a blend fade is always a power of 2 since the blend calculation is done with shifts, but the number of steps did not include both the first null step used to calculate fade speed, and the final step. Bug first reported by Dick Trump on Aug 11, 2004, with a follow-up including example on Oct 18, 2004. Documentation note, the PRINTSETTINGS PAPERSIZE option has it's width and height swapped when the PRINTSETTINGS LANDSCAPE option used (this is how window's processes it, I'm not swapping the values). The @SCRIPTNAME variable is now supported. New setable system variable @IMAGEEMFTEXTWIDTHS controls whether the IMAGEEMFSCRIPT command generates the list of character widths for each ExtTextOut command. These values are often wrong for different resolutions, and counter productive. The default is OFF. You may need to turn this ON to get accurate spacing for unusual fonts or pre-kerned text. The IMAGEEMFPERCENT variable now defaults to OFF. More work to replace the WorldTransform with pre-transformed coordinates will be required before pct type coordinates will work with scripts generated by IMAGEEMFSCRIPT. This work will also be required to make EMF scripts run on Win9x since the WorldTransform functions are not available in Win9x. ---------------------------------------------------------------------------- Thu, 04 Nov 2004 PRINTPAPERSIZE command removed. New PRINTSETTINGS option, PAPERSIZE, size is in units of 1/10th of a millimeter. Example which creates a PDF (expects default printer driver to be a Postscript driver setup to write to a file). drawclear white set mydpi 300 ; how many pixels per 1/10th of a MM mmperpixel = @mydpi/254. paperwidth = 1200 paperheight = 1200 printsettings dpi @mydpi papersize @paperwidth/@mmperpixel @paperheight/@mmperpixel PDFfilename = "c:\\digi-pdf.pdf" PSfilename = "c:\\digi-pdf.ps" set printfilename @PSfilename printstart printstartpage printset color blue drawboxround 0 0 @drawmaxx @drawmaxy 9pct color black drawboxround 10pct 10pct @drawmaxx-10pct @drawmaxy-10pct 9pct color red drawboxround 20pct 20pct @drawmaxx-20pct @drawmaxy-20pct 9pct color green drawboxround 30pct 30pct @drawmaxx-30pct @drawmaxy-30pct 9pct imageset printendpage printend appexec "c:\\gs\\gs8.14\\bin\\gswin32c.exe" "-sDEVICE=pdfwrite -q -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.3 -dNOPAUSE -dBATCH -sOutputFile="$@quote$@PDFfilename$@quote$" -c save pop -f "$@quote$@PSfilename$@quote exitnow ---------------------------------------------------------------------------- Wed, 03 Nov 2004 New command PRINTPAPERSIZE, used much like the PRINTSETTINGS command. Takes two parameters, the page width, and page height, both in units of 1/10th of a millimeter. Test EMF script generated with IMAGEEMFSCRIPT actually runs! Text is ok, drawn art is mysteriously missing, but it's a start. IMAGEEMFPERCENT ON does not produce a script that will work (requires changes to all the XFORM data in transformation commands). WinGetStockObject now accepts NULL_BRUSH (instead of HOLLOW_BRUSH), and NULL_PEN. Fraction lookup for IMAGEEMFSCRIPT now handles negative numbers, and numbers larger than 1. For instance 1.33333 will get written as 4/3. Support for suffix operators (like pct or mm) is no longer valid with a space inbetween. So 100pct is fine, but 100 pct is not. This is to help clean up some wierd cases in the expression parser, like: text(100 100 pct) Bug in parsing of negative numbers passed to a function fixed. For instance: drawclear white color black hello(5 -1) forever hello: textln @1 return This should have displayed 5, but was displaying 4 (5-1). If you wish to subtract, you can write hello(5-1) or hello(5 - 1), both of which will pass 4 to the hello function. This also applies to more complex cases like: hello(5 -@rate) hello(@rate*@base -1) hello(@rate -(5+@rate)) All these cases are now fixed. ---------------------------------------------------------------------------- Mon, 01 Nov 2004 Hanging bug in TextWidth (and in LAYER TEXT) when any NULL characters are at the end of a string is fixed. The QUALITY option in IMAGESAVEJPEG if larger than 1024 is instead treated as a maximum filesize. The JPEG is written over and over until a file is created as close as possible to the desired size (but not over that size). The maximum number of writes is 8, so this may take 8x longer than IMAGESAVEJPEG normally would. Numerous crashing bugs on more complex EMFs fixed. Several performance system wide performance improvements made (allocated buffers no longer zero'd out twice, or at all if they are going to be immediately overwritten). More error checking added to array management. New system variable SET IMAGEEMFPERCENT ON/OFF. Defaults to ON. Controls the writing of coorindates in the IMAGEEMFSCRIPT command. When ON, all coordinates are written as a percentage (accurate to 4 decimal places). Started percentage coordinate generation in IMAGEEMFSCRIPT, all lists of points, and rects are done as percentage (when IMAGEEMFPERCENT ON). Some assorted fixes in IMAGEEMFSCRIPT (missing spaces) Fractions are auto generated for common numbers between 0 and 1 if the fraction is shorter than the number with all decimal places. WinRestoreDC with no parameters defaults to -1 (the most common use). "XFORMARRAY" can now be 0, 2, 4 or 6 six floating point numbers that define an XFORM transformation structure for GDI: Array() same as Array(1 1) Array(M11 M22) Array(M11 M22 Dx Dy) Array(M11 M12 M21 M22 Dx Dy) ---------------------------------------------------------------------------- Mon, 18 Oct 2004 Added a zillion new commands, most are direct mappings of Windows API calls required to playback scripts generated by IMAGEEMFSCRIPT. The HDC (device context handle) passed in all these GDI API calls is the current draw buffer's HDC (normally the window frame unless IMAGESET or PRINTSET are in effect). Remaining tasks on the EMF Script project include: 1. BitBlt Script Generation and Commands 2. Script Generation using Percentage for Coordinates 3. Script optimization (removing redundant commands) Data types used for some more complex parameters: "PALETTEARRAY" is an array of DWORD values for a palette: Array(DWORDPalEntry DWORDPalEntry ...) http://www.google.com/search?&q=msdn+library+gdi+PALETTEENTRY&btnI=I'm+Feeling+Lucky "RECTARRAY" is an array of four integers that define a rectangular area: Array(left top right bottom) http://www.google.com/search?&q=msdn+library+gdi+RECT&btnI=I'm+Feeling+Lucky "XFORMARRAY" is an array of six floating point numbers that define a XFORM transformation structure for GDI: Array(M11 M12 M21 M22 Dx Dy) http://www.google.com/search?&q=msdn+library+gdi+XFORM&btnI=I'm+Feeling+Lucky "BITMAPARRAY" is an array with these items, only the palette is optional: Array(Width Height Planes BitCount Compression SizeImage XPelsPerMeter YPelsPerMeter ClrUsed ClrImportant Usage [PALETTEARRAY] ImageDataString) http://www.google.com/search?&q=msdn+library+gdi+BITMAPINFO&btnI=I'm+Feeling+Lucky "REGIONARRAY" is a group of arrays that define a region: Array(Type RECTARRAY RECTARRAY ...) http://www.google.com/search?&q=msdn+library+gdi+RGNDATA&btnI=I'm+Feeling+Lucky "POINTSARRAY" is a list of coordinate pairs: Array(X,Y X,Y X,Y X,Y X,Y ...) http://www.google.com/search?&q=msdn+library+gdi+tagPOINT&btnI=I'm+Feeling+Lucky List of commands with parameters, those with '*' are complete, others are under development. Those with () take no parameters. The URL listed under each command brings up the Microsoft MSDN help for that API call. Items in brackets are optional, for instance the bounding rectangle used for WinExtTextOut. * WinAbortPath () http://www.google.com/search?&q=msdn+library+gdi+AbortPath&btnI=I'm+Feeling+Lucky * WinAngleArc X Y Radius StartAngle SweetAngle http://www.google.com/search?&q=msdn+library+gdi+AngleArc&btnI=I'm+Feeling+Lucky * WinArc LeftRect TopRect RightRect BottomRect XStartArc YStartArc XEndArc YEndArc http://www.google.com/search?&q=msdn+library+gdi+Arc&btnI=I'm+Feeling+Lucky * WinArcTo LeftRect TopRect RightRect BottomRect XRadial1 YRadial1 XRadial2 YRadial2 http://www.google.com/search?&q=msdn+library+gdi+ArcTo&btnI=I'm+Feeling+Lucky * WinBeginPath () http://www.google.com/search?&q=msdn+library+gdi+BeginPath&btnI=I'm+Feeling+Lucky WinBitBlt http://www.google.com/search?&q=msdn+library+gdi+BitBlt&btnI=I'm+Feeling+Lucky * WinChord LeftRect TopRect RightRect BottomRect XRadial1 YRadial1 XRadial2 YRadial2 http://www.google.com/search?&q=msdn+library+gdi+Chord&btnI=I'm+Feeling+Lucky * WinCloseFigure () http://www.google.com/search?&q=msdn+library+gdi+CloseFigure&btnI=I'm+Feeling+Lucky * HBRUSH = WinCreateBrushIndirect Style Color Hatch http://www.google.com/search?&q=msdn+library+gdi+CreateBrushIndirect&btnI=I'm+Feeling+Lucky * HBRUSH = WinCreateDIBPatternBrushPt PackedDIB Usage http://www.google.com/search?&q=msdn+library+gdi+CreateDIBPatternBrushPt&btnI=I'm+Feeling+Lucky * HFONT = WinCreateFontIndirect Height Width Escapement Orientation Weight Italic Underline StrikeOut CharSet OutPrecision ClipPrecision Quality PitchAndFamily FaceName http://www.google.com/search?&q=msdn+library+gdi+CreateFontIndirect&btnI=I'm+Feeling+Lucky * HPALETTE = WinCreatePalette(Version PALETTEARRAY) http://www.google.com/search?&q=msdn+library+gdi+CreatePalette&btnI=I'm+Feeling+Lucky * HBRUSH = WinCreatePatternBrush(BITMAPARRAY) http://www.google.com/search?&q=msdn+library+gdi+CreatePatternBrush&btnI=I'm+Feeling+Lucky * HPEN = WinCreatePenIndirect Style WidthX WidthY Color http://www.google.com/search?&q=msdn+library+gdi+CreatePenIndirect&btnI=I'm+Feeling+Lucky * WinDeleteObject hObject http://www.google.com/search?&q=msdn+library+gdi+DeleteObject&btnI=I'm+Feeling+Lucky * WinEllipse LeftRect TopRect RightRect BottomRect http://www.google.com/search?&q=msdn+library+gdi+Ellipse&btnI=I'm+Feeling+Lucky * WinEndPath () http://www.google.com/search?&q=msdn+library+gdi+EndPath&btnI=I'm+Feeling+Lucky * WinExcludeClipRect LeftRect TopRect RightRect BottomRect http://www.google.com/search?&q=msdn+library+gdi+ExcludeClipRect&btnI=I'm+Feeling+Lucky * HPEN = WinExtCreatePen PenStyle Width Style Color Hatch [Array(Style Style ...)] http://www.google.com/search?&q=msdn+library+gdi+ExtCreatePen&btnI=I'm+Feeling+Lucky * WinExtFloodFill XStart YStart Color FillType http://www.google.com/search?&q=msdn+library+gdi+ExtFloodFill&btnI=I'm+Feeling+Lucky * WinExtSelectClipRgn REGIONARRAY Mode http://www.google.com/search?&q=msdn+library+gdi+ExtSelectClipRgn&btnI=I'm+Feeling+Lucky * WinExtTextOut X Y Options [RECTARRAY] String [Array(Dx Dx ...)] http://www.google.com/search?&q=msdn+library+gdi+ExtTextOut&btnI=I'm+Feeling+Lucky * WinFillPath () http://www.google.com/search?&q=msdn+library+gdi+FillPath&btnI=I'm+Feeling+Lucky * WinFillRgn REGIONARRAY Brush http://www.google.com/search?&q=msdn+library+gdi+FillRgn&btnI=I'm+Feeling+Lucky * WinFlattenPath () http://www.google.com/search?&q=msdn+library+gdi+FlattenPath&btnI=I'm+Feeling+Lucky * WinFrameRgn REGIONARRAY Brush Width Height http://www.google.com/search?&q=msdn+library+gdi+FrameRgn&btnI=I'm+Feeling+Lucky * WinGetStockObject ObjectID http://www.google.com/search?&q=msdn+library+gdi+GetStockObject&btnI=I'm+Feeling+Lucky Possible ObjectIDs for WinGetStockObject ANSI_FIXED_FONT ANSI_VAR_FONT BLACK_BRUSH BLACK_PEN DEFAULT_GUI_FONT DEFAULT_PALETTE DEVICE_DEFAULT_FONT DKGRAY_BRUSH GRAY_BRUSH HOLLOW_BRUSH LTGRAY_BRUSH OEM_FIXED_FONT SYSTEM_FIXED_FONT SYSTEM_FONT WHITE_BRUSH WHITE_PEN * WinIntersectClipRect LeftRect TopRect RightRect BottomRect http://www.google.com/search?&q=msdn+library+gdi+IntersectClipRect&btnI=I'm+Feeling+Lucky * WinInvertRgn REGIONARRAY http://www.google.com/search?&q=msdn+library+gdi+InvertRgn&btnI=I'm+Feeling+Lucky * WinLineTo XEnd YEnd http://www.google.com/search?&q=msdn+library+gdi+LineTo&btnI=I'm+Feeling+Lucky WinMaskBlt http://www.google.com/search?&q=msdn+library+gdi+MaskBlt&btnI=I'm+Feeling+Lucky * WinModifyWorldTransform XFORMARRAY Mode http://www.google.com/search?&q=msdn+library+gdi+ModifyWorldTransform&btnI=I'm+Feeling+Lucky * WinMoveToEx X Y http://www.google.com/search?&q=msdn+library+gdi+MoveToEx&btnI=I'm+Feeling+Lucky * WinOffsetClipRgn XOffset YOffset http://www.google.com/search?&q=msdn+library+gdi+OffsetClipRgn&btnI=I'm+Feeling+Lucky * WinPaintRgn REGIONARRAY http://www.google.com/search?&q=msdn+library+gdi+PaintRgn&btnI=I'm+Feeling+Lucky * WinPie LeftRect TopRect RightRect BottomRect XRadial1 YRadial1 XRadial2 YRadial2 http://www.google.com/search?&q=msdn+library+gdi+Pie&btnI=I'm+Feeling+Lucky * WinPolyBezier POINTSARRAY http://www.google.com/search?&q=msdn+library+gdi+PolyBezier&btnI=I'm+Feeling+Lucky * WinPolyBezierTo POINTSARRAY http://www.google.com/search?&q=msdn+library+gdi+PolyBezierTo&btnI=I'm+Feeling+Lucky * WinPolyDraw POINTSARRAY Array(Type Type Type ...) http://www.google.com/search?&q=msdn+library+gdi+PolyDraw&btnI=I'm+Feeling+Lucky * WinPolygon POINTSARRAY http://www.google.com/search?&q=msdn+library+gdi+Polygon&btnI=I'm+Feeling+Lucky * WinPolyline POINTSARRAY http://www.google.com/search?&q=msdn+library+gdi+Polyline&btnI=I'm+Feeling+Lucky * WinPolylineTo POINTSARRAY http://www.google.com/search?&q=msdn+library+gdi+PolylineTo&btnI=I'm+Feeling+Lucky * WinPolyPolygon POINTSARRAY Array(Count Count Count ...) http://www.google.com/search?&q=msdn+library+gdi+PolyPolygon&btnI=I'm+Feeling+Lucky * WinPolyPolyline POINTSARRAY Array(Count Count Count ...) http://www.google.com/search?&q=msdn+library+gdi+PolyPolyline&btnI=I'm+Feeling+Lucky WinPolyTextOut http://www.google.com/search?&q=msdn+library+gdi+PolyTextOut&btnI=I'm+Feeling+Lucky * WinRealizePalette () http://www.google.com/search?&q=msdn+library+gdi+RealizePalette&btnI=I'm+Feeling+Lucky * WinRectangle LeftRect TopRect RightRect BottomRect http://www.google.com/search?&q=msdn+library+gdi+Rectangle&btnI=I'm+Feeling+Lucky * WinResizePalette hpal Entries http://www.google.com/search?&q=msdn+library+gdi+ResizePalette&btnI=I'm+Feeling+Lucky * WinRestoreDC SavedDC http://www.google.com/search?&q=msdn+library+gdi+RestoreDC&btnI=I'm+Feeling+Lucky * WinRoundRect LeftRect TopRect RightRect BottomRect Width Height http://www.google.com/search?&q=msdn+library+gdi+RoundRect&btnI=I'm+Feeling+Lucky * WinSaveDC () http://www.google.com/search?&q=msdn+library+gdi+SaveDC&btnI=I'm+Feeling+Lucky * WinScaleViewportExtEx Xnum Xdenom Ynum Ydenom http://www.google.com/search?&q=msdn+library+gdi+ScaleViewportExtEx&btnI=I'm+Feeling+Lucky * WinScaleWindowExtEx Xnum Xdenom Ynum Ydenom http://www.google.com/search?&q=msdn+library+gdi+ScaleWindowExtEx&btnI=I'm+Feeling+Lucky * WinSelectClipPath Mode http://www.google.com/search?&q=msdn+library+gdi+SelectClipPath&btnI=I'm+Feeling+Lucky * HGDIOBJ = WinSelectObject(Object) http://www.google.com/search?&q=msdn+library+gdi+SelectObjec&btnI=I'm+Feeling+Lucky * HPALETTE = WinSelectPalette(hpal ForceBackground) http://www.google.com/search?&q=msdn+library+gdi+SelectPalett&btnI=I'm+Feeling+Lucky * WinSetArcDirection ArcDirection http://www.google.com/search?&q=msdn+library+gdi+SetArcDirection&btnI=I'm+Feeling+Lucky * WinSetBkColor Color http://www.google.com/search?&q=msdn+library+gdi+SetBkColor&btnI=I'm+Feeling+Lucky * WinSetBkMode iBkMode http://www.google.com/search?&q=msdn+library+gdi+SetBkMode&btnI=I'm+Feeling+Lucky * WinSetBrushOrgEx XOrg YOrg http://www.google.com/search?&q=msdn+library+gdi+SetBrushOrgEx&btnI=I'm+Feeling+Lucky * WinSetColorAdjustment Flags IlluminantIndex RedGamma GreenGamma BlueGamma ReferenceBlack ReferenceWhite Contrast Brightness Colorfulness RedGreenTint http://www.google.com/search?&q=msdn+library+gdi+SetColorAdjustment&btnI=I'm+Feeling+Lucky WinSetDIBitsToDevice http://www.google.com/search?&q=msdn+library+gdi+SetDIBitsToDevice&btnI=I'm+Feeling+Lucky * WinSetMapMode MapMode http://www.google.com/search?&q=msdn+library+gdi+SetMapMode&btnI=I'm+Feeling+Lucky * WinSetMapperFlags Flag http://www.google.com/search?&q=msdn+library+gdi+SetMapperFlags&btnI=I'm+Feeling+Lucky * WinSetMetaRgn () http://www.google.com/search?&q=msdn+library+gdi+SetMetaRgn&btnI=I'm+Feeling+Lucky * WinSetMiterLimit NewLimit http://www.google.com/search?&q=msdn+library+gdi+SetMiterLimit&btnI=I'm+Feeling+Lucky * WinSetPaletteEntries hpal iStart PALETTEARRAY http://www.google.com/search?&q=msdn+library+gdi+SetPaletteEntries&btnI=I'm+Feeling+Lucky * WinSetPixelFormat Version Flags PixelType ColorBits RedBits RedShift GreenBits GreenShift BlueBits BlueShift AlphaBits AlphaShift AccumBits AccumRedBits AccumGreenBits AccumBlueBits AccumAlphaBits DepthBits StencilBits AuxBuffers LayerType Reserved LayerMask VisibleMask DamageMask http://www.google.com/search?&q=msdn+library+gdi+SetPixelFormat&btnI=I'm+Feeling+Lucky * WinSetPixelV X Y Color http://www.google.com/search?&q=msdn+library+gdi+SetPixelV&btnI=I'm+Feeling+Lucky * WinSetPolyFillMode PolyFillMode http://www.google.com/search?&q=msdn+library+gdi+SetPolyFillMode&btnI=I'm+Feeling+Lucky * WinSetROP2 DrawMode http://www.google.com/search?&q=msdn+library+gdi+SetROP2&btnI=I'm+Feeling+Lucky * WinSetStretchBltMode StretchMode http://www.google.com/search?&q=msdn+library+gdi+SetStretchBltMode&btnI=I'm+Feeling+Lucky * WinSetTextAlign Mode http://www.google.com/search?&q=msdn+library+gdi+SetTextAlign&btnI=I'm+Feeling+Lucky * WinSetTextColor Color http://www.google.com/search?&q=msdn+library+gdi+SetTextColor&btnI=I'm+Feeling+Lucky * WinSetViewportExtEx XExtent YExtent http://www.google.com/search?&q=msdn+library+gdi+SetViewportExtEx&btnI=I'm+Feeling+Lucky * WinSetViewportOrgEx X Y http://www.google.com/search?&q=msdn+library+gdi+SetViewportOrgEx&btnI=I'm+Feeling+Lucky * WinSetWindowExtEx XExtent YExtent http://www.google.com/search?&q=msdn+library+gdi+SetWindowExtEx&btnI=I'm+Feeling+Lucky * WinSetWindowOrgEx X Y http://www.google.com/search?&q=msdn+library+gdi+SetWindowOrgEx&btnI=I'm+Feeling+Lucky * WinSetWorldTransform XFORMARRAY http://www.google.com/search?&q=msdn+library+gdi+SetWorldTransform&btnI=I'm+Feeling+Lucky WinStretchBlt http://www.google.com/search?&q=msdn+library+gdi+StretchBlt&btnI=I'm+Feeling+Lucky WinStretchDIBits http://www.google.com/search?&q=msdn+library+gdi+StretchDIBits&btnI=I'm+Feeling+Lucky * WinStrokeAndFillPath () http://www.google.com/search?&q=msdn+library+gdi+StrokeAndFillPath&btnI=I'm+Feeling+Lucky * WinStrokePath () http://www.google.com/search?&q=msdn+library+gdi+StrokePath&btnI=I'm+Feeling+Lucky * WinWidenPath () http://www.google.com/search?&q=msdn+library+gdi+WidenPath&btnI=I'm+Feeling+Lucky ---------------------------------------------------------------------------- Tue, 04 Oct 2004 Measurements now support multiply, for instance: imagesize 50pct*(600/72.) 50pct*(600/72.) faded.jpg New commands: LISTSORT LISTUNIQUE LISTDUPLICATED LISTNOTDUPLICATED All of these commands sort the input list. LISTSORT only sorts LISTSORT(2,9,3,7,8,2,3,5,1,3,9,3,4,7) returns 1,2,2,3,3,3,3,4,5,7,7,8,9,9 LISTUNIQUE sorts, then returns only the unique values (no extra duplicates) LISTUNIQUE(2,9,3,7,8,2,3,5,1,3,9,3,4,7) returns 1,2,3,4,5,7,8,9 LISTDUPLICATED sorts, then returns only values that are duplicated. LISTDUPLICATED(2,9,3,7,8,2,3,5,1,3,9,3,4,7) returns 2,3,7,9 LISTNOTDUPLICATED sorts, then removed all duplicates (the reverse of LISTDUPLICATED). LISTNOTDUPLICATED(2,9,3,7,8,2,3,5,1,3,9,3,4,7) returns 1,4,5,8 Runable example: drawclear white color black textln "LISTSORT" text strlist(LISTSORT(2,9,3,7,8,2,3,5,1,3,9,3,4,7)) text strlist(1,2,2,3,3,3,3,4,5,7,7,8,9,9) textln textln "LISTUNIQUE" text strlist(LISTUNIQUE(2,9,3,7,8,2,3,5,1,3,9,3,4,7)) text strlist(1,2,3,4,5,7,8,9) textln textln "LISTDUPLICATED" text strlist(LISTDUPLICATED(2,9,3,7,8,2,3,5,1,3,9,3,4,7)) text strlist(2,3,7,9) textln textln "LISTNOTDUPLICATED" text strlist(LISTNOTDUPLICATED(2,9,3,7,8,2,3,5,1,3,9,3,4,7)) text strlist(1,4,5,8) forever All these can be used with arraya, and the ARRAY() command to merge lists like this: drawclear white color black imageload emailrbcore.emf t test = imageemftext(t) resulta = arraysearch(test,font,arial) resultb = arraysearch(test,bold,fontstyle) result = array(listduplicate(@resulta,@resultb)) Result is then a list of all items that use fontstyle bold and font arial. New system variable @TEXTKERNSIZE, controls the size of kerning. Can be a measurement (based on X axis), like 1pt, or 0.333pct. Defaults to 1 (1 pixel). FONTGAPS now supports measurements for any values. The intercharacter gap and space gap are based on X axis, the vertical spacing gap is based on the Y axis. ---------------------------------------------------------------------------- Thu, 30 Sep 2004 New commands for searching, and extracting results from arrays (for use with FILEGETARRAYNAMED, FILEPUTARRAYNAMED, IMAGEEMFTEXT and other array commands). RESULT = ARRAYSEARCH(ARRAY,SEARCHVALUE) RESULT = ARRAYSEARCH(ARRAY,SEARCHVALUE,FIELD) RESULT = ARRAYSEARCH(ARRAY,SEARCHVALUE,RECORDLIST) RESULT = ARRAYSEARCH(ARRAY,SEARCHVALUE,FIELD,RECORDLIST) RESULT = ARRAYSEARCHNOT(ARRAY,SEARCHVALUE) RESULT = ARRAYSEARCHNOT(ARRAY,SEARCHVALUE,FIELD) RESULT = ARRAYSEARCHNOT(ARRAY,SEARCHVALUE,RECORDLIST) RESULT = ARRAYSEARCHNOT(ARRAY,SEARCHVALUE,FIELD,RECORDLIST) ARRAY is the array to search. SEARCHVALUE is a number of string, wildcards using '*' and '?' are valid. Comparisons are done case insensitive. FIELD is the optional field index for two dimensional arrays. In named arrays this can be a string, in simple numeric arrays it would be an integer. RECORDLIST is optional, and is one or more record numbers, either seperate values or an array used as the list of which records to search. RESULT = ARRAYEXTRACT(ARRAY,RECORDNUMS,RECORDNUMS...) RESULT = ARRAYEXCEPT(ARRAY,RECORDNUMS,RECORDNUMS...) ARRAY is the array to use as the source for extraction. RECORDNUM is one or more record numbers, either seperate values or an array used as the list of which records to extract (exclude). For example: john[0] = fred john[1] = red john[2] = green john[3] = blue david = arrayextract(john,1,2) ; david is now an array with two elements [1] and [2] bleh = arrayexcept(john,2) ; bleh is now an array with 3 elements [0] [1] and [3] Example using search: drawclear white color black imageload emailrbcore.emf t test = imageemftext(t) result = arraysearch(test,bold,fontstyle) items = arrayextract(test,@result) for j in strlist(arrayindex(items)) textln @textposx @textposy @items[@j][text]$" "$@items[@j][fontstyle] next forever ---------------------------------------------------------------------------- Wed, 29 Sep 2004 Array creating in IMAGEEMFTEXT fixed to correctly index all fields (they were not correctly indexed in yesterday's build, you had to save the array and then load it to get the correct results). The weight, italic and underline fields are replaced with a fontstyle field. possible values in fontstyle field are: "" "italic" "underline" "italic underline" "thin" "thin italic" "thin underline" "thin italic underline" "extralight" "extralight italic" "extralight underline" "extralight italic underline" "light" "light italic" "light underline" "light italic underline" "medium" "medium italic" "medium underline" "medium italic underline" "semibold" "semibold italic" "semibold underline" "semibold italic underline" "bold" "bold italic" "bold underline" "bold italic underline" "extrabold" "extrabold italic" "extrabold underline" "extrabold italic underline" "heavy" "heavy italic" "heavy underline" "heavy italic underline" The alignment field is dropped. Example with these changes: text,x,y,font,height,color,fontstyle Any other,2.819,1.665,Arial,0.052,0, marketing,2.815,1.726,Arial,0.052,0, collateral can,2.785,1.793,Arial,0.052,0, be produced,2.792,1.854,Arial,0.052,0, Emailed Digital/,0.129,1.181,Arial,0.052,0,bold Litho print PDF,0.136,1.247,Arial,0.052,0,bold Local print,0.651,1.181,Arial,0.052,0,bold PDF,0.711,1.247,Arial,0.052,0,bold Expect these new commands in next build: ARRAYSEARCH ARRAYSEARCHNOT ARRAYEXTRACT ARRAYEXCEPT (reverse of ARRAYEXTRACT) ---------------------------------------------------------------------------- Tue, 28 Sep 2004 Updated datafiles from Dick. New command IMAGEEMFTEXT, dumps all the text in an EMF image into an array. Example: drawclear white imageload bmwtest.emf test = imageemftext(bmwtest) filedelete "c:\\test.csv" fileputarraynamed "c:\\test.csv" test exitnow Some example output: text,x,y,font,height,weight,italic,underline,align,color Any other,2.819,1.665,Arial,0.052,400,0,0,left,0 marketing,2.815,1.726,Arial,0.052,400,0,0,left,0 collateral can,2.785,1.793,Arial,0.052,400,0,0,left,0 be produced,2.792,1.854,Arial,0.052,400,0,0,left,0 Emailed Digital/,0.129,1.181,Arial,0.052,700,0,0,left,0 Litho print PDF,0.136,1.247,Arial,0.052,700,0,0,left,0 Local print,0.651,1.181,Arial,0.052,700,0,0,left,0 PDF,0.711,1.247,Arial,0.052,700,0,0,left,0 The X, Y coordinates and the font height are in percentage of image size (for scaling purposes). The weight, italic, and underline values will likely change to text fields (a "fontstyle" field). ---------------------------------------------------------------------------- Thu, 23 Sep 2004 (been working on IMAGEEMFSCRIPT and new commands to support the scripts, not done, and in fact hunks of that code are stubbed out so I could create this updated build) IMAGESIZE now has two optional parameters at the end that specify a "virtual size" used to anti-alias and adjust for font size in EMF files. Text in EMF files use a fixed table for spacing, it's an exact proportion of the image size. Unfortunately fonts do not scale evenly like that, so as you scale an EMF (particularly to smaller sizes), the text spacing can become quite bad looking. You can use the virtual size option in imagesize to render the EMF at a much larger "virtual" resolution which will then be scaled down. IMAGESIZE IMAGEBUF IMAGESIZE XSIZE YSIZE IMAGEBUF IMAGESIZE XSIZE YSIZE BITS IMAGEBUF IMAGESIZE IMAGEBUF VIRTXSIZE VIRTYSIZE IMAGESIZE XSIZE YSIZE IMAGEBUF VIRTXSIZE VIRTYSIZE IMAGESIZE XSIZE YSIZE BITS IMAGEBUF VIRTXSIZE VIRTYSIZE Also all IMAGESIZE calculations made based on image size now use the original image size before any scaling. IMAGELOAD of EMF/WMF images now fill in height and width of the image buffer (they were defaulting to zero). The values for image density (dots per inch) are also read from the EMF/WMF. IMAGELOAD still does not render an EMF/WMF image, you still need to use IMAGESIZE This loads an EMF and displays it anti-aliased, use original size, but render at a virtual resolution 16x larger drawclear white imageload emailrbcore.emf imagesize -1 -1 emailrbcore -8 -8 imageput emailrbcore forever An example of the dramatic difference between a EMF rendered directly to the window with no scaling, and one rendered at 64x the resolution: set imagecompressed on imageload bmwtest.emf bmw set imagecompressed off imageload bmwtest.emf windowsize bmw->sizex bmw->sizey drawclear white imagesize -1 -1 bmwtest -8 -8 beginloop imageput bmwtest delay 50 windowupdate off drawclear white imageput bmw windowupdate on delay 50 endloop The imagesize virtual size option means nothing on images loaded with IMAGECOMPRESSED ON. Four new elements added for IMAGES only: IMAGE->ORIGSIZEX ; always preserved, not changed by IMAGESIZE IMAGE->ORIGSIZEY IMAGE->VIRTSIZEX ; set by IMAGESIZE VIRTXSIZE/VIRTYSIZE IMAGE->VIRTSIZEY ---------------------------------------------------------------------------- Wed, 08 Sep 2004 Updated AfterGRASP Editor (AGEDIT) from Dick Brandt. Divide by Zero error when using modulus (%) with zero fixed. IMAGEFINDCENTER now has a more extensive search pattern. Branching outward in a 8 pointed star pattern when enlarging the radius of the possible center. This can result is FAR slower searches, but gives more accurate results. The default search RADIUS for IMAGEFINDCENTER is now the height+width of the image divided by 128. If that is lower than 4, then 4 is used. IMAGEFINDCENTER now returns a radius of 0 if the search failed. IMAGEFINDCENTER's default MATCHPERCENT is increased slightly to 99.8. ---------------------------------------------------------------------------- Mon, 06 Sep 2004 Coordinate/Number detection much improved to avoid identifying strings like "1. First line" as a number or coordinate when used with commands like text or textfrom. A number is now defined as digits, a optional single period, optional leading and trailing spaces or tabs, optional scientific notation like 1.05e23, and optional hex notation. Several TEXT options (like vertical centering) were not working with TEXTFROM because the internal TEXTHEIGHT code was not correctly taking the linecount into consideration (it was ignoring it). Fixed. TEXTHEIGHT now accepts 2 additional (optional) parameters: RESULT = TEXTHEIGHT(STRING) RESULT = TEXTHEIGHT(STRING, OFFSET) RESULT = TEXTHEIGHT(STRING, OFFSET, HEIGHT) RESULT = TEXTHEIGHT(STRING, OFFSET, HEIGHT, STARTLINENUMBER) RESULT = TEXTHEIGHT(STRING, OFFSET, HEIGHT, STARTLINENUMBER, PAGELINECOUNT) OFFSET defaults to 1 (first character in the string) HEIGHT defaults to 0 STARTLINENUMBER defaults to 1 PAGELINECOUNT defaults to 99999999 The STARTLINENUMBER and PAGELINECOUNT allow you to calculate the height of sections of text. The line number refer to wordwrapped formatted final text much like the TEXTFROM command. IMAGECENTER now working. IMAGEFINDCENTER now working IMAGEFINDCENTER returns the centerX, centerY and radius of center area: RESULTS = IMAGEFINDCENTER(IMAGE) RESULTS = IMAGEFINDCENTER(IMAGE, CHECKRADIUS) RESULTS = IMAGEFINDCENTER(IMAGE, CHECKRADIUS, COLOR) RESULTS = IMAGEFINDCENTER(IMAGE, CHECKRADIUS, COLOR, MATCHPERCENT) RESULTS = IMAGEFINDCENTER(IMAGE, CHECKRADIUS, COLOR, MATCHPERCENT, NOMATCHPERCENT) CHECKRADIUS defaults to 4 pixels, area searched for will be a circle with a diameter of 8. COLOR defaults to BLACK MATCHPERCENT defaults to 99.7 (is how close a pixel has to be to COLOR to match) NOMATCHPERCENT defaults to 99.5 (is compensation for completely non-matching pixels, like noise). Example of IMAGECENTER and IMAGEFINDCENTER: windowSize 1280 1024 32 imageload abba2.jpg imagetrim abba2 imageput abba2 color red drawcirclefilled imagefindcenter(abba2) imagecenter abba2 black imagefindcenter(abba2) drawclear green imageput abba2 drawcirclefilled imagefindcenter(abba2) imagepolar pantest abba2 1024 layer test panorama pantest 512, 300 layer test panning 1000/30. 1 .7 0 beginloop layer j 580 0 text test->panoangle$" "$test->panotilt endloop ---------------------------------------------------------------------------- Thu, 02 Sep 2004 New command IMAGEEMFSCRIPT, just testing code for now (planned to dump an EMF file as a AfterGRASP script). Bug in HTML/RTF text where lines following a line break done in a taller font would mess up the line spacing on the shorter font line. The formatting calculation was not correctly counting the LineFeeds as a line, and falling through to the text draw, instead it was continuing onward into other lines of text. This bug may also have had odd side effects in calculating text height and textlines. New commands not finished yet: IMAGEFINDCENTER IMAGE CHECKRADIUS MATCHPERCENT COLOR IMAGEFINDCENTER returns 3 values, the X and Y coordinates of the image center, and the diameter of the circular center area. IMAGE is the image buffer to search CHECKRADIUS is the size of the rectangle of solid color to search for (default is 3 pixels, integer value) MATCHPERCENT is the percentage match that is acceptable (default is 95.0, floating point value) COLOR is the color to search for (default is BLACK, color value) IMAGECENTER IMAGE COLOR CENTERX CENTERY IMAGECENTER adds extra pixels on whatever sides are required to make CENTERX and CENTERY the new center of the image. IMAGE is the image buffer to modify COLOR is the fillcolor CENTERX/CENTERY are the coordinates of the area within IMAGE that will become the new center. Example: imageload abba1.jpg ; load fisheye view image imagetrim abba1 imagecenter abba1 black imagefindcenter(abba1) imagepolar pantest abba1 1024 ---------------------------------------------------------------------------- Thu, 26 Aug 2004 Extra characters added at the end of a indented list with RTF text is fixed. ---------------------------------------------------------------------------- Wed, 25 Aug 2004 Updated Install Script from Dick (registry settings for editor) Slightly higher priority now given to thread that monitors Layers for movement (like LAYER PANNING, or LAYER TO). Comments are now allowed inside function calls like this: hello(1, ;result 2, ; 3, 4) Comments can now be defined with double forward slash '//' (like in C/C++/Java) as well as with semicolon ';' SET TEXTRTF ON/OFF and SET TEXTHTML ON/OFF now resets the text code parser including the "unget" buffer used for tables. This prevents odd weirdness when displaying non RTF text after using RTF. ---------------------------------------------------------------------------- Mon, 23 Aug 2004 Updated AGEDIT and DAT files from Dick. Edit/Preferences property sheet is now accessible at all times, even when no project or file has been opened. Some file associations updated to closer match those created by the setup program. LAYER PAN, LAYER PANORAMA now correctly remove a layer from the busy/active list. LAYER PANTO and LAYER PANNING now removed a layer from the busy/active list when required. New option for HOTSPOT, the "CLICKUP" is a combination of both LABEL and CLICKOUT. It is called when the mouse is released, either inside the hotspot, or outside it. The AfterGRASP compiler (AGCOMP) now allows parameters to a function to not have commas between them. This allows statments like this: hotspot( hvtup, position, @arrowsposx+7, @arrowsposy, @arrowsposx+17, @arrowsposy+8, clickdown, pansub:(0,-1,0), clickup, stoppan, rollimage, up_arrow ) To be written like this: hotspot( hvtup position @arrowsposx+7 @arrowsposy @arrowsposx+17 @arrowsposy+8 clickdown pansub:(0,-1,0) clickup stoppan rollimage up_arrow ) Bug when multiple labels of the same type are used with HOTSPOT is fixed, so for instance this would have caused a memory leak: hotspot hvtup fun, label notfun, position 1 2 3 4 ---------------------------------------------------------------------------- Thu, 19 Aug 2004 New command LAYER PANNING used for continuous panning of a panoramic image. It continues panning until you do a LAYER LAYNAME PANNING LAYER LAYNAME PANNING DELAY LAYER LAYNAME PANNING DELAY PANANGLESTEP LAYER LAYNAME PANNING DELAY PANANGLESTEP TILTANGLESTEP LAYER LAYNAME PANNING DELAY PANANGLESTEP TILTANGLESTEP FIELDOFVIEWSTEP Default values are: DELAY is 1000/30. (1/30th of a second) PANANGLESTEP is 1 TILTANGLESTEP is 0 FIELDOFVIEWSTEP is 0 As the panning continues: PANANGLE wraps around at +180 and -180. TILTANGLE reverses when the maximum (32) or minimum (-32) tilt is reached. FIEWOFVIEW reverses when the maximum (120) or minimum (10) field of view is reached. LAYER PAN with no angle parameter is changed to NOT reset the angle to 0 rather it only stops any panning motion set forth with PANTO or PANNING. New elements for reading panangle, tiltangle and fieldofview from a layer. LAYNAME->PANOANGLE LAYNAME->PANOTILT LAYNAME->PANOVIEW These elements change while PANTO and PANNING are running to match the current angle. Here is a working example: drawclear red imageload DSCF0027.JPG imagetrim DSCF0027 imageput DSCF0027 imagepolar pantest DSCF0027 1024 layer test panorama pantest 512, 300 layer test panning 1000/30. 1 .7 0 beginloop layer j 580 0 text test->panoangle$" "$test->panotilt endloop forever ---------------------------------------------------------------------------- Tue, 17 Aug 2004 The LAYER REPEAT command now supports LAYER PANTO Priority of the Logical Not '!' operator was wrong! It was very high priority, before most operators. This is the new corrected priority table: 1 MEMGETBYTE MEMGETLONG MEMGETWORD AT NEGATE INCHES MILLIMETERS CENTIMETERS PERCENTAGE POINTS PICAS 2 ARROW 3 MULTIPLY DIVIDE MODULUS 4 ADD SUBTRACT 5 STRCAT GREATERTHAN EQUALGREATERTHAN LESSTHAN EQUALLESSTHAN 6 LOGNOT 7 EQUAL NOTEQUAL 8 AND OR SHIFTRIGHT SHIFTLEFT XOR 9 LOGAND 10 LOGOR 11 SET 12 OPENPAREN CLOSEPAREN CLOSEBRACE UNTIL command now supported, syntax is: until expression Waits until expression is true. Examples: timerset test until @test>2000 layer testlay panto 360 until !testlay->layerbusy||@mousedown Removed a few stray commands from interpreter that were left over from when some control commands like WAIT, WAITKEY were moved into the compiler. More changes for RTF table tags. ---------------------------------------------------------------------------- Thu, 12 Aug 2004 New command FILEZIPAS, similar to FILEZIP, except it expects two values for each file, the original filename, and the path/name to use within the zip file. For example: drawclear white fpath = "c:\\dhomes\\include\\" zpath = "funnydir\\" count = 0 for fn in drivefilelist(0,@fpath$"*.*")) a[@count] = @fpath$@fn inc count a[@count] = @zpath$@fn inc count next filezipas "c:\\test.zip" @a Work started on adding these RTF tags: \cell \cellx \intbl \row \trgaph \trleft \trowd \trpaddfl \trpaddfr \trpaddl \trpaddr \trrh Stubs added for these RTF tags: \ansi \ansicpg \deff \deflang \fcharset \generator \uc \viewkind ---------------------------------------------------------------------------- Tue, 10 Aug 2004 Bug in LAYER TEXTWIDTH fixed (wasn't accepting parameters correctly) New DAT files from Dick for AG Editor. AG appears to work fine with WinXP SP2. ---------------------------------------------------------------------------- Thu, 05 Aug 2004 Serious bugs in handling multiple RTF text strings are fixed. The \RTF tag now wipes out all previous rtf parsing state information. New function, INT() returns the integer version of a number (clearer and more efficient than using STRPAD0() to do the same sort of thing). Two new commands, TEXTLINES and TEXTFROM: PAGELINECOUNT = TEXTLINES(STRING) PAGELINECOUNT = TEXTLINES(STRING, STARTLINENUMBER) PAGELINECOUNT = TEXTLINES(STRING, STARTLINENUMBER, PAGEWIDTH) PAGELINECOUNT = TEXTLINES(STRING, STARTLINENUMBER, PAGEWIDTH, PAGEHEIGHTPIXELS) TEXTFROM STRING TEXTFROM STRING STARTLINENUMBER TEXTFROM STRING STARTLINENUMBER PAGELINECOUNT TEXTFROM XPOS YPOS STRING TEXTFROM XPOS YPOS STRING STARTLINENUMBER TEXTFROM XPOS YPOS STRING STARTLINENUMBER PAGELINECOUNT IMAGEPOLAR now accepts a destination image: IMAGEPOLAR SOURCEIMAGE IMAGEPOLAR SOURCEIMAGE VIEWYSIZE IMAGEPOLAR SOURCEIMAGE VIEWXSIZE VIEWYSIZE IMAGEPOLAR SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY IMAGEPOLAR SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY STARTRADIUS ENDRADIUS IMAGEPOLAR XPOS YPOS SOURCEIMAGE IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWYSIZE IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY STARTRADIUS ENDRADIUS IMAGEPOLAR DESTIMAGE SOURCEIMAGE IMAGEPOLAR DESTIMAGE SOURCEIMAGE VIEWYSIZE IMAGEPOLAR DESTIMAGE SOURCEIMAGE VIEWXSIZE VIEWYSIZE IMAGEPOLAR DESTIMAGE SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY IMAGEPOLAR DESTIMAGE SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY STARTRADIUS ENDRADIUS Some default values in IMAGEPOLAR are different depending if DESTIMAGE is used. If DESTIMAGE is not used them: VIEWXSIZE default is current DRAWREGION width VIEWYSIZE default is current DRAWREGION height IMAGETRIM rewritten to scan each side using the edge color from that side, not one common bacground color for all four sides (unless a background color is passed as a parameter, in which case that color is used for all four scan directions). Updated working example: drawclear red imageload DSCF0027.JPG imagetrim DSCF0027 imageput DSCF0027 imagepolar pantest DSCF0027 for tilt from -20 to 20 step 5 layer test panorama pantest 256, 200, -180 @tilt 60 layer test position 100 200 layer test panto 180 wait delay 100 layer test panto -180 wait delay 100 next forever ---------------------------------------------------------------------------- Thu, 29 Jul 2004 DRAWSCANAREA and DRAWSCANAREANOT now supported. DRAWSCANAREA X1VAR Y1VAR X2VAR Y2VAR DRAWSCANAREA X1VAR Y1VAR X2VAR Y2VAR BACKCOLOR DRAWSCANAREA X1VAR Y1VAR X2VAR Y2VAR BACKCOLOR PERCENT DRAWSCANAREANOT X1VAR Y1VAR X2VAR Y2VAR DRAWSCANAREANOT X1VAR Y1VAR X2VAR Y2VAR BACKCOLOR DRAWSCANAREANOT X1VAR Y1VAR X2VAR Y2VAR BACKCOLOR PERCENT Default values are: BACKCOLOR is 0 PERCENT is 100 (it's the percentage match when comparing colors) If percent is less than 100, then 1% totally unmatching pixels per line scanned are allowed since the assumption it's a photographic image that may include stray pixels. New IMAGETRIM command used to crop solid color background from an image. It first takes a color average of the four single pixel wide sides of the image (top, left, right, bottom). It then does an average of all the pixels on those four sides that is within PERCENTBACK of that four side average. This final average is used as the background color when determining the area to trim off. IMAGETRIM IMAGEVAR IMAGETRIM IMAGEVAR BACKCOLOR IMAGETRIM PERCENT IMAGEVAR IMAGETRIM PERCENT IMAGEVAR BACKCOLOR IMAGETRIM PERCENT PERCENTBACK IMAGEVAR Default value of PERCENT is 96. It's the percentage match when comparing with the background. Default value of PERCENTBACK is 96. It's the percentage match when comparing the average background color with the possible background colors uses for a final average background color. In the IMAGEPOLAR command, the default value for STARTRADIUS is now the SOURCEIMAGE height multiplied by 0.096 Working example using new IMAGETRIM with IMAGEPOLAR: drawclear red imageload DSCF0027.JPG imageput 0 0 DSCF0027 640 480 imagetrim DSCF0027 imagenew pantest 480*@pi 480 imageset pantest imagepolar DSCF0027 480 imageset delay 200 imageput pantest for tilt from -20 to 20 step 5 layer test panorama pantest 256, 200, -180 @tilt 60 layer test position 100 200 layer test panto 180 wait delay 100 layer test panto -180 wait delay 100 next forever ---------------------------------------------------------------------------- Wed, 28 Jul 2004 New IMAGEPOLAR command used to transform a polar coordinate image (usually a fisheye view) into a panoramic view. IMAGEPOLAR SOURCEIMAGE IMAGEPOLAR XPOS YPOS SOURCEIMAGE IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWYSIZE IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY STARTRADIUS ENDRADIUS Default values are: VIEWYSIZE is half with width or height (whichever is smaller) of SOURCEIMAGE VIEWXSIZE is PI times the VIEWYSIZE CENTERX,CENTERY is the center of SOURCEIMAGE STARTRADIUS is VIEWYSIZE*0.095 ENDRADIUS is the distance to the nearest edge from CENTERX,CENTERY Crude example: drawclear red imageload DSCF0027.JPG imagesize -2 -2 DSCF0027 imagenew pantest 480*@pi 480 imageset pantest imagepolar DSCF0027 480*@pi 480 DSCF0027->sizex*.512 DSCF0027->sizey/2 DSCF0027->sizey*.095 DSCF0027->sizey*0.48 imageset imageput pantest for tilt from -20 to 20 step 5 layer test panorama pantest 256, 200, -180 @tilt 60 layer test position 100 200 layer test panto 180 wait delay 100 layer test panto -180 wait delay 100 next forever IMAGEPANORAMA command now supports source images that are not 32bits per pixel. New SCRIPTCOMPILE command, non-functional (yet), intented to eventually replace AGCOMP program and allow direct execution of text scripts in the field. ---------------------------------------------------------------------------- Wed, 21 Jul 2004 LAYER TO now supports floating point numbers for STEP and DELAY. Also, in LAYER TO, DELAY now defaults to 1000/60 (used to be 10). IMAGEPANORAMA sped up (destination image buffer is no longer cleared before being filled). New LAYER commands: LAYER PANORAMA, LAYER PAN and LAYER PANTO for use with panoramic view images: LAYER LAYNAME PANORAMA SOURCEIMAGE LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXYSIZE LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXSIZE VIEWYSIZE LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXSIZE VIEWYSIZE PANANGLE LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXSIZE VIEWYSIZE PANANGLE TILTANGLE LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXSIZE VIEWYSIZE PANANGLE TILTANGLE FIELDOFVIEW LAYER LAYNAME PAN LAYER LAYNAME PAN PANANGLE LAYER LAYNAME PAN PANANGLE TILTANGLE LAYER LAYNAME PAN PANANGLE TILTANGLE FIELDOFVIEW LAYER LAYNAME PANTO LAYER LAYNAME PANTO PANANGLE LAYER LAYNAME PANTO PANANGLE TILTANGLE LAYER LAYNAME PANTO PANANGLE TILTANGLE FIELDOFVIEW DELAY LAYER LAYNAME PANTO PANANGLE TILTANGLE FIELDOFVIEW DELAY STEP Default values are: VIEWXYSIZE is the height of SOURCEIMAGE PANANGLE is 0 (in degrees) TILEANGLE is 0 (in degrees) FIELDOFVIEW is 70 degrees DELAY is 1000/30 STEP is 2.5 All use high quality scaling except PANTO which uses nearest neighbor pixel scaling until the last frame (which uses the high quality scaling). Working example: drawclear red imageload kitchen.jpg for tilt from -20 to 20 step 5 layer test panorama kitchen, 256, 200, -180 @tilt 60 layer test position 100 200 layer test panto 180 wait delay 200 layer test panto -180 wait delay 200 next forever ---------------------------------------------------------------------------- Sun, 18 Jul 2004 New IMAGEPANORAMA command for use with panoramic view images: IMAGEPANORAMA XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE PANANGLE TILTANGLE FIELDOFVIEW Default XPOS is 0 Default YPOS is 0 Default PANANGLE is 0 (in degrees) Default TILEANGLE is 0 (in degrees) Default FIELDOFVIEW is 70 degrees Working example: drawclear red imageload kitchen.jpg for tilt from -20 to 20 step 5 set imagefastscale on for ang from -180 to 180 step 2 imagepanorama center center kitchen, 512, 512, @ang, @tilt next set imagefastscale off for ang from 180 to -180 step -5 imagepanorama center center kitchen, 512, 512, @ang, @tilt next next forever The IMAGEFASTSCALE variable is used to determine the scaling quality. New modular compile OPTION PANVIEW ---------------------------------------------------------------------------- Wed, 07 Jul 2004 Crashing bug in imageload and other loading commands when the filename is NULL is fixed. ---------------------------------------------------------------------------- Tue, 29 Jun 2004 Wierd compiler bug with Inline functions worked around in the CopyDRAWINFO internal function when called from IMAGEPUT with scaling. The bug was causing a Windows GDI Object leak so that eventually you would run out of objects, and no new images could be loaded or created. ---------------------------------------------------------------------------- Thu, 24 Jun 2004 FILESHORTNAME command is now supported, takes any number of filenames with path and returns the short (8.3) version of them. drawclear white color black set textkern off textln fileshortname("c:\\program files") forever New system variable SET TEXTKERN, defaults to ON, which is the same as STRASC("~"). It's the character used for text kerning (backspacing 1 pixel). SET TEXTKERN OFF SET TEXTKERN ON ; same as STRASC("~") SET TEXTKERN 255 SET TEXTKERN STRASC("~") New command STRVARNAME, it takes a string and strips out all invalid characters for a variable name, as well as converting it to lowercase. If the resulting name is all digits, then an underline is added as a prefix. If no valid name can be constructed, then a CRC32 of the name is used as a HEX string with a leading "_". Example: drawclear white color black srcpath = "c:\\images\\" list = driveFileList(0,@srcpath$"*.jpg") set variables on for fname in @list testname = @srcpath$"TEST "$@fname testvar = strvarname(@testname) imageload @srcpath$@fname @testvar imagesize 200 200 @testvar imagesavejpeg 80 @testname imagefree @testvar next forever ---------------------------------------------------------------------------- Wed, 23 Jun 2004 Bug in Modular compiler when dealing with TEXT and no RTF Text, all intercharacter spacing was lost. Fixed. Two new commands supporting BLOWFISH encryption (very fast): STRENCRYPTBLOWFISH STRDECRYPTBLOWFISH Exactly the same syntax as the STRENCRYPTAES and STRDECRYPTAES commands. The password is transformed via SHA into a 256bit cypher key for BlowFish. You can read more about the free, unpatented BlowFish Algorithm here: http://www.schneier.com/blowfish.html ---------------------------------------------------------------------------- Tue, 22 Jun 2004 SET FILEDIALOGPATH was broken, was treating the path as a integer instead of a string. Tabs created by HTML tabs (like
        • ), and RTF tabs are now special cased as HTMLTAB and RTFTAB so if both TEXTHTML ON and TEXTRTF ON are on. Indenting problem with
        • where the
        • is on the same line as the text with no breaks is fixed. Two new system variables: SET FILESTRINGSTART SET FILESTRINGEND They apply to these commands: FILEGETVARIABLES FILEGETARRAY FILEGETARRAYNAMED FILEPUTARRAY FILEPUTARRAYNAMED FILEPUTVARIABLES Both default to @QUOTE (double quote character). Example that loads in a variables list from TEST.TXT, displays the list of variables, and then writes out the new list with different delimiters (using "<<" for the start of a string and ">>" for the end of a string). drawclear white color black set textwrap off global filegetvariables(test.txt) set list array(filegetvariables(test.txt)) for vname from 1 count list->Size/2 step 2 arrayremove list @vname next textln @list textln set filestringstart "<<" set filestringend ">>" fileputvariables(output.txt, @list) textln fileget(output.txt) local filegetvariables(output.txt) set variables on forever ---------------------------------------------------------------------------- Thu, 17 Jun 2004 FONTLOAD was broken yesterday (build wasn't publicly announced since it was a rush job anyway). FILESETDATETIME tested. ---------------------------------------------------------------------------- Wed, 16 Jun 2004 FILESETDATETIME support added (untested, been a busy day) Multiple problems with FONTDEFINE caused by all the font changes yesterday are fixed (a second font handle is now created when the font is rendered). ---------------------------------------------------------------------------- Tue, 15 Jun 2004 More error checking added for when the windows GDI system runs out of space. Resource leak in the selection of windows HFONT handles is fixed (each selectobject is now tracked with backreferences). ---------------------------------------------------------------------------- Sun, 13 Jun 2004 The support for reading the DEVMODE structure when you use something besides the default printer (by using SET PRINTNAME ...) has been expanded to use an alternate method when the usual method fails. Fixed GPF bug when SET PRINTNAME is used with an incorrect name (no printer with that name is available). Updated DAT files from Dick for Editor. ---------------------------------------------------------------------------- Thu, 10 Jun 2004 The following system variables for printing are now functional: @PRINTNAME @PRINTDRIVER @PRINTPORT If you set any of these variables before using any PRINT commands, you can force AfterGRASP to use a different printer. Normally you would only change @PRINTNAME to switch printers, the @PRINTDRIVER and @PRINTPORT are for more advanced tasks. drawclear white color black set printname "Postscript to a file" set printfilename "c:\\test.ps" printsettings dpi 600 printstart printstartpage printset color black for i from 9 to 60 step 4 winfont "Times" 0 topoints(@i) 90 text "Times "$@i$"pt" fontdefine "Times" 0 topoints(@i) 90 textln 50pct @textposy "Times "$@i$"pt" next printendpage printend fontdefine "Times" 20 color black textln "printname="$@printname textln "printport="$@printport textln "printdriver="$@printdriver forever ---------------------------------------------------------------------------- Fri, 04 Jun 2004 More Layer thread problems fixed. All the code which handles the active or busy layer queues is now centralized in a single sychronous function. More time is now given up by the Layer position adjustment thread to make the foreground animation smoother. This eliminate a large amount of stutter and other jumps. ---------------------------------------------------------------------------- Wed, 02 Jun 2004 Fixed several structural problems in the handling of a large number of LAYERs. Rewrote most of the layer processing QUEUE code, and added a lot of error checking. Restored previous (lower) limits on number of active layers Maximum number of layers that can be updated at once: 1024 Maximum number of layers that can be animated at once: 4096 ---------------------------------------------------------------------------- Tue, 01 Jun 2004 Serious bugs in SET VARIABLES ON when used with a large number of variables (hundreds) are fixed. The entire dialog update queue system used for DEBUG and VARIABLES has been stripped out. This drasticly speeds up their update speed, and fixes numerous little quirks. VARIABLES dialog now displays the position, size, frame number, number of frames, and active/busy flags for LAYERs. VARIABLES dialog now preserves the position of the scroll list so it doesn't keep jumping back to the top. LAYER updating now causes the VARIABLES dialog to update. The maximum number of layers that can be updated at once has been increased from 1024 to 4096 The maximum number of layers that can be animated at once has been increased from 8096 to 16384. ---------------------------------------------------------------------------- Mon, 31 May 2004 SET TEXTHTML ON now supports the following tags:
            • Example: drawclear white color black set texthtml on text " Hello
              • One
                Second
                1. A
                2. B
                  1. Uno
                  2. Duo
                3. C
              • Two
              • Three
              " forever ---------------------------------------------------------------------------- Thu, 27 May 2004 The pct measurement is now always based on the full window size, not the current drawregion. IMAGESIZE now supports measurements and percentages for the image size. SET IMAGECOMPRESSED ON now affects loading of EMF and WMF files. They are no longer rendered as bitmaps, but rather drawn directly to the print device context. This allows much nicer looking vector graphics at full resolution without the loss from the bitmap translation. Here is a working example: drawclear white color black printsettings dpi 600 printstart printstartpage printset drawclear white color black set imagecompressed on imageload Emailrbcore.emf imagesize 100pct 50pct Emailrbcore imageput Emailrbcore printendpage printend exitnow ---------------------------------------------------------------------------- Wed, 26 May 2004 DRAWREGION now correctly works with percentage measurements (they are now correctly based on the entire window size, not the previous drawregion). New command FILEBUSY, determines if a file is "busy", tries to open a file for reading in locked mode to determine if the file is available (could be moved, deleted, or if another task is done writing to it). FILEBUSY will return @TRUE if any error happens trying to access the file including a bad path or missing file. It only returns @FALSE when the file exists and can be accessed. ---------------------------------------------------------------------------- Mon, 24 May 2004 FileDelete now supports Wildcards. TEXTWIDTH() was miscalculating the width of lines ending in a CR/LF. The worst effect of this was miswrapped LAYER TEXT (last character would be forced to wrap for no reason). New FILESETSECURITY command added, Syntax is: FILESETSECURITY FILENAME OWNER TYPE TYPE can be ALL, DELETE, EXECUTE, READ or WRITE for example: filesetsecurity "c:\\agqueue" "Everyone" all If TYPE is left out, it defaults to ALL. Return value is 0 if success. ---------------------------------------------------------------------------- Sun, 23 May 2004 TEXTLN now supports all the coordinate options that TEXT supports such as measurements 50pct, or CENTER/LEFT/RIGHT/TOP/BOTTOM. The PRINTSETTINGS command now has a "DPI" option that requires a number. like PRINTSETTINGS DPI 300. For example: drawclear white printsettings dpi 144 printstart printstartpage printset drawclear white color black for i from 9 to 69 step 5 winfont "Times" 0 topoints(@i) 90 text "Times "$@i$"pt" fontdefine "Times" 0 topoints(@i) 90 textln 50pct @textposy "Times "$@i$"pt" next printendpage printend forever ----------------------------------------------------------------------------- Thu, 20 May 2004 The \rtf keyword in TEXTRTF now resets all RTF variables (fonts, colors, font style, tabs, and so on). Added limited support for "Paragraph Numbering" keywords in RTF. Only those generated by WordPad, so: \pn \pnf \pnindent \pnlvlblt \pntext \pntxta \pntxtb Basicly this means numbering doesn't even number, it only indents, and uses the text from \pntxtb. Apparently Microsoft Word doesn't even generate the "Paragraph Numbering" tags in the more recent versions, only WordPad. ----------------------------------------------------------------------------- Mon, 17 May 2004 TEXTRTF now supports multiple tabstops (up to 32), and the default tab stops are every 1/2 inch if none are specified. A serious bug when lots of font changes occur during HTML or RTF text has been fixed. The whole mechanism for keeping track of the current HTML or RTF font variable's name has been ripped out. This also fixes a memory leak in the RTF font variable's name. Performance of displaying RTF text is now quite a bit quicker since the check for font changes is now only don't when RTF tags actually change the font name/style/size. Numerous fixes to TEXTHEIGHT() function to match the same height produced by TEXT with TEXTRTF or TEXTHTML. This includes the tracking of multiple character heights on the same line, mixed text and graphics, and word wrap bugs. Problems with RTF and HTML parsing near a word wrap are fixed (some tags were being repeated). RTF and HTML parsing errors after a linebreak are fixed (introduced in previous build). RTF Font size is now calculated as half points (it was done as half pixels before). The variable name used for the font now uses the full halfpoint size as the suffix, so for instance Arial 12pt Bold would be stored in "arial24b". Handling of text near a linebreak was sometimes putting the RTF Parser into an infinite loop. Fixed. Fixed bug in TextHeight with TEXTRTF and start of paragraph indenting. ----------------------------------------------------------------------------- Thu, 13 May 2004 RTFTEXT now recognizes left indent, first left indent, and now correctly spaces RTF Tabs. Formatting of TEXT is rewritten to always happen one line at a time. Previously it would do the formatting for the entire block of text if there was no word wrap. This caused all kinds of problems for RTF and HTML text. Parsing of TEXT for formatting is sped up a bit (extra code required for HTML and RTF is now bypassed in @TEXTWRAP support). MODULAR option for RTFTEXT fixed. RTFTEXT support of justification improved. More touch up to RSA public key code. Start of including of Panoramic reverse transform code (like a reverse wide angle lens). ----------------------------------------------------------------------------- Tue, 04 May 2004 Initial code for RSA public key encryption added (with support for 4096 bit keys). RTFTEXT now recognizes the \TX tag and changes the current tabsize. Crash after an RTF parsing error message is displayed is fixed. TEXTRTF wasn't handling HEX characters (would give RTF parse error). TEXTRTF HEX defined characters were being skipped. FONTSTYLE INIT and WINFONTSTYLE INIT, now reset the number of characters to 255 (they were setting it to 127). FONTSTYLE UNDERLINE now eliminates the fore and aft space around each character, and includes that space in the character cell. This forces the underline to be drawn connecting characters in a solid line. ----------------------------------------------------------------------------- Sun, 02 May 2004 GLPRO encryption commands STRENCRYPT and STRDECRYPT are now supported: RESULT = STRENCRYPT(STRING RESULT = STRENCRYPT(PASSWORD,STRING) STRENCRYPT PASSWORD ADDRESS LENGTH RESULT = STRDECRYPT(STRING) RESULT = STRDECRYPT(PASSWORD,STRING) STRDECRYPT PASSWORD ADDRESS LENGTH New commands, all oriented twords cryptography. They don't encode encrypted data as HEX (the GLPRO STRENCRYPT doubled the string size when it encrypted). STRENCRYPTAES128 STRDECRYPTAES128 STRENCRYPTAES256 STRDECRYPTAES256 STRCRYPTRC4 STRMD5 STRSHA1 STRSHA2 MEMGETBYTES MEMSETBYTES The STRENCRYPT* and STRCRYPTRC4 all have the same syntax, they accept: RESULT = CRYPTCOMMAND(STRING) RESULT = CRYPTCOMMAND(PASSWORD,STRING) CRYPTCOMMAND PASSWORD ADDRESS LENGTH AES is the NIST standard (FIPS) Publication 197 encryption Find more info on AES here: http://en.wikipedia.org/wiki/AES For AES128, the PASSWORD is expanded to a 128bit key using an MD5 hash. For AES256, the PASSWORD is expanded to a 256bit key using a SHA2 hash. The STRMD5, STRSHA1, STRSHA2 all have the same syntax as STRCRC32. They produce different size hashes: MD5 128bit 16 byte result SHA1 160bit 20 byte result SHA2 256bit 32 byte result The return result is binary data, it is not hex (the description of STRMD5 from yesterday is incorrect). If you'd like the return in HEX, you can use STRHEX to convert it: strlower(strhex(strmd5(@string)) This will give a string identical to that produced by the standard MD5SUM utility. Two new MEM commands for dealing with binary strings (not text, not NULL terminated). RESULT = MEMGETBYTES(ADDRESS,LENGTH) MEMSETBYTES ADDRESS STRING STRING STRING STRING Example of new crypto functions: windowsize 800 600 32 drawclear white color black set txt fileget(test.rtf) ; pad the string to a multiple of 16 bytes so that the checksum test will work memnew tmpbuf (strlen(@txt)+15)&-16 memsetbytes @tmpbuf @txt txt = memgetbytes(@tmpbuf, tmpbuf->len) textln hex(strcrc32(@txt)) textln strlower(strhex(strmd5(@txt))) textln strlower(strhex(strsha1(@txt))) textln strlower(strhex(strsha2(@txt))) tmp = strencryptaes256("foolish",@txt) textln textln "AES256" textln strlower(strhex(strsha2(@tmp)))$" "$strlen(@tmp)$" "$strlen(@txt) textln strlower(strhex(strsha2(strdecryptaes256("foolish",@tmp)))) tmp = strencryptaes128("foolish",@txt) textln textln "AES128" textln strlower(strhex(strsha2(@tmp)))$" "$strlen(@tmp)$" "$strlen(@txt) textln strlower(strhex(strsha2(strdecryptaes128("foolish",@tmp)))) tmp = strcryptrc4(strmd5("foolish"),@txt) textln textln "RC4" textln strlower(strhex(strsha2(@tmp)))$" "$strlen(@tmp)$" "$strlen(@txt) textln strlower(strhex(strsha2(strcryptrc4(strmd5("foolish"),@tmp)))) tmp = strencrypt("foolish",@txt) textln textln "RC4 GLPRO" textln strlower(strhex(strsha2(@tmp)))$" "$strlen(@tmp)$" "$strlen(@txt) textln strlower(strhex(strsha2(strdecrypt("foolish",@tmp)))) set textrtf on textln @txt forever ----------------------------------------------------------------------------- Thu, 29 Apr 2004 STRCRC32 command now supported. New command STRMD5, works much like STRCRC32 except it returns a 128bit MD5 checksum in hex (FAR more accurate than a 32bit CRC). The results match the common MD5SUM command. You can read more about MD5SUM here: http://en.wikipedia.org/wiki/Md5sum Because the String operators in AfterGRASP generally do NOT depend on a trailing null character (like most did in GLPRO), you can use STRCRC32 and STRMD5 on binary data, for instance an entire file read in with the FILEGET command. For example: drawclear white color black set txt fileget(test.rtf) textln hex(strcrc32(@txt)) textln strmd5(@txt) forever Wierd intermittent bug with text not being displayed caused by uninitialized data from the stack being used for the text line height in some cases is fixed. (Thanks to Vicky for writing an example I could use to repeat the bug inside a debugger). This also showed up as a bug in the display in AGEXE where text would all rapidly scroll up on the bottom line of the window. Stack overflow caused by very complex RTF or HTML files is now fixed, a single line of text can now be 32k bytes long, and still correctly calculate the line height at a wrap point (beyond that, it just uses the height of the last word beyond the wrap point). ----------------------------------------------------------------------------- Mon, 26 Apr 2004 The INPUT commands (including original INPUT/INPUTLINE, and new INPUTNEW, INPUTCHECK, and INPUTFREE) now correctly include the LAYER commands required to draw the blinking cursor. SET RTFTEXT now supports and displays font face, font size, text color, background color, bold, italic, underline, left, right, center, and spread justification. (there are still bugs in the justifcation support). Changed some VC Compile optimizations to prevent a wierd crashing bug. ----------------------------------------------------------------------------- Wed, 21 Apr 2004 New system variable @TEXTRTF, works much like SET TEXTHTML ON variable. New modular option RTFTEXT, works much like HTMLTEXT option. RTF parsing is in, but font changes are not acted upon yet: drawclear white color black set txt fileget(test.rtf) textln @txt textln set textrtf on textln @txt forever So this displays the original text with all the RTF tags stripped out. If TEXTHTML and TEXTRTF are both turned on, the HTML is parsed first, then the text with HTML tags removed is parsed as RTF. ----------------------------------------------------------------------------- Wed, 14 Apr 2004 New system variable @PRINTFILENAME, is the default filename for printer drivers that write to a file. In WinXP it's in the "Ports" page of a printer's settings, where the "FILE:" port is chosen for a printer. This variable has to be set before the PRINTSTART command is used since it's used for the lpszOutput field of DOCINFO structure passed to windows when the PRINTSTART command is executed. One use of @PRITNFILENAME is to create a PostScript output file without prompting the user for a filename. IMAGEPUT now supports measurements (like 2in or 7pt) for the second pair of coodinates (scaled images). Bug when either of the second coordinates in IMAGEPUT with scale are lower than the first is fixed. When BI_JPEG images are output to a printer (with PRINTSET/IMAGEPUT or PRINTIMAGE), and BI_JPEG DIB support is not available (it virtually never is), and the output printer is PostScript compatible (as some PDF generators are).... then the JPEG is injected into the PostScript in encapsulated format using the original JPEG file. This allows printing of CMYK Images with their original color correction info with no loss of quality. Multiple BI_JPEG images can be injected. The PostScript Injection code can be left out of the runtime with the OPTION PRINT OFF modular compiler option. PostScript Injection tested (and working) with Microsoft PostScript Driver setup to write to a file, and with PDF995. ----------------------------------------------------------------------------- Wed, 07 Apr 2004 Vertical spacing on the first character after switching to a taller font is fixed. Start of PostScript injection for BI_JPEG images is in place (and not working yet). ----------------------------------------------------------------------------- Tue, 06 Apr 2004 New crashing bug in gradient fill is fixed. ----------------------------------------------------------------------------- Sun, 04 Apr 2004 Bug in TEXTLN when using TEXTCENTER ON or TEXTRIGHT ON is fixed. Odd bugs from compiler generating incorrect code are fixed (changed processor type in optimization settings to work around it). Showed up as missing text. New system variable @IMAGECOMPRESSED, default is 0 (off). If IMAGECOMPRESSED is turned ON, then JPEG and PNG image loads do not decompress the image, they are left as BI_JPEG or BI_PNG DIBs images in memory. A BI_JPEG or BI_PNG image has very limited use, it is not supported by IMAGESET, IMAGEFADE, IMAGESAVE or most other IMAGE commands. It's mainly for use for IMAGEPUT and PRINTIMAGE since Windows support for BI_JPEG and BI_PNG is quite limited. IMAGEPUT and PRINTIMAGE modified to use STRETCHDIBITS API call for BI_JPEG and BI_PNG images. All STRETCHDIBITS calls now do Escape checks before trying render BI_JPEG and BI_PNG images (for extra error checking). JPEG loading of CMYK images is changed back to converting to RGB since the support for CMYK DIBs is virtually non-existent in windows (no Microsoft GDI APIs actually support them directly). ----------------------------------------------------------------------------- Tue, 23 Mar 2004 More fixes to support of line height and
              . Added a whole set ot debug/error codes to FILEICONSET so we will know exactly what the error is, they are: 1 success 0 not enough parameters or UpdateResource API not available (Win9x systems don't have it). -1 ICON file cannot be opened (either missing, or disk error opening it) -2 Not enough memory to read ICON header -3 Not enough memory to read ICON images -4 Not enough memory to create ICON directory -5 Error reading ICON images -6 Not enough memory for Resource image buffer -7 Error reading icon image data -8 Error from AdjustIconImagePointers -9 BeginUpdateResource failed -10 Allocate memory for icon image failed -11 UpdateResource for directory failed -12 UpdateResource for icon failed -13 EndUpdateResource failed -14 to -18 are all errors reading the Icon header, either file is short, or data is wrong. Native support for CMYK is added. This is not available in Win95 or WinNT. Only on Win98/WinME/Win2000/WinXP/Win2003 machines. IMAGENEW now supports CMYK, if the bits is -32, then the image created is 32bit CMYK. No other bit depth is supported for CMYK. IMAGESAVEJPEG now supports writing CMYK images. IMAGELOAD of JPEG no longer converts a CMYK image into RGB, it leaves it as CMYK. IMAGELOAD of BMP now supports BITMAPV4HEADER and BITMAPV5HEADER images allowsing you to load CMYK images (which require BITMAPV4HEADER and the bV4CSType field). IMAGESAVE now supports writing CMYK BMP files, the header in the BMP file becomes the BITMAPV4HEADER format header with the bV4CSType field set to LCS_DEVICE_CMYK. WINDOWSIZE now supports CMYK (the bits parameter can be -32). New system variable SET PRINTCMYK forces the color output from all print commands to be done in CMYK (if the printer supports it). Not working yet (does nothing right now). ----------------------------------------------------------------------------- Wed, 17 Mar 2004 Now works without a height= parameter (bug was using zero for the height if none given). Now aligns the image position with the baseline of text. The height of any images is taken into consideration by
              Font changes with HTML text are now taken into account by
              More (slight) performance boosts to IMAGE CALC IMAGE CALC now calculates the ALPHA channel in 32bit images as well. It does not render alpha, just calculates it. IMAGE CALC now supports source and destination image bit depths other than 24bit and 32bit. So for instance you can use a GIF as the IMAGECALCSOURCE now (although performance will be slow). SCRIPTLINK/SCRIPTCALL when used with HOTSPOT now includes those commands in a modular built runtime. ----------------------------------------------------------------------------- Sun, 14 Mar 2004 LAYER IMAGE now supports arrays of images, in particular IMAGE CALC sets. imageload frames+ imagecalcset frames layer john image frames to 600 100 100 forever New command IMAGECALCSOURCE, lets you specify a image to be used as the source pixels in an image calculation. IMAGEPOSITION on the source image is supported allowing you to use a specific area of the source image. For example: imageload frames+ imagecalcset frames imagecalcsource test frames for y from 0 to 360 step 6 for x from 0 to 360 step 6 imageposition @x 20+@y test imageput @x 20+@y frames next next exitnow Performance of the drawing of IMAGE CALC is sped up about 15%. ----------------------------------------------------------------------------- Thu, 11 Mar 2004 Display of floating point variables in the VARIABLES dialog is fixed (was blank). IMAGESET now returns a value when it is not given any parameters. It returns the previously set IMAGESET image. For instance: Strings outside of quotes with a trailing '+' or '-' are now accepted, for instance, both of these now produce the same display: textln hello+ textln "hello+" The IMAGELOAD command now supports loading groups of numbered images. You put a trailing '+' plus sign at the end of the filename, like this: imageload john000.jpg+ This will try and load john000 john001 john002 and so on until the file is missing. The loaded images are stored in array just like multi-image GIF files. If there are no digits in the filename, then a zero is added before the suffix, so: imageload hello.jpg+ Would try to load hello0.jpg hello1.jpg hello2.jpg and so on. The image count does not roll over when the last digit exceeds 9, rather a '1' digit is inserted before the '9', So for instance: hello8.jpg hello9.jpg hello10.jpg hello11.jpg ..... hello98.jpg hello99.jpg hello100.jpg hello101.jpg ..... If not suffix is used, all the valid suffixes are searched just like a normal imageload. New command, IMAGECALCSET, forces a set of images into 24bit, and marks them as calculation images. When displayed after making them a calculation set, instead of drawing anything they force the creation of an offscreen calculation buffer where each successive image accumulates pixel totals. The last image in the set forces the calculated pixel totals to be drawn and the calculation buffer to be reset back to zero. This command is designed to be used to arrays of images (normally loaded with the imageload '+' suffix). Inside a calculation image, instead of pixels being RED/GREEN/BLUE, they are XDIST/YDIST/MULT MULT is -127 to +127 (0 to 255 minus 128). The value -128 is reserved for future use (for now it acts the same as 0, does nothing). If the value is negative, then the inverse of a pixel is added to the calculation buffer. XDIST and YDIST are -127 to +127 (0 to 255 minus 128). It's the distance on the X/Y axis for where to read the pixel that will be added to the calculation buffer. A VERY VERY slow example which uses a 8 image rotation filter with motion blue: windowsize 800 480 32 drawclear green imageput 0, -300 "First Class Milk-035.jpg" imageget test if fileexists(frames7.bmp) goto loaded endif centx = 180 centy = 180 set floatdegrees on for frame from 0 to 7 imageset imagenew(360,360,24) for x from 0 to 359 color black for y from 0 to 359 xpos = (@x-@centx) ypos = (@y-@centy) rad = sqrt(@xpos*@xpos+@ypos*@ypos) newx = 0 newy = 0 if @rad>=0 ang = vecangle(@centx,@centy,@x,@y)+18+@frame newx = @centx+sin(@ang)*@rad newy = @centy-cos(@ang)*@rad newx = min(max(@newx-@x, -127), 127) newy = min(max(@newy-@y, -127), 127) endif mult = @frame+1 color @newx+128 @newy+128 @mult+128 drawpixel @x @y next next frames$@frame = imageset() imagesave frames$@frame imagefree frames$@frame next loaded: imageload frames+ frames imagecalcset frames for y from 0 to 360 step 60 for x from 0 to 360 step 60 imageput @x 20+@y frames next next imagesize 150 150 frames imagecalcset frames for y from 0 to 360 step 5 for x from 0 to 600 step 4 windowupdate off imageput test imageput 600-@x 100 frames imageput @x 20+@x/5+@y frames windowupdate on next next forever ----------------------------------------------------------------------------- Mon, 8 Mar 2004 All the added error dialog boxes caused a bug where a missing default.glf font causes a error loading font error. Fixed. AGEXE now tries to update the ICON in the output EXE (uses the new FILEICONSET command to do it). ----------------------------------------------------------------------------- Sun, 7 Mar 2004 New command FileIconSet: FILEICONSET EXEFILENAME ICOFILENAME RESOURCEID LANGUAGE FILEICONSET EXEFILENAME ICOFILENAME STARTSLOTID STARTLANGUAGE ICONNAMENUMBER LANGUAGE ... EXEFILENAME is the EXE, SCR or DLL where you want the ICON update written ICOFILENAME is the filename of the ICO file If writing just a simple single icon to a single resource id: RESOURCEID defined which resource will be created (or overwritten) with the icon. LANGUAGE is the language to use (the default is 1033) for this icon. If writing a multi-image icon, or want to associate one icon with multiple resources then you should use an icon directory STARTSLOTID is the starting slot resource id to write an icon directory, normally 1 STARTLANGUAGE is the language used for all the icons written to a icon directory normally 1033 (US English). ICONNAMENUMBER is the resource id (either a number or string) to write the icon directory to. LANGUAGE is what language to use for this resources reference to the icon directory we have created (so not only can an icon have a language, a directory of icons also has it's own language). Common Language IDs include: Arabic 1025 Brazilian 1046 British English 2057 Bulgarian 1026 Croatian 1050 Czech 1029 Danish 1030 Dutch 1043 English 1033 Estonian 1061 Finnish 1035 French 1036 German 1031 Greek 1032 Hungarian 1038 Italian 1040 Japanese 1041 Korean 1042 Latvian 1062 Lithuanian 1063 Norwegian 2068 Polish 1045 Portuguese 2070 Romanian 1048 Russian 1049 Simplified Chinese 2052 Slovak 1051 Slovenian 1060 Spanish 3082 Swedish 1053 Thai 1054 Traditional Chinese 1028 Turkish 1055 Example that changes all the icons for a AfterGRASP application: FILEICONSET test.exe example.ico 1,1033 "PRINTER",1033 107,1033 108,1033 In this example: "PRINTER" is the icon used for the print dialog. ID107 is the main icon used by Explorer ID108 is the small icon used in the upper left hand corner of the window. The language id of 1033 (US English) is used for all cases. FILEICONSET is NOT supported in Windows 95/98/Me. It only works on WinNT, Win2000, WinXP, Win2003. ----------------------------------------------------------------------------- Wed, 3 Mar 2004 WINDOWFORCETOP OFF is now supported. ----------------------------------------------------------------------------- Tue, 2 Mar 2004 WINDOWFORCETOP which was a do nothing stub in both GLPRO and AfterGRASP now tries as hard as possible to force our window to the foreground. Here is the silly code which tries everything: void ForceTop(WINTHREAD *win) { OpenIcon(win->hwnd); PeekSleep(); SetForegroundWindow(win->hwnd); PeekSleep(); SetActiveWindow(win->hwnd); PeekSleep(); SetFocus(win->hwnd); PeekSleep(); SetWindowPos(win->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED+SWP_NOMOVE+SWP_NOSIZE+SWP_SHOWWINDOW); PeekSleep(); } ----------------------------------------------------------------------------- Mon, 1 Mar 2004 IMAGELOAD now supports CMYK and YCCK format JPEG files. The transformation to RGB is not perfect, it does not use the ICC info from the JPEG file. ----------------------------------------------------------------------------- Sun, 29 Feb 2004 IMAGESAVEGIF now saves 2 color (Black and White) images as truely 1 bit per pixel image files. This produces smaller GIF files, sometimes as much as 20% smaller. IMAGEPROCESS with INVERT and no PERCENTAGE is now special cased to not convert the image to 32bits per pixel, and does a very fast byte inversion. New command IMAGEFLOOD, used to generate masks, and anti-alias masks. It doesn't change the source image, instead it generates a 1 bit per pixel Black and White image. IMAGEFLOOD can either be called as a function which returns the mask image, or you can pass it the name of the variable to stick the mask image into. RESULTIMAGE = IMAGEFLOOD(SOURCEIMAGE) RESULTIMAGE = IMAGEFLOOD(SOURCEIMAGE,XPOS,YPOS) RESULTIMAGE = IMAGEFLOOD(SOURCEIMAGE,XPOS,YPOS,PERCENT) RESULTIMAGE = IMAGEFLOOD(SOURCEIMAGE,XPOS,YPOS,PERCENT,EDGECOLOR) IMAGEFLOOD SOURCEIMAGE MASKIMAGENAME IMAGEFLOOD SOURCEIMAGE MASKIMAGENAME XPOS YPOS IMAGEFLOOD SOURCEIMAGE MASKIMAGENAME XPOS YPOS PERCENT IMAGEFLOOD SOURCEIMAGE MASKIMAGENAME XPOS YPOS PERCENT EDGECOLOR The default XPOS and YPOS are 0 if not given. XPOS and YPOS support the full sizing and position syntax for coordinates, but the position and size info is relative to SORUCEIMAGE not the current window buffer. For instance: imageflood testimage testmask top left imageflood testimage testmask bottom left imageflood testimage testmask top right imageflood testimage testmask bottom right PERCENT is a floating point value that represents how far from the searched for color (or avoided color) can be different and still be considered a match. The default PERCENT is 0, meaning a percent match is required (much like the other FLOOD commands in AfterGRASP). If no EDGECOLOR is given, the flood is a traditional search surrounding pixels while they are the same color. If EDGECOLOR is given, then the flood searches including all pixels that are NOT the same as EDGECOLOR. If MASKIMAGENAME already exists, and is the same size as SOURCEIMAGE and is 1 bit per pixel, then it is not erased, the newly flooded area will be added (color 1 is used for new flooded areas). Here is a working example that uses IMAGEFLOOD to create an alpha mask to anti-alias a large image onto any background: windowsize 800 600 32 drawclear green imageload "First Class Milk-035.jpg" milk imageflood milk milkmask top left 4 ; 4 percent off color allowed imageflood milk milkmask top right 4 imageflood milk milkmask bottom left 4 imageflood milk milkmask bottom right 4 imageprocess milkmask invert imagesavegif milkmask ; for future use imagesize 640 0 8 milkmask imagesize 640 0 milk imagealphaset milk milkmask imageput milk forever ----------------------------------------------------------------------------- Wed, 25 Feb 2004 LAYER ANIM support is in! Has problems with transparency, and animated GIFs still needs work. LAYER REPEAT support added LAYER PATH support tested (and working) ----------------------------------------------------------------------------- Mon, 23 Feb 2004 Support added for: SCRENABLE SCRVALUEGET SCRVALUESET -------