Skip to main content
Solved

put in loop for writing to text file

  • June 3, 2019
  • 2 replies
  • 186 views

Hi,

The CSV Export DLL does seem to export 0-dim identifiers. Therefore I would like to use put.
However I can't figure out how to obtain the value of that 0-dim variable.
I have the next snippet of code, which works fine, but the value of the variable is still missing.

code:
for (IndexVariables) do
if (IdentifierDimension(IndexVariables)) then
!do something else
else
csv_alt_name := FolderName + IndexVariables + ".csv";
put csv_alt;
put IndexVariables + "\n";
put name_of_some_variable;
putclose;
endif;
endfor;


The line "put name_of_some_variable;" prints the value of a variable. But it should of course print the value referred to by IndexVariables. How to do that?

Best answer by Chris Kuip

Hi,

To obtain the value of the referenced variable, you can use the same technique as used in https://how-to.aimms.com/Articles/146/146-value-dynamic-identifier.html

Hope this helps.

2 replies

Jess Es
Forum|alt.badge.img+6
  • Grand Master
  • 121 replies
  • July 11, 2019
Hi @wiet I'm afraid this question was overlooked for a while - did you find the answer? Or do you still need help?

Chris Kuip
AIMMSian
Forum|alt.badge.img+7
  • AIMMSian
  • 125 replies
  • Answer
  • July 13, 2019
Hi,

To obtain the value of the referenced variable, you can use the same technique as used in https://how-to.aimms.com/Articles/146/146-value-dynamic-identifier.html

Hope this helps.


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator