What i mean is something like:
I have 2 array var and type, you can input the name of the variable on the var array and type of variable on the type array(type depend on language used), then i want to use the value from these array to define varriable i.e:
Var[1] as type[1]
Var[2] as type[2]
Is it possible to do something like that?
Second question:
Can i auto increase variable name which contain number? I want to do something that work like array but using normal variable. For example :
I have 10 variable f1~f10
Then i want to loop it until all variable filled, something like
For a=1 to 10 do
{
f(a) = a
}
Sorry if it is hard to understand i cant explain it very well. I want to know is possible in general programming, specifically pascal because i study alghoritm using this language in college.
2
What is it that you are trying to do? The way that you are trying to do it is possible in lexical languages, but not pascal.
You can though look-up an array by name. This is sort of the opposite of what you asked, but in some ways very similar.
type
MonthType = (January, February, March, April,
May, June, July, August, September,
October, November, December);
Then use this to look up an array
ord(December)
Gives 11
, so you could use it to look up days in month.
By pascal programming skills are useless, so someone else can fix and extend this answer.
http://wiki.freepascal.org/Enumerated_types
7