and, in fact, be carefull how you use config files.

you should be using construct within your attempt (instead of make
object!)... its safer cause it wont evaluate the block itself. reducing the
chance that the config is setting your values as funcs and sending values
over tcp/ip  ;-)


-MAx

On 9/4/07, Maxim Olivier-Adlhoch <[EMAIL PROTECTED]> wrote:
>
> another way to look at this, is to build yourself a prefab config and
> default to it, this has the advantage of allowing your config file to be
> optional and to be extensible:
>
> ex:
>
> default: context [
>     visible?: true
>     saved?: true
>     setting1: none
> ]
>
> either config-file: attempt [ make object! load %my-app.cfg ] [
>     config: make default third config-file
> ][
>     print "CONFIG FILE ERROR"
>     config: default
> ]
>
>
> -MAx
>
> On 9/1/07, Kai Peters <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > config-obj:  attempt [ make object! load %my-app.cfg ]
> >
> > probe config-obj/setting1
> >
> > The probe fails if there is no 'setting1 defined in
> > %my-app.cfg
> >
> > Is there a way to test for this before attempting to probe (or doing
> > anything else with it) other than wrapping it in an 'attempt?
> >
> > Thanks
> > Kai
> > --
> > To unsubscribe from the list, just send an email to
> > lists at rebol.com with unsubscribe as the subject.
> >
> >
>


-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to