Hi,

Actually what you have is a simple typo
The clue is in the error msg,  it shows x : x + 1 (notice the space between
the x and the colon)

With the typo
>>str: "&"
>>x: 0
>> if( str = "&") [x : x + 1]
** Syntax Error: Invalid word-get -- :.
** Where: (line 1) if( str = "&") [x : x + 1]
>>
Now fixed
>> if( str = "&") [x: x + 1]
== 1

Cheers,

Allen K




----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 23, 1999 7:55 PM
Subject: [REBOL] another dumb problem!!


> i am trying to compare two string....
>
> this is what i use ..
>
> if( str = "&") [ x: x + 1 ]
>
> it gives me the following error ....
>
> ** Syntax Error: Invalid word-get -- :.
> ** Where: (line 37) if  (str == "&") [ x : x + 1 ]
>
> in C you can easily do this .....
> i think i am making a fundamental mistake in understanding this...
> can some one pl point it out ..... i am used to C way of
> comparing string with double quotes .... or  strcmp(.....)
> in java u have str.equals(")") ... that doesit..  in REBOL is it
> a bit different?? there are words, strings, lists, arrays, blocks,
> literals... i am a bit confused specially  the comparing funda is not
> clear .. i went through the user guide .. but .. i could not
> slove my problem ....
>  my previous post of the dumb problem .. was similar to this ....
> thanx for the solution... subhro
>
>

Reply via email to