[thelist] VARIABLE(s): asp/vbscript (referencing/pointers)

Chris W. Parker cparker at swatgear.com
Wed Jun 26 11:35:00 CDT 2002


hi.

i don't know if "reference" or "pointer" is the right term for what i'm
trying to achieve, so let me just explain.

can i use one variable (say myVar1) to contain the value of another
variable (say myVar2) by holding the name of the second variable? i
think this is a pointer, but i'm not sure so i had a hard time finding
anything through google.

the way i'm trying to use this is by creating a master file that
contains all the error messages that can be used throughout my site as
Constants. i then want to through the querystring (on a redirect if in
an error in a form is found) the name of one of the error message
variables.

here is an example...

page1.asp contains the form the user will be filling out and also
include's the error message(s).  the "processing" page called page2.asp
will redirect the user if an error is found in the form with this...

Response.Redirect("page1.asp?errMsg=C_Err1")

the included file that contains the error messages is defined like so...

Const C_Err1 = "You suck and the form field is blank. Please reenter
it."
Const C_Err2 = "You're ugly, please fix that."

and of course as would be expected, when i
Response.Write(Request("errMsg")) it writes "C_Err1" instead of C_Err1's
value.

how can i get it's value to be printed?


thanks,
chris.



More information about the thelist mailing list