If you want to do default values, you might do something like this:
defaults: make object [
orden: 99
dia: 1
year: 2000
mes: 1
]
cgi: make defaults decode-cgi system/options/cgi/query-string
To just trap a single error, you might do this:
if error? try [print cgi/dia] [
; what to do in case of an error goes here
]
if you are unfamilar with 'error? and 'try take a look at
<http://www.nmia.com/cgi-bin/cgiwrap/rebol/wiki.r?wiki=error%3F>
and
http://www.nmia.com/cgi-bin/cgiwrap/rebol/wiki.r?wiki=try
Good luck!
--
Andrew Grossman
http://web.dartmouth.edu/~grossman/
--- [EMAIL PROTECTED] wrote:
Where i can fid how to trap errors?
specially how i can check that all the arguments of a
cgi scrips exists?
I tried to put default values before decoding the query-srting, like:
cgi-form: make object! [ =20
orden: 99
dia: 1
year: 2000
mes: 1
]
cgi: make object! decode-cgi system/options/cgi/query-string =20
but if, "dia" is not in the query-string, its erased by the make object!
order.
then if i try to acces
print cgi/dia =20
I have an error....
How i can handle this error?
Although i put a little verification in javascript in the=20
calling page, it there is no JS, or it's not activated,
an empty form can be submited....
--- end of quote ---