AfterGrasp GLPRO replacement project start Feb 27th, 2002 ---------------------------------------------------------------------------- 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 event 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 event 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 updat