net-read-line ??

Notices and updates
Locked
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

net-read-line ??

Post by HPW »

I ran into problem with the tk-macro:

Code: Select all

(define-macro (tk , _result)
	(set '_result (append (apply string (map eval (args))) ";##EOT##"))
	(net-send SYS:tk-sock '_result)
	;; on Unix's we could just use 'read-line', but doesn't work on sockets in win32
	(while (starts-with (net-read-line SYS:tk-sock '_result) "VOID-TK:"))
	(if (starts-with _result "ERR-TK:") (reset) _result))
It seems that net-read-line is the problem.
> setq
setq <408002>
> net-read-line
nil
Seems not to be defined.
But in the list of (symbols) it appears.
Also in the doc it is not documented.
But in the V10 release doc it is not abandoned.

??
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Oops, just noticed that net-read-line is not a primitiv, it is defined in newLISP-tk.tcl

I must futher investigate the problem.
> (tk "tk_chooseColor -title {Pick line color}")
"tk_chooseColor -title {Pick line color};##EOT##"
>
The problem in TK-demo mouse lisp is that not the color is given back.
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

The following fix make the TK-mouse demo work for me:

Code: Select all

(define (tk)
        (let (result (append (apply string (args)) ";##EOT##"))
          (net-send SYS:tk-sock result)
          ;; on Unix's we could just use 'read-line', but doesn't work on sockets in win32
          (while (starts-with (setq tkresult(SYS:net-read-line SYS:tk-sock 'result)) "VOID-TK:"))
;         Debug-Dialog
;         (MAIN:MessageBoxA 0 (string "tk result: " (eval tkresult)) "Debug" 1)
          (if (starts-with tkresult "ERR-TK:") (reset) tkresult)))
Hans-Peter

Locked