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

Seems like a View 2.7.6 "if" statement issue ......???

 [1/11] from: jfdutcher1958:yaho:o at: 7-Oct-2008 18:51


This line worked fine in the earlier version of Rebol......but now throws an error in Rebol 2.7.6 repeat k 12 [         nourish: copy []         if ((substr rec1 (y + j) + 2054 1) > " ") [   <------------- error here              .........                                             <------------ rec1 is a 2,096 character recd              ......... Error msg. from 2.7.6: ** Script Error: Expected one of: binary! - not: string! ** Near: (substr rec1 (y + j) + 2054 1) > " "

 [2/11] from: Tom:Conlin:gm:ail at: 7-Oct-2008 19:41


have you tried something like ... if #" " < first at rec1 2054 + y + j [ ... where the main point is considering the comparison as chars instead of strings and a secondary point is keeping the constants of a comparison first and ordering your expressions not to need parens. John Dutcher wrote:

 [3/11] from: gregg::pointillistic::com at: 7-Oct-2008 21:11


Hi John, JD> This line worked fine in the earlier version of Rebol......but now JD> throws an error in Rebol 2.7.6 JD> repeat k 12 [ JD>         nourish: copy [] JD>         if ((substr rec1 (y + j) + 2054 1) > " ") [   <------------- error here JD>              .........                                             <------------ rec1 is a 2,096 character recd JD>              ......... 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

 [4/11] from: anton::wilddsl::net::au at: 8-Oct-2008 17:59


Hi John, Gregg Irwin wrote:
> Hi John, > JD> if ((substr rec1 (y + j) + 2054 1) > " ") [ <------------- error here
<<quoted lines omitted: 5>>
> 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.

 [5/11] 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!
<<quoted lines omitted: 3>>
> 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.

 [6/11] from: gregg:pointillistic at: 14-Oct-2008 9:58


Hi John, JD> Here's the result of inserting the 'probe' in the line noted below: JD> #{20} JD> ** Script Error: Expected one of: binary! - not: string! JD> ** Near: (probe substr rec1 (y + j) + 2054 1) > " "
>>>
JD> Does this seem to shed light on whether or not there is a JD> fundamental difference between 2.7.6 and the earlier version   ??? Yes, it explains the error as expected, but doesn't tell us what is different under 2.7.6. If you run the same code under an earlier version, do you get " " from the probe? And, again, what does the source of SUBSTR look like, and how is 'rec1 set? You can add an AS-STRING to the left side to eliminate the error, but that doesn't tell us what the source of the problem is. -- Gregg

 [7/11] from: anton::wilddsl::net::au at: 15-Oct-2008 3:00


Hi John, Which specific version of Rebol was the earlier you used before ? I just tried: #{20} > " " in Rebol/View 1.2.1.3.1 21-Jun-2001 and I also get that error. So your earlier version would probably have to be older than 1.2.1 ! Are you sure your input has not changed ? Is REC1 supposed to be a binary ? Regards, Anton. John Dutcher wrote:

 [8/11] from: jfdutcher1958::yahoo::com at: 20-Oct-2008 18:08


Well, I don't need to convince anyone that 2.7.6 differs from earlier versions....it's a certainty for me. But don't we agree that the #(20) indicates a space character (ASCII) ? The input is composed more of spaces than any other values (a great waste of space which Rebol file/record format remedies). So whether 2.7.6. is different or not.....isn't the compare of a single character string being done properly here or should I be re-using the 'empty ?' statement to test this field instead of 'if"  ? --- On Tue, 10/14/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: Tuesday, October 14, 2008, 12:00 PM Hi John, Which specific version of Rebol was the earlier you used before ? I just tried: #{20} > " " in Rebol/View 1.2.1.3.1 21-Jun-2001 and I also get that error. So your earlier version would probably have to be older than 1.2.1 ! Are you sure your input has not changed ? Is REC1 supposed to be a binary ? Regards, Anton. John Dutcher wrote:

 [9/11] from: anton::wilddsl::net::au at: 21-Oct-2008 17:08


Hi John, John Dutcher wrote:
> Well, I don't need to convince anyone that 2.7.6 differs from earlier versions....it's a certainty for me.
I would like you to answer these 2 questions: 1) *Which version* of Rebol is the version you used before ? 2) What is the console output of the following code, as run in the older version *and* in Rebol/View 2.7.6 ? (probe substr (probe rec1) (y + j) + 2054 1) > " " Bugs cannot hide forever. Regards, Anton. But don't we agree that the #(20) indicates a space character (ASCII) ?

 [10/11] from: jfdutcher1958::yahoo::com at: 28-Oct-2008 18:10


Anton:  I went back and installed this version of Rebol: REBOL/View 1.3.2.3.1 5-Dec-2005 Core 2.6.3 The result was a return to perfect execution including the original 'if'....' statement as written. I might add that I got Rebol 2.7.6 to run the script by substituting the 'empty?'  approach to test the one character field (rather than 'if')....it wrote the output file as desired.  BUT, there is no comparison whatever between the contents of the output file as written by 2.7.6 and the one written with the version noted above. The 2.7.6 version is an abomination while the 1.3.2.3.1 version is exactly what is expected when executing the  statements contained in the script.    You can do the same....I sent you the script and the input file. John D. Hi John, John Dutcher wrote:
> Well, I don't need to convince anyone that 2.7.6 differs from earlier versions....it's
a certainty for me. I would like you to answer these 2 questions: 1) *Which version* of Rebol is the version you used before ? 2) What is the console output of the following code, as run in the older version *and* in Rebol/View 2.7.6 ? (probe substr (probe rec1) (y + j) + 2054 1) > " " Bugs cannot hide forever. Regards, Anton.

 [11/11] from: anton::wilddsl::net::au at: 30-Oct-2008 22:56


Hi John, I'm happy to look it over, but I didn't receive any private mail from you as yet. Did you get a bounce ? I'm glad you could work around the problem. Regards, Anton. John Dutcher wrote:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted