wouldn't it be nice to add 2 sections:
- General discussion
- Problems
to the forum.
It seems there is no right section for this currently.
Best,
Arie
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote
However, I read Lutz's remark about directory security problems, so I deinstalled newLISP again
and installed it to a different place (not in systems folders).
And voilĂ , it works.
Run-shell:Quote
Could not start C:Program Filesnewlisp/newlisp.exe -C -w "C:UsersArie"
(load (append (env "NEWLISPDIR") "/guiserver.lsp"))
(define (f2c x)
(set 'y (float x nil))
(println "y=" y ";")
(cond
(y (string (div (sub y 32.0) 1.8)))
(true "enter a number")
)
)
(define (c2f x)
(set 'y (float x nil))
(cond
(y (string (add (mul y 1.8) 32.0)))
(true "enter a number")
)
)
(gs:init)
(gs:frame 'Convert 300 300 270 120 "Convert Fahrenheit & Celsius")
(gs:set-resizable 'Convert nil)
(gs:set-border-layout 'Convert)
(gs:panel 'Input)
(gs:set-flow-layout 'Input "left")
(gs:label 'Inlab "Input value:" "left" 44)
(gs:text-field 'Inval 'text-handler 20)
(gs:add-to 'Input 'Inlab 'Inval)
(gs:panel 'Output)
(gs:set-flow-layout 'Output "left")
(gs:label 'Outlab "Output value:" "left" 35)
(gs:label 'Outval "")
(gs:add-to 'Output 'Outlab 'Outval)
(gs:panel 'Button)
(gs:set-grid-layout 'Button 1 2)
(gs:button 'f2c 'button-handler "Convert F -> C")
(gs:button 'c2f 'button-handler "Convert C -> F")
(gs:add-to 'Button 'f2c 'c2f)
(gs:add-to 'Convert 'Input "north" 'Output "center" 'Button "south")
(gs:set-visible 'Convert true)
(define (text-handler id value) nil)
(define (button-handler id value)
(cond
((= id "MAIN:f2c")
(gs:set-text 'Outval (f2c (gs:get-text 'Inval))))
((= id "MAIN:c2f")
(gs:set-text 'Outval (c2f (gs:get-text 'Inval))))
(true
(gs:set-text 'Outval "invalid id detected"))
)
)
(gs:listen)