Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Seems like a View 2.7.6 "if" statement issue ......???

From: jfdutcher1958::yahoo::com at: 14-Oct-2008 2:31

Here's the result of inserting the 'probe' in the line noted below: #{20} ** Script Error: Expected one of: binary! - not: string! ** Near: (probe substr rec1 (y + j) + 2054 1) > " "
>>
Does this seem to shed light on whether or not there is a fundamental difference between 2.7.6 and the earlier version   ??? --- On Wed, 10/8/08, Anton Rolls <anton-wilddsl.net.au> wrote: From: Anton Rolls <anton-wilddsl.net.au> Subject: [REBOL] Re: Seems like a View 2.7.6 "if" statement issue ......??? To: rebolist-rebol.com Date: Wednesday, October 8, 2008, 2:59 AM 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.