UltraEdit as a programmers editor - HPW

Started by SHX, May 05, 2007, 11:27:51 PM

Previous topic - Next topic

SHX

HPW,



I saw that you recomended ultraedit as a good editor for NewLisp.



Does it have a facility where the Newlisp code can be run directly in the editor?



Thanks



Steven

HPW

#1
Steven,



not sure what you are looking for.



You can highlight a newLISP-expression in UltraEdit and use a tool-macro to evaluate it in newLISP via direct execution mode.

The return value will be shown in a new tab in ultraedit.



The cmdline in tool/configuration:



C:....newlispnewlisp.exe -e %sel%



Beside this you can also config a tool which starts newLISP with the current lisp-file. %F would be the placeholder for the complete filename.

There are many other option. See help-file.
Hans-Peter

SHX

#2
Thanks HPW this is exactly what I was looking for.



I have a couple of followup questions.




QuoteYou can highlight a newLISP-expression in UltraEdit and use a tool-macro to evaluate it in newLISP via direct execution mode.

The return value will be shown in a new tab in ultraedit.



The cmdline in tool/configuration:



C:....newlispnewlisp.exe -e %sel%

When the newLisp command has quotes (directory "c:/" ) it does not work I think because the quotes confuse it so how do you pass a commmand with quotes



Also, I am having trouble passing a file name via the command line. I am in a command window in the newLisp executable directory and I can not get it to execute the newlsip file.



Is this the syntax
Quotenewlisp "c:/z/test2.lsp"

Should the slashes be back slashes or front ?



Will I see any output in the command window?



Thanks for your help



Steven

HPW

#3
Quote
When the newLisp command has quotes Code:

(directory "c:/" )

it does not work I think because the quotes confuse it so how do you pass a commmand with quotes


More a problem on the ultraedit side.

Try:



(directory {c:/})



The curly braces also act as a text delimiter.


Quote
Also, I am having trouble passing a file name via the command line. I am in a command window in the newLisp executable directory and I can not get it to execute the newlsip file.



Is this the syntax Quote:

newlisp "c:/z/test2.lsp"



Should the slashes be back slashes or front ?


Try:



newlisp c:/z/test2.lsp


Quote
Will I see any output in the command window?


Yes, when you use write-line etc.

See newLISP help for more info about console-apps.



Try a file with:



(write-line "hello there")

(exit)


C:Programmenewlisp>newlisp test2.lsp
hello there

C:Programmenewlisp>newlisp "test2.lsp"
hello there

C:Programmenewlisp>newlisp "c:Programmenewlisptest2.lsp"
hello there

C:Programmenewlisp>newlisp "c:/Programme/newlisp/test2.lsp"
hello there

C:
Hans-Peter

SHX

#4
HPW, Thanks again for your help.



I see that the reason that the -e switch is not working does not have to do with the quote but rather even if there is a space before the final parentheses it does not work (directory) works (directory ) does not.



Steven

Lutz

#5
I am not familiar with UltraEdit but (directory) or (directory  ) should not  matter. This looks like UltraEdit is breaking up the string at the space before passing to newlisp.



I would also explore the possibility to use escaped quotes, i.e:


newlisp -e "(directory "c:/")"

this way you can tell UltraEdit that (diectory "c:/") is one thing regardless of quotes and spaces, but you still can use quotes to to delimit the entire piece of newLISP source. Another possibility might be this (the curly {} braces are a newLISP text delimiter):


newlisp -e "(directory {c:/})"

not sure what single quotes do in Windows, but on UNIX you also would try:


newlisp -e '(directory "c:/")'

Lutz

SHX

#6
Thanks Lutz,

Here is the error.
Quotemissing parenthesis : "...(directory                           24234""

This is the exact error that I get if I just code (directory without the final parenthesis.



I tried your suggestions but they did not work. It gives the error because of the space.



It seems that what you say must be occuring that somehow the space is making it cut off or it is being translated to a different character.



I am new to newLisp and Ultraedit am I am looking for a good editor to use in Windows with newLisp.



I would really appreciate hearing from others on this.



Steven

Lutz

#7
You could use the '!' feature in the newLISP command shell.



When you start newLISP in a Windows command shell you could do:


>!ultraedit myprog.lsp

In the newLISP command shell the '!' immedeately after the '>' prompt and followed immedeately with a command will work like in a shell/command window. Then after editing you just save/quit from the editor and are back in the newLISP comand line and then do:


>(load "myprog.lsp")

Cursor-up in the newLISP shell will give you the previous commands, so this feature will let you switch between the newLISP comandline and your editor quickly. This works sepcially well with vi/vim or any edior which loads/quits fast.



Lutz



Ps: note that I have only tried this on UNIX or in CYGWIN or MINGW-MSYS on Windows, but I am pretty sure it also works in a Win32 cmd.exe shell.

SHX

#8
Lutz,



Thanks for your help and most of all thanks for newLisp.



Steven