Hi John,

Gregg Irwin wrote:
> Hi John,

> JD>         if ((substr rec1 (y + j) + 2054 1) > " ") [   <------------- 
> error here

> JD> Error msg. from 2.7.6:
> 
> JD> ** Script Error: Expected one of: binary! - not: string!
> JD> ** Near: (substr rec1 (y + j) + 2054 1) > " "
> 
> More context would help, or a standalone example of the problem.
> 
> What is the source for SUBSTR, and what are the actual contents of
> rec1? It looks like rec1 is a binary value.
> 
> -- Gregg

Gregg is right, before jumping to conclusions and posting
an expression with a couple of unknowns in it, you should
find out what the actual values are when the expression is
evaluated. You can do this in two ways;

1)  print the values on the line just before.
2)  PROBE the values within the line.

eg: 1)

        print y + j
        ?? rec1
        probe substr rec1 (y + j) + 2054 1
        if ((substr rec1 (y + j) + 2054 1) > " ") [

eg: 2)

        if ((probe substr probe rec1 probe (y + j) + 2054 1) > " ") [

Where the error occurs should now be much clearer.

Using PROBE within the line is a bit safer than printing
before the line, when evaluating functions such as your
SUBSTR, because, should the function have a side effect,
the second evaluation may return a different result, and
so what is printed will be different to what causes the
error.

Regards,

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

Reply via email to