Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would appreciate for any comment/solution on such case:
Given such table: Master
Department |
---|
Equity |
Bond-Corporate |
Guild |
Commodity |
.....(and so on) |
I would like to create such loop with a=, b= , c=.....
Let vMax=NoOfRows('Master')
For i=0 to vMax-1
Let a = Peek('Department',$(i),'Master');
Next
Is there any way that I can dynamically generate the variable so that when loop goes on, I get
a='Equity'
b='Bond-Corporate'
c='Guild'
d='Commodity'
......
and so on.
These values are used in the front-end purpose. (mainly text boxes etc.)
I would appreciate for any feedbacks.
May be like this
Master:
LOAD * INLINE [
Department
Guild
Equity
Commodity
Bond-Corporate
];
Let a=65;
Let vMax=NoOfRows('Master');
For i=0 to vMax
Let A=Chr($(a));
LET $(A) = Peek('Department',$(i)-1,'Master');
a=a+1;
Next
May be like this
Master:
LOAD * INLINE [
Department
Guild
Equity
Commodity
Bond-Corporate
];
Let a=65;
Let vMax=NoOfRows('Master');
For i=0 to vMax
Let A=Chr($(a));
LET $(A) = Peek('Department',$(i)-1,'Master');
a=a+1;
Next
Master:
LOAD * INLINE [
Value
Department
Guild
Equity
Commodity
Bond-Corporate
];
For i = 0 to NoOfRows('Master')-1
LET vName = chr(ord('a') + $(i));
LET $(vName) = Peek('Value', i, 'Master');
Next i
Sorry kept you waiting for my reply. Yes this works, and since you are the first person, I award you.
Thank you for your answer, and sorry for the late reply. Yes this works!