[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Obtaining variable names as strings



Hi All,
    I have an include file containing both variable definitions and COMMON block(s). I need to obtain a string representing a variable name that is set to a unique value.

Pro Get_val
@Vars.inc
.....
End

File Vars.inc:-
    Fred = 100
    Joe =200
    .....
    Mary = 725
    Anne = 812
Common Rubbish,Fred,Joe,....Mary, Anne

For instance, if the user gives a value of 200, I require to give the string 'Joe'.

I have been able to use the Help,name='*',out=xxxx to get a list of all variables, which can then be interrogated. However, there are a significant number of variables and I'm concerned about the time taken to perform this in a time-critical operation.

Some added info:

1) Is it possible to get a list of common variable names (like IDLDE provides) ?
2) The final program is in "SAVed" format and no longer has access to the build files.
3) The format of the include files is sacrosanct and are defined by external sources.
4) Each of the numbers (100,200....725,812) are unique within this file (but obviously not throughout a run).

I hope there is someone out there who can help, or give me some useful pointers.

Regards,
    Ian