If your variable is sometimes undefined then you can replace it with a
default.
$variable_to_pass = $variable || "Default";
print "$variable_to_pass\n";
$variable = "Now this is set";
$variable_to_pass = $variable || "Default";
print "$variable_to_pass\n";
-----Original Message-----
From: Kim Green [mailto:[EMAIL PROTECTED]]
Sent: 29 June 2001 14:27
To: '[EMAIL PROTECTED]'
Subject: Optional Variables
What's the proper syntax to indicate that a variable is optional? The script
that I have created works great when I pass in a variable, but the script
need to execute the SQL even if I don't pass in a variable.
Thanks,
Kim
--------------------------Confidentiality--------------------------.
This E-mail is confidential. It should not be read, copied, disclosed or
used by any person other than the intended recipient. Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful. If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.