Download Here

Transcript
Chapter 8: Macros
The url argument is required, and can use any of the following formats:
•
‘/file.htf’ -or- ‘/subdir\file.htf’
The file string is relative to the Directory parameter. The resulting URL will be
‘http://<server IP address>:<port #>/file string’.
•
‘file.htf’ -or- ‘subdir\file.htf’
The file string is relative to the directory of the current form. The resulting URL will be
‘http://<server IP address>:<port #>/<current location>/file string’. A variation on this
format is ‘..\file.htf’. For each ‘..\’ sequence, one moves up one level of directory from
that in which the form doing the {reDirect…} was located. However, it is NOT possible
to move up in the directory structure past the Directory. For example, if the Directory
parameter is set to ‘c:\http’, it is not possible to access a file in ‘c:\’ or ‘c:\otherDir’.
Aliasing can be used to access files in other directories or devices on the server system.
•
‘http://www.mySite.com/default.htm’
The URL/file string is the complete URL.
Note:
If any cookie variables are set using the {setCookie} macro in the form prior to the
redirect macro being invoked, these cookies are returned to the browser, but the
browser ignores them. The cookies will not subsequently be returned to the server
by the browser.
Example 8.24
reDirect Macro
{reDirect 'http://www.Mysite.com/'}
{reDirect2 <arg>} {/reDirect2}
The format of the reDirect2 macro is identical to that of the reDirect macro, but allows
arguments to be appended to the command line by specifying them as
arg1 = value
arg2 = value
The arguments are specified one per line between the {reDirect2 ...} and {/reDirect2} macros
(just as in the call macro). While it is possible to do this using the reDirect macro, it is rather
difficult. The following shows how the same result would be done using both the reDirect2
and reDirect macros.
Example 8.25
reDirect2 Macro
{reDirect2 './abc.htf'}
name=John Q Public
id = 12.34
{/reDirect2}
{reDirect './abc.htf?name=John+Q+Public&id=12%3E34'}
{remove <varNames>}
The remove macro removes the variable with the specified varName from the topmost scope
(see scope macro) or local variable if found. If no variable is found in either the scope or local
98
WebBase User’s Guide