Hi,
Im using Gauss11 (so "ftos" is not an option) and I just want to number variable names in a loop. The idea is the following:
k=1;kmax=7;
do until k==kmax;
string'k' = "Hello";
k=k+1;
endo;
So I end up with string1, string2, string3... all equaling "Hello".
I know it should be pretty much simple, but anyway. Help is highly appreciated.
Best regards, kurt
1 Answer
0
In most cases, it is much better to create an array of strings instead of a bunch of separate variables.
For example:
kmax = 7;
my_strings = reshape("Hello", kmax, 1);
then you can access them by index.
print my_strings[4];
Your Answer
1 Answer
0
In most cases, it is much better to create an array of strings instead of a bunch of separate variables.
For example:
kmax = 7;
my_strings = reshape("Hello", kmax, 1);
then you can access them by index.
print my_strings[4];