由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - IDL一问
相关主题
perl eval and ifc的问题(2)
rust现在很火C++ 的 问题
*** help needed! on MATLAB GUI ***Python problem on 64 bit Linux
Help!! variable scope ????g++ compilation problem in linux
一个简单的算法问题?strcat()
请看看这个Perl random sampling code 有什么问题,数组问题
c++ template中如何判断类型请教一个基础C++问题
这个怎么allocate memory?Solaris CC compiler 如何从pipe读取文件,而不是从硬盘?
相关话题的讨论汇总
话题: b1话题: b2话题: data话题: do话题: string
进入Programming版参与讨论
1 (共1页)
a*******r
发帖数: 7558
1
I have data arrays such as b1, b2, b3,...b100...
To do operations like b2/b1, b3/b1,...., I first do this:
FOR i=1, n DO BEGIN
my_data='b'+strtrim(string(i),1)
ENDFOR
Now the string my_data has become b1, b2,..., but how to
convert the string my_data to reference array data b1, b2...?
There must be such a conversion in IDL but I haven't found,
please help. 3x.
a***f
发帖数: 45
2
According to my experience, there is no way to do it.
You have to convert b1, b2, ... to b[1], b[2], ...
a*******r
发帖数: 7558
3

有人提出了以下两种办法,供参考。
here are the two methods:
1. Use SCOPE_VARFETCH, which can be compiled in a Runtime program, if
necessary.
The syntax "myArray[i] = scope_varfetch('var')" will copy the value of a
variable named "var" that is
defined in the current scope (scope is where you are running in the current
"call stack" - what routine
call you are currently running in) into 'myArray'.
2. Use EXECUTE, which cannot be compiled in a .sav Runtime program:
EXECUTE treats its string argument as a command th

【在 a***f 的大作中提到】
: According to my experience, there is no way to do it.
: You have to convert b1, b2, ... to b[1], b[2], ...

1 (共1页)
进入Programming版参与讨论
相关主题
Solaris CC compiler 如何从pipe读取文件,而不是从硬盘?一个简单的算法问题?
我有个很傻的问题,关于function call via pointer请看看这个Perl random sampling code 有什么问题,
求文件 mclmcrrt711.dll 下载c++ template中如何判断类型
问一个leetcode的排序问题这个怎么allocate memory?
perl eval and ifc的问题(2)
rust现在很火C++ 的 问题
*** help needed! on MATLAB GUI ***Python problem on 64 bit Linux
Help!! variable scope ????g++ compilation problem in linux
相关话题的讨论汇总
话题: b1话题: b2话题: data话题: do话题: string