Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Consistency requires you to be as ignorant today as you were a year ago." -- Bernard Berenson


devel / comp.lang.tcl / running a TCL/tk program in different modes

SubjectAuthor
* running a TCL/tk program in different modesMark Tarver
`* Re: running a TCL/tk program in different modeset99
 +- Re: running a TCL/tk program in different modesMark Tarver
 `* Re: running a TCL/tk program in different modesMark Tarver
  `- Re: running a TCL/tk program in different modeset99

1
running a TCL/tk program in different modes

<137fed53-ecd2-42f7-8aa6-d826c278f1f5n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12883&group=comp.lang.tcl#12883

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:3916:b0:784:bc0:8f53 with SMTP id qr22-20020a05620a391600b007840bc08f53mr26326qkn.0.1706684329221;
Tue, 30 Jan 2024 22:58:49 -0800 (PST)
X-Received: by 2002:a05:620a:3728:b0:785:39c2:f7f5 with SMTP id
de40-20020a05620a372800b0078539c2f7f5mr26602qkb.11.1706684328992; Tue, 30 Jan
2024 22:58:48 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 30 Jan 2024 22:58:48 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=86.28.97.229; posting-account=kJbRXgoAAADVvCa8xCOuqxtZ-KSaXUAS
NNTP-Posting-Host: 86.28.97.229
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <137fed53-ecd2-42f7-8aa6-d826c278f1f5n@googlegroups.com>
Subject: running a TCL/tk program in different modes
From: dr.mtar...@gmail.com (Mark Tarver)
Injection-Date: Wed, 31 Jan 2024 06:58:49 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1763
 by: Mark Tarver - Wed, 31 Jan 2024 06:58 UTC

I have now constructed a batch file that enables me to run two communicating processes - in principle. The problem now is the way the TCL process is run. Here is the manual way I'm having to do it.

1. Start TCL/Tk by clicking on WISH which gives me a console window.
2. Load eventloop.tcl using the console (process A).
3. Optionally, kill the console.
4. Open sbcl-shen.exe (process B, with the communicating program preloaded).

This works. However if I vary this routine as follows.

1. Load eventloop.tcl by clicking on it (process A).
2. Open sbcl-shen.exe (process B, with the communicating program preloaded).

Then I get two windows but process B cannot talk to process A. This two step routine is the routine in my Windows batch file.

Mark

Re: running a TCL/tk program in different modes

<upd3ll$1f1g7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12884&group=comp.lang.tcl#12884

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.bbs.nz!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: running a TCL/tk program in different modes
Date: Wed, 31 Jan 2024 01:25:09 -0800
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <upd3ll$1f1g7$1@dont-email.me>
References: <137fed53-ecd2-42f7-8aa6-d826c278f1f5n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 31 Jan 2024 09:25:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8eaa76106ba84944d88acc32dcb0234d";
logging-data="1541639"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SLRY+UKgAY/VEoLr4ySzW"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:TQAde50ZXiMJ0F6iG0mXBUvJPbc=
In-Reply-To: <137fed53-ecd2-42f7-8aa6-d826c278f1f5n@googlegroups.com>
Content-Language: en-US
 by: et99 - Wed, 31 Jan 2024 09:25 UTC

On 1/30/2024 10:58 PM, Mark Tarver wrote:
> I have now constructed a batch file that enables me to run two communicating processes - in principle. The problem now is the way the TCL process is run. Here is the manual way I'm having to do it.
>
> 1. Start TCL/Tk by clicking on WISH which gives me a console window.
> 2. Load eventloop.tcl using the console (process A).
> 3. Optionally, kill the console.
> 4. Open sbcl-shen.exe (process B, with the communicating program preloaded).
>
> This works. However if I vary this routine as follows.
>
> 1. Load eventloop.tcl by clicking on it (process A).
> 2. Open sbcl-shen.exe (process B, with the communicating program preloaded).
>
> Then I get two windows but process B cannot talk to process A. This two step routine is the routine in my Windows batch file.
>
> Mark
From the sound of the file name, eventloop.tcl, is this a small piece of tcl code you're experimenting with? Can you post this file?

And the .exe, what is that? Do you have its source code; what language is it? What does comm prog preloaded mean? Is it a tclkit/starpak or something else.

Re: running a TCL/tk program in different modes

<91fd1583-0be1-4acd-b0f7-e2b28ee34afdn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12885&group=comp.lang.tcl#12885

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:1752:b0:429:e320:2bae with SMTP id l18-20020a05622a175200b00429e3202baemr40796qtk.11.1706701118123;
Wed, 31 Jan 2024 03:38:38 -0800 (PST)
X-Received: by 2002:a05:620a:2403:b0:783:f7e2:8ff4 with SMTP id
d3-20020a05620a240300b00783f7e28ff4mr14191qkn.0.1706701117812; Wed, 31 Jan
2024 03:38:37 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 31 Jan 2024 03:38:37 -0800 (PST)
In-Reply-To: <upd3ll$1f1g7$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=86.28.97.229; posting-account=kJbRXgoAAADVvCa8xCOuqxtZ-KSaXUAS
NNTP-Posting-Host: 86.28.97.229
References: <137fed53-ecd2-42f7-8aa6-d826c278f1f5n@googlegroups.com> <upd3ll$1f1g7$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <91fd1583-0be1-4acd-b0f7-e2b28ee34afdn@googlegroups.com>
Subject: Re: running a TCL/tk program in different modes
From: dr.mtar...@gmail.com (Mark Tarver)
Injection-Date: Wed, 31 Jan 2024 11:38:38 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3716
 by: Mark Tarver - Wed, 31 Jan 2024 11:38 UTC

On Wednesday 31 January 2024 at 09:25:14 UTC, et99 wrote:
> On 1/30/2024 10:58 PM, Mark Tarver wrote:
> > I have now constructed a batch file that enables me to run two communicating processes - in principle. The problem now is the way the TCL process is run. Here is the manual way I'm having to do it.
> >
> > 1. Start TCL/Tk by clicking on WISH which gives me a console window.
> > 2. Load eventloop.tcl using the console (process A).
> > 3. Optionally, kill the console.
> > 4. Open sbcl-shen.exe (process B, with the communicating program preloaded).
> >
> > This works. However if I vary this routine as follows.
> >
> > 1. Load eventloop.tcl by clicking on it (process A).
> > 2. Open sbcl-shen.exe (process B, with the communicating program preloaded).
> >
> > Then I get two windows but process B cannot talk to process A. This two step routine is the routine in my Windows batch file.
> >
> > Mark
> From the sound of the file name, eventloop.tcl, is this a small piece of tcl code you're experimenting with? Can you post this file?
>
> And the .exe, what is that? Do you have its source code; what language is it? What does comm prog preloaded mean? Is it a tclkit/starpak or something else.

TCL, yes sure. The exe file is a saved SBCL (Lisp) image holding a port of the Shen language.

# TCL event loop

set in {C:/Users/shend/OneDrive/Desktop/Shen/S38/shen-to-tcl.txt}
set out {C:/Users/shend/OneDrive/Desktop/Shen/S38/tcl-to-shen.txt}

proc eventloop {File} {
while { 1 } {
after 10
if { [newcommand? $File] } {
enact $File }
update }}

proc newcommand? {File} {
set Source [open $File r]
set Data [read $Source]
set Verdict [eot? $Data]
close $Source
return $Verdict}

proc eot? {S} {
return [ string match *eot $S ]
}

proc enact {File} {
set Source [open $File r]
set Data [read $Source]
set Command [trim $Data]
overwrite $File
if { [catch $Command result] != 0 } then {
err $result}
close $Source}

proc overwrite {File} {
set Sink [open $File w]
puts -nonewline $Sink ""
flush $Sink
close $Sink}

proc trim {S} {
return [string map {"eot" ""} $S]
}

proc mysend {String} {
global out
set Sink [open $out w]
puts $Sink [concat $String "eot"]
close $Sink}

proc err {String} {
set Format [myformat $String]
mysend [concat "(error \"" $Format "\")"]}

proc myformat {String} {
return [string map {\" ""} $String]}

eventloop $in

Re: running a TCL/tk program in different modes

<7bc00dc6-afab-4068-a594-ab13fb99e705n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12886&group=comp.lang.tcl#12886

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:4047:b0:785:343b:a46f with SMTP id i7-20020a05620a404700b00785343ba46fmr13057qko.8.1706704302292;
Wed, 31 Jan 2024 04:31:42 -0800 (PST)
X-Received: by 2002:ac8:5789:0:b0:42a:aa59:d9b with SMTP id
v9-20020ac85789000000b0042aaa590d9bmr56263qta.2.1706704302031; Wed, 31 Jan
2024 04:31:42 -0800 (PST)
Path: i2pn2.org!i2pn.org!news.swapon.de!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 31 Jan 2024 04:31:41 -0800 (PST)
In-Reply-To: <upd3ll$1f1g7$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=86.28.97.229; posting-account=kJbRXgoAAADVvCa8xCOuqxtZ-KSaXUAS
NNTP-Posting-Host: 86.28.97.229
References: <137fed53-ecd2-42f7-8aa6-d826c278f1f5n@googlegroups.com> <upd3ll$1f1g7$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7bc00dc6-afab-4068-a594-ab13fb99e705n@googlegroups.com>
Subject: Re: running a TCL/tk program in different modes
From: dr.mtar...@gmail.com (Mark Tarver)
Injection-Date: Wed, 31 Jan 2024 12:31:42 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mark Tarver - Wed, 31 Jan 2024 12:31 UTC

On Wednesday 31 January 2024 at 09:25:14 UTC, et99 wrote:
> On 1/30/2024 10:58 PM, Mark Tarver wrote:
> > I have now constructed a batch file that enables me to run two communicating processes - in principle. The problem now is the way the TCL process is run. Here is the manual way I'm having to do it.
> >
> > 1. Start TCL/Tk by clicking on WISH which gives me a console window.
> > 2. Load eventloop.tcl using the console (process A).
> > 3. Optionally, kill the console.
> > 4. Open sbcl-shen.exe (process B, with the communicating program preloaded).
> >
> > This works. However if I vary this routine as follows.
> >
> > 1. Load eventloop.tcl by clicking on it (process A).
> > 2. Open sbcl-shen.exe (process B, with the communicating program preloaded).
> >
> > Then I get two windows but process B cannot talk to process A. This two step routine is the routine in my Windows batch file.
> >
> > Mark
> From the sound of the file name, eventloop.tcl, is this a small piece of tcl code you're experimenting with? Can you post this file?
>
> And the .exe, what is that? Do you have its source code; what language is it? What does comm prog preloaded mean? Is it a tclkit/starpak or something else.

Nailed it. The problem is in the batch file. I now have

START /B sbcl-shen.exe
C:\ActiveTcl\bin\wish.exe "C:\Users\shend\OneDrive\Desktop\Shen\S38\Tk\eventloop.tcl"

I was using C:\ActiveTcl\bin\wish86t.exe

Mark

Re: running a TCL/tk program in different modes

<upe2md$1kkuf$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12888&group=comp.lang.tcl#12888

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: running a TCL/tk program in different modes
Date: Wed, 31 Jan 2024 10:14:37 -0800
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <upe2md$1kkuf$1@dont-email.me>
References: <137fed53-ecd2-42f7-8aa6-d826c278f1f5n@googlegroups.com>
<upd3ll$1f1g7$1@dont-email.me>
<7bc00dc6-afab-4068-a594-ab13fb99e705n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 31 Jan 2024 18:14:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8eaa76106ba84944d88acc32dcb0234d";
logging-data="1725391"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZMHrwZZcHv5vrdgh6JxMN"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:eYTpa3Xo1wn+gnPzO8NKDf1qQV4=
Content-Language: en-US
In-Reply-To: <7bc00dc6-afab-4068-a594-ab13fb99e705n@googlegroups.com>
 by: et99 - Wed, 31 Jan 2024 18:14 UTC

On 1/31/2024 4:31 AM, Mark Tarver wrote:
> On Wednesday 31 January 2024 at 09:25:14 UTC, et99 wrote:
>> On 1/30/2024 10:58 PM, Mark Tarver wrote:
>>> I have now constructed a batch file that enables me to run two communicating processes - in principle. The problem now is the way the TCL process is run. Here is the manual way I'm having to do it.
>>>
>>> 1. Start TCL/Tk by clicking on WISH which gives me a console window.
>>> 2. Load eventloop.tcl using the console (process A).
>>> 3. Optionally, kill the console.
>>> 4. Open sbcl-shen.exe (process B, with the communicating program preloaded).
>>>
>>> This works. However if I vary this routine as follows.
>>>
>>> 1. Load eventloop.tcl by clicking on it (process A).
>>> 2. Open sbcl-shen.exe (process B, with the communicating program preloaded).
>>>
>>> Then I get two windows but process B cannot talk to process A. This two step routine is the routine in my Windows batch file.
>>>
>>> Mark
>> From the sound of the file name, eventloop.tcl, is this a small piece of tcl code you're experimenting with? Can you post this file?
>>
>> And the .exe, what is that? Do you have its source code; what language is it? What does comm prog preloaded mean? Is it a tclkit/starpak or something else.
>
> Nailed it. The problem is in the batch file. I now have
>
> START /B sbcl-shen.exe
> C:\ActiveTcl\bin\wish.exe "C:\Users\shend\OneDrive\Desktop\Shen\S38\Tk\eventloop.tcl"
>
> I was using C:\ActiveTcl\bin\wish86t.exe
>
> Mark
>

Glad to hear it. For future reference, I would recommend you get process explorer from here:

https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer

It's much better tool than windows task manager. I run it at startup so I always have it available.

In your case, it would have been useful to tell you exactly what the resulting command line is when you (double) click a .tcl file. It can also display the process hierarchy, and the working directory that a program starts up in. You can also get visibility into what files it is opening.

No windows programmer should be without it.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor