Hi folks
I need to find a way, if there is one, to retrieve ASP variable values in the following way:
Const FIELD_SIZE = 10
Const FIELD_NAME = "FirstName"
response.write ("<input type=text size=" &
getFieldAttr("SIZE")& " name=" &
getFieldAttr("SIZE") & ">Some name")
function getFieldAttr (attr)
getFieldAttr = XX code to retrieve the constant with name "FIELD_" followed by the value of attr XX
end function
I realise this can be done using session variables, whose names can easily be constructed from concatenating strings, but I would prefer to avoid session variables in this case if possible. It might seem useless but I have a large number of constants to be referred to in this way and want to keep central control of access to their values in the one function (eg in case i change the naming convention for the const's). Am happy to incorporate
js into this if necessary, since its a local site and only used by me. Thanks. Feel free to criticise my design choice if appropriate! I'm a relative beginner.