newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: newBert on April 19, 2006, 05:53:00 AM

Title: Problem in opening newLisp script with a double-clic
Post by: newBert on April 19, 2006, 05:53:00 AM
Why can I not launch (with newLisp-tk) a newlisp script by a single double-clic on the file icon ?

When I try this, the result is an error message such as : "problem accessing file in function load"



e.g.:

I put a copy of the file "Demo.lsp" in a directory C:newlisp and I get the following message : problem accessing file in function load : "C:newlispDemo.lsp".

(same effect with another or the original directory).



However, if the directory is the root (i.e.: C:Demo.lsp) I can open the file with a double-clic on  it.



NB : if I try to open a script with newlisp.exe (without -tk) in this way, there is no problem.



[newLISP v.8.8.5 on WinXP-SP1 Home Edition]



thank you in advance for your help
Title:
Post by: rickyboy on April 19, 2006, 06:19:10 AM
I don't know, definitively, the answer to your question; however, I did notice a curious thing.  The error message echoed the filename back as


"C:newlispDemo.lsp"

and a backslash (really, pathname separator) is conspicuously missing.  I don't know if this is a valid clue, but perhaps some newLISP veteran can tell us.  Good luck!
Title:
Post by: HPW on April 19, 2006, 07:09:51 AM
It happens in the newLISP-tk.tcl



foreach arg $argv {
NewlispEvaluate "(silent (load "$arg"))"
}


Seems that TCL modify the arg somehow.


Quote
newLISP v.8.8.5 on Win32 MinGW.



>

problem accessing file in function load : "C:ProgrammenewlispDemo.lsp"



> (tk-args)

("{C:\Programme\newlisp\Demo.lsp}")

>


(tk-args) returns the correct file with path.
Title:
Post by: Lutz on April 19, 2006, 08:08:48 AM
You could create a batch file Demo.bat containing:



newlisp-tk Demo.lsp


you can double click on that and it works, but I would not know how tu suppress the cmd.exe window, which also pops up.



Lutz
Title:
Post by: pjot on April 20, 2006, 02:34:15 AM
Well, you can also use my 'run.exe' for that.



http://www.turtle.dds.nl/run/index.html





Just enter the line 'newlisp-tk prog.lsp' in the ini file and start 'run.exe'. No DOS box whatsoever.



Peter
Title:
Post by: newBert on April 20, 2006, 06:49:12 AM
I thank you for your quick and interesting replies.



I think I'll try "run.exe".  I heard of it in, if I've a good memory, the GTK-Server web site.



I would like to point something else out :

when I launch a newlisp-tk script from some text editors, like ConTEXT, Crimson Editor or SciTE, for instance, everything is fine !...



Therefore it may be that the problem comes from Windows file management rather than Tcl ? (lack of flexibility in the file and folder options?)



Thanks again.