Re: Renaming variables using strings
- From: NBT <nthammakhoune@xxxxxxxxx>
- Date: Thu, 12 Jan 2006 10:50:26 -0500
Kristjan Tabri wrote:
>
>
> Hi all,
> I have a big database with several variables inside. Now I would
> like
> to assign some other names for the variables. One script makes a
> strings of these variable names according to some routine. For
> example, i have a variable in database called F101 and the script
> makes a string 'F101'. I would like to rename the variable F101 as
> dataF. As I have the variable name just as an automatically
> generated string (by ['F','101'], I do not know how to rename the
> variable. Commands dataF='F101' and dataF=str2num('F101') do not
> work
> in such a case. When dataF='F101' is used the existing variable is
> just rewritten and obtains a value of the string and
> str2num('F101')
> does not work as F101 cannot be turned into a number.
>
> Any idea how to do it?
>
> Regards,
> kristjan
use eval
str='F101'
eval(['DataF=',str,';'])
NBT
.
- Follow-Ups:
- Re: Renaming variables using strings
- From: us
- Re: Renaming variables using strings
- References:
- Renaming variables using strings
- From: Kristjan Tabri
- Renaming variables using strings
- Prev by Date: Re: Symbolic determinant, C output
- Next by Date: Re: xPC and Harddrive help
- Previous by thread: Renaming variables using strings
- Next by thread: Re: Renaming variables using strings
- Index(es):
Relevant Pages
|
Loading