New build of AfterGRASP is up for download:
http://www.aftergrasp.com/download/agsetup_20080224.exe
--------------------------------------------------------------------------- -
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 "<html>"
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).
--------------------------------------------------------------------------- -