how to set and read two values in one variable using TCl?

sanket_patil
sanket_patil Altair Community Member
edited October 2020 in Community Q&A

how to set and read two values in one variable using TCl?

Answers

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited November 2018

    Hi Sanket,

     

    You can use TCL list. Do elaborate your requirement. 

  • sanket_patil
    sanket_patil Altair Community Member
    edited November 2018

    I want to read a value from excel sheet. so i was thinking to set  ids for 'Row' and 'Column' and that will hepl me to read that cell.

     

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited November 2018

    TCL array or dictionary should be ideal. 

     array set myarray [list]  set myarray(0,1) 'data1';  set myarray(0,2) 'data2';

     

  • sanket_patil
    sanket_patil Altair Community Member
    edited November 2018

    I have row index and column index. using that i want to read cell. after that if condition is false row index should increment and check for next rows also.And if condition is true it should give me some output. Can ypu please help in for this?

    Thanks.

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited November 2018

    Try setting up the array like this:

     set rowindex 0;  set columnindex 0;  set myarray($rowindex,$columnindex) 'data1';  incr rowindex;