Using *evaltclstring in globalpage.mac with double quotes inside

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

How can I use the *evaltclstring function in a globalpage.mac file in hypermesh when the tcl string inside it also has double quotes, such as,

 *evaltclstring('set t1 [string map {'\n\n' '\n'} $t1]; puts $t1;',0)

Any help is appreciated because the above command results in my hypermesh becoming unresponsive on startup.

 

Thank you.

Answers

  • tinh
    tinh Altair Community Member
    edited March 2017

    Hi,

     

    don't mess up macro file, just wrap the tcl command in a proc, and use *evaltclstring to invoke that proc

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2017

    Hi,

     

    don't mess up macro file, just wrap the tcl command in a proc, and use *evaltclstring to invoke that proc

    @tinh : How would I use evaltclstring to invoke a proc and where should I be defining the proc itself ?

     

    Additionally, I'd also like to know, just for the sake of completeness, that how could I escape double quotes inside double quotes while using *evaltclstring ?

  • tinh
    tinh Altair Community Member
    edited March 2017

    I think I already gave an example using evaltclstring to invoke your user page on utility tab. just refer to it