This version of RES-Reach includes several library functions which can be used in conjunction with private and public variables. Please note that limited support is being provided for them. The general syntax for these SET tags is:
Before any of these functions can be used, the run-time variable LIBS must be assigned the RES-Reach library:<SET VARIABLE="varname" FUNCTION="someFunction" VALUE="functionInputValue">
If you omit this run-time variable assignment, a parsing error will be triggered.<SET VARIABLE="_RUN.LIBS" VALUE="R32DLL.DLL">
|
Function |
Description |
|
URLENC |
URL encode the given string. The VALUE element is not optional. Syntax:
|
|
UPPER |
Uppercase the given string. The VALUE element is not optional. Syntax:
|
|
LOWER |
Lowercase the given string. The VALUE element is not optional. Syntax:
|
|
ASC |
Return the ASCII code for the specified character. The VALUE element is not optional. Syntax:
|
|
CHR |
Return the character for the specified ASCII code. The VALUE element is not optional. Syntax:
|
|
INCR |
Increment the number in the input string. The VALUE element is not optional. Syntax:
|
|
DECR |
Decrement the number in the input string. The VALUE element is not optional. Syntax:
|
|
TOGMT |
Convert the input time to GMT time of the form "Weekday, DD MMM YYYY HH:MM:SS GMT". Some acceptable input date formats are: 1. mm/dd/yyyy hh:mm:ss2. dd/mm/yyyy hh:mm:ss 3. hh:mm:ss 4. hh:mm 5. dd/mm/yyyy 6. dd-mm-yyyy 7. mmm dd, yyyy hh:mm:ss 8. dd mmm yyyy Where mm/dd/yyyy and dd/mm/yyyy are indistinguishable, mm/dd/yyyy is assumed. Where information is missing, the current server date and time are assumed. The VALUE element is not optional. To get the current server date and time set the VALUE element to the empty string. Syntax:
|
|
RANDOM |
Return a random number. The VALUE element is optional. If supplied, it is used as a random number generator seed. Syntax:
|
Notes:
Example Statements:
<SET VARIABLE="_RUN.LIBS" VALUE="R32DLL.DLL"> <SET VARIABLE="UPVAR" FUNCTION="UPPER" VALUE="this was lowercase"> UPPER("this was lowercase"): {UPVAR}<BR><SET VARIABLE="TEMPVAR" FUNCTION="LOWER" VALUE="{UPVAR}"> LOWER("{UPVAR}") : {TEMPVAR}<BR><SET VARIABLE="URLSTR" FUNCTION="URLENC" VALUE="http://res12.res.ca/cgi-bin/member.exe?NBT=testsuites/res-reach/normal/funcs.nbt"> URLENC("http://res12.res.ca/cgi-bin/member.exe?NBT=testsuites/res-reach/normal/funcs.nbt"): {URLSTR}<BR><SET VARIABLE="ASCII" FUNCTION="ASC" VALUE="A"> ASC('A') : {ASCII}<BR><SET VARIABLE="CHR" FUNCTION="CHR" VALUE="97"> CHR(97) : {CHR}<BR><SET VARIABLE="INCVAR" FUNCTION="INCR" VALUE="12345"> INCR(12345) : {INCVAR}<BR><SET VARIABLE="DECVAR" FUNCTION="DECR" VALUE="987"> DECR(987) : {DECVAR}<BR><SET VARIABLE="RND" FUNCTION="RANDOM"> RANDOM : {RND}<BR><SET VARIABLE="RND" FUNCTION="RANDOM" VALUE="123"> RANDOM(123) : {RND}<BR><SET VARIABLE="GMT" FUNCTION="TOGMT" VALUE="19-08-2010 23:30"> TOGMT("19-08-2010") : {GMT}<BR><SET VARIABLE="GMT" FUNCTION="TOGMT" VALUE="Jun 9, 1999 16:32"> TOGMT("Jun 9, 1999 16:32") : {GMT}<BR><SET VARIABLE="GMT" FUNCTION="TOGMT" VALUE="23:32:30"> TOGMT("23:32:30") : {GMT}<BR>