S
Siv
Hi,
I want to write a function that I pass a string to that is the name of one
of my properties in my class.
I.e. My class could have 3 properties:
Forname
Surname
Initials
etc
I want to call my function like this:
RetVal=MyFunction("Surname")
Inside the function I will instantiate the class, call a routine that
populates the class with data from a given record in my database and then
using the passed string variable identify if the property with that name has
any value in it from the record, I will then return a true or false to the
caller, in my example populating the RetVal variable.
I can't figure out how I use the passed string to get at the one particular
property the caller wants to check. In my head using pseudo code I want to
say:
if MyClass(ParameterVariable) <> "" then
return True
else
return False
end if
I assume I would have to do something to my class to make that sort of
notation work??
Any help appreciated.
Siv
I want to write a function that I pass a string to that is the name of one
of my properties in my class.
I.e. My class could have 3 properties:
Forname
Surname
Initials
etc
I want to call my function like this:
RetVal=MyFunction("Surname")
Inside the function I will instantiate the class, call a routine that
populates the class with data from a given record in my database and then
using the passed string variable identify if the property with that name has
any value in it from the record, I will then return a true or false to the
caller, in my example populating the RetVal variable.
I can't figure out how I use the passed string to get at the one particular
property the caller wants to check. In my head using pseudo code I want to
say:
if MyClass(ParameterVariable) <> "" then
return True
else
return False
end if
I assume I would have to do something to my class to make that sort of
notation work??
Any help appreciated.
Siv