Solved

put in loop for writing to text file

  • 3 June 2019
  • 2 replies
  • 173 views

Userlevel 1
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?
icon

Best answer by Chris Kuip 13 July 2019, 15:33

View original

2 replies

Userlevel 6
Badge +6
Hi @wiet I'm afraid this question was overlooked for a while - did you find the answer? Or do you still need help?
Userlevel 5
Badge +7
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.

Reply


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

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