Jump to content
gwjwin

How to pass arguments to tcl script on Hyperworks start

Recommended Posts

Hi,
I have a tcl script and the tcl is using Hyperworks(Hyperview) library, so I must run it with Hyperview.
I check the help doc and found the following command to load tcl:

<altair_home>/hw/bin/<platform>/hw.exe -clientconfig hwpost.dat -tcl example.tcl

But I cannot pass an argument to the tcl.
For example, I can run this tcl using:

tclsh example.tcl arg1 arg2 ...

The arguments arg1, arg2 will be passed to tcl script, Can I do this using hw.exe -tcl command?

Thanks!

Share this post


Link to post
Share on other sites

Hi

you can do it normally

hw.exe -clientconfig hwpost.dat -tcl example.tcl arg1 arg2

 

you will scan these args right after "example.tcl", so

set arglist [lrange $args [lsearch -exact $args "example.tcl"] end]

lassign $arglist TclFileName arg1 arg2

Merula likes this

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...