Hi, Tim wrote: > I'm setting up an object that contains some ports, > which may or may not be open. > i.e.: may or may not open "test.txt" > may or may not open "dufus.txt" > obviously I don't want to attempt to close > what I didn't open. > If I initialize a word to none > as dufus-pointer: none > and don't open it. > the following code: > either equal? dufus-pointer none [][close dufus-pointer] > generates an error: expected argument of type: port > > similarly a function like > safe-close: func [p[port!]][if p [close p]] > > generates an error message. > > How can I get around this? > > > Thanks Folks! > Tim > > Sorry, I don't understand. For me your code works: >> dufus-pointer: none == none >> either equal? dufus-pointer none [][close dufus-pointer] >> Ladislav
- [REBOL] installing Rebol as CGI application under PWS/Win... christian . wenz
- [REBOL] installing Rebol as CGI application under PW... icimjs
- [REBOL] installing Rebol as CGI application unde... christian . wenz
- [REBOL] installing Rebol as CGI application under PW... tim
- [REBOL] [REBOL] Default Port Values? tim
- [REBOL] [REBOL] Default Port Values? Re:(2) lmecir
- [REBOL] [REBOL] Default Port Values? Re:... tim
- [REBOL] [REBOL] Default Port Values... icimjs
- [REBOL] Simple CGI Problem louisaturk
- [REBOL] Simple CGI Problem ... christian . wenz
- [REBOL] Simple CGI Problem ... ryanc
- [REBOL] Simple CGI Problem ... ralph
- [REBOL] Simple CGI Problem ... louisaturk
- [REBOL] Simple CGI Problem ... christian . wenz
- [REBOL] Simple CGI Problem ... allenk
- [REBOL] Simple CGI Problem ... fred-ml