General information
Category:
Coding, syntax & commands
>>I have a form that I would like to open either with or without parameters. Some forms call this form with a specific record in mind, from other forms, the form should open and go to a default record. The problem is, if I have issued a lparameters statement, and there were no parameters passed the seek attempts to seek on an .F. and crashes. My question is, is there a way to set a default value for a variable? When I try "If myvar = .F. then myvar = 1 endif" it fails because myvar has already been assigned a boolean datatype by default. How can I work around this?
>
>IF TYPE('myvar')='C'
> we have a parameter
>ENDIF
You could also use the Parameters() Fn. Returns the number parameters you were passed. Only more usefull than checking TYPE("") if you're expecting a logical parameter.
ps Do remember the quotes in the TYPE() function they are incredibly important.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only