🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

TCL script with http under Hypermesh

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hi,

I have a simple script :


package require http;
set myurl 'http://mysite/file.txt';

proc getPage { url } {
set token [::http::geturl $url]
set data [::http::data $token]
::http::cleanup $token
return $data
}

set file [ getPage $myurl ]
puts '$file'

With TCL 8.5 under Windows 7, I can run this script without problem.

But when I try to run under Hypermesh session (via : source ....) I got error message :

 

========================================

Main console display active (Tcl8.5.9 / Tk8.5.9)

(hw13) 1 % source C:/Users/MYNAME/test.tcl

couldn't open socket: invalid argument

========================================

 

I don't know why this script does not work under Hypermesh.

 

Any idea for help ?

 

Thanks,

 

UPDATE: it works well when I try command line within cmd window:


'C:\Program Files\Altair\13.0\hw\tcl\tcl8.5.9\win64\bin\tclsh85.exe' test.tcl

Find more posts tagged with

Sort by:
1 - 8 of 81
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi Mr Quy

    I try with hm12 and it worked

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hi Mr Quy

    I try with hm12 and it worked

     

    Really? I have removed HM12 some month ago.

    I'm waiting for release 14 now.

    User: "Merula_20758"
    Altair Community Member
    Updated by Merula_20758

    I tried it both in 12 and 13 and neither of them works for me... same error in 12.

    Also tried it with adminstator rights... no success. But I still think its some permisson error....

     

    Best regards,

    Merula

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    WORKAROUND: the same task is written by Perl. From TCL, use 'exec ...'.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hello I'm getting this error stating 'Main console display active (Tcl8.5.9 / Tk8.5.9)
    (Documents) 1 % '

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hello I'm getting this error stating 'Main console display active (Tcl8.5.9 / Tk8.5.9)
    (Documents) 1 % '

    It is not error message. It is headlines of tkconsole

     

    User: "Abdul Muizz Jamal"
    Altair Community Member
    Updated by Abdul Muizz Jamal

    Hello I'm getting this error stating 'Main console display active (Tcl8.5.9 / Tk8.5.9)
    (Documents) 1 % '

    It is not error message. It is headlines of tkconsole

     

    But how to remove it?? I can't open the Countours Tab to view the results. I am having this same issue
    User: "BenGoba"
    Altair Community Member
    Updated by BenGoba

    We've had luck with the Windows 'start' command to load Word files and URLs from within the HyperMesh TCL environment.  If you are still facing the issue, you can try something similar to:

    exec cmd /c start "https://altair.com"

     

    Hopefully letting Windows handle opening the page will work better.