newlisp.dll with get-string Bug

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

newlisp.dll with get-string Bug

Post by HPW »

In newlisp.exe:

Code: Select all

> (import "newlisp.dll" "dllEvalStr")
dllEvalStr <11180BC>
> (get-string (dllEvalStr "(+ 3 4)"))
"7"
> (print(get-string (dllEvalStr "(append \"test\" \"2\")")))
"test2""\"test2\""
> (silent(print(get-string (dllEvalStr "(append \"test\" \"2\")"))))
"test2"
In newlisp.dll:

Code: Select all

(import "newlisp.dll" "dllEvalStr")
dllEvalStr <19880BC>
(get-string (dllEvalStr "(+ 3 4)"))
7"7"
(setq a(get-string (dllEvalStr "(+ 3 4)")))
7"7"
a
"7"
(print(get-string (dllEvalStr "(append \"test\" \"2\")")))
"test2""test2""\"test2\""
(silent(print(get-string (dllEvalStr "(append \"test\" \"2\")"))))
""
Of cource I do not want to embed a newlisp in newlisp.dll.
It is only a test for use of other DLL. (zlib,zip etc.)
I want to access compressed or zipped data direct from newlisp exe and/or dll.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Actually its doing the expected:

The newLISP dll reroutes stdout output to the return value, normally in newLISP console (for return values) and stdout output have a different path in the program, this is why in newlisp-tk you don't see stdout at all, becuase it is thrown away. So when working with nested newlsip DLLs the lower process's string return is a stdout on the next higher level. The stdout on the higher level in return gets a return value and routed to stdout (the console on the highest llevel).

Importing other DLLs into newlisp.dll things seems to work fine and only give one return value back, i.e. I try the following in the NeoBook demo (example from the manual):

(import "user32.dll" "MessageBoxA")
(MessageBoxA 0 "This is the body" "Caption" 1)
=> 1 ; single return value


Lutz

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

Post by HPW »

Thanks for clearing.
Was not aware about the details of this.
Will further inverstigate the use of other DLL's.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, finding out about other DLL's would be great. It still would be nice to compile a combined DLL/Exe (like i.e. MS Excel), but we (Steve an I) haven't got that right yet. I also don't want to switch to MS-tools but rather stay with the free Borland tools.

Lutz

Locked