Hi,
I understand that last line, and I think it might work, because I want to
know if there actually is something in /comment, I'll try it immediately,
thanks!
/Regards Stefan
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: den 21 mars 2001 15:33
> To: [EMAIL PROTECTED]
> Subject: [REBOL] Re: Check if a path exists?
>
>
>
> If the path (eg) data/comment exists and it IS set to SOME
> value, eg an
> empty string or an empty block, then your first example
> should have worked:
>
> comment: data/comment
> if (length? comment) > 0 [ some code...]
>
> Since it doesn't, then the path could exist yet not set to a value, in
> which case the following should work:
>
> if value? (in data 'comment) [ some code...]
>
> Not having used CGI stuff I'm not exactly sure about the
> nature of your
> problem, but I suspect that you want to determine whether a word is an
> element of an object, that is, whether 'comment exists at all
> in 'data. I
> use this:
>
> if find next first data 'comment [ some code...]
>
> Need me to explain it?
>
> - Michael Jelinek
>
>
>
>
>
> [EMAIL PROTECTED]@rebol.com on 03/21/2001 04:59:30 AM
>
> From: [EMAIL PROTECTED]@rebol.com on 03/21/2001 04:59 AM
>
> Please respond to [EMAIL PROTECTED]
>
> Sent by: [EMAIL PROTECTED]
>
> To: [EMAIL PROTECTED]
> cc:
> Subject: [REBOL] Check if a path exists?
>
>
> Hi list,
> how can I check if a path has a value.
>
> I've decode some cgi into objects, something like this:
>
> data/name
> data/comment
>
> Now, if I want to check if there's actually something in
> data/comment (as
> it
> sometimes isn't), how should do?
>
> comment: data/comment
> if (length? comment) > 0 [ some code...]
>
> doesn't work...
>
> and if exists? data/comment doesn't work either..
>
> Any tips?
>
> /Regards Stefan
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
>
>
>
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.