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

[trim][string] Something strange in the Rebol string ?

 [1/5] from: didec::tiscali::fr at: 4-May-2004 14:11


[trim][string] Something strange in the Rebol string ? I should say that there is Gurus needs here ! The following code (under Windows) should work in the same manner (displaying a card game symbol you know), but not ! REBOL [ ] ; it works tx: "" view layout [text tx font-size 40 font-name "symbol"] ; it does not works tx2: to-string to-char 167 view layout [text tx2 font-size 40 font-name "symbol"] The first works, the second displays an unwanted character following the wanted one. I know that it's 'trim/lines that modified the string and add this char (not the same each time, and either the View version you use). But I'm completely lost to found the behaviour and the "why ?" Here is a console session : REBOL/View 1.2.1.3.1 21-Jun-2001
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== "["
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> trim/lines to string! to char! 167
== ""
>> >> trim/lines ""
== ""
>> trim/lines ""
== ""
>> trim/lines ""
== ""
>> trim/lines ""
== ""
>> trim/lines ""
== ""
>> trim/lines ""
== "" As you see the trim/lines adds another character in the string obtained by "to string!", randomly. No problem it seems with other versions. But the script at top, while saved in a file, show the problem with all versions (but not all the time) ! My first though is that 'trim is bugged, but can it be the behaviour of Rebol with constant string and generated one ? How can I say... Help !!! DideC PS: I hope the foreign chars will displayed well on your computer (french codepage here).

 [2/5] from: SunandaDH:aol at: 4-May-2004 8:20


It's this bug: load to-string #"0" ** Syntax Error: Invalid integer -- 0? ** Near: (line 1) 0? I reported it via REBOL.com feedback recently The response was: << REBOL Feedback: bug in to-string [#44q154200] Thanks for your feedback... That's a suprise bug. Thanks. We'll get that fixed.
>>
This workaround works for me: load copy to-string #"0" In your case, try: tx2: copy to-string to-char 167 view layout [text tx2 font-size 40 font-name "symbol"] Sunanda.

 [3/5] from: didec:tiscali at: 4-May-2004 14:54


Re: [trim][string] Something strange in the Rebol string ? Hi Sunanda,
> It's this bug: > > load to-string #"0" > ** Syntax Error: Invalid integer -- 0? > ** Near: (line 1) 0? >
[...]
> This workaround works for me: > > load copy to-string #"0" > > In your case, try: > > tx2: copy to-string to-char 167 > view layout [text tx2 font-size 40 font-name "symbol"] >
Yes, it works like this. Thank's for the reply. I will add it to the Bug tracker (if not always in) to be sure RT will remind it

 [4/5] from: rotenca:telvia:it at: 4-May-2004 17:51


Hi, Seems to me the #386 bug. Do you agree? --- Ciao Romano

 [5/5] from: didec:tiscali at: 4-May-2004 18:32


Re: [trim][string] Something strange in the Rebol string ?
> Hi,
Hi romano,
> Seems to me the #386 bug. > > Do you agree?
I agree it's related, but it appear that it's to-string that cause the bug. But I can't figureout what the code in "Notes" should give as result.
> --- > Ciao > Romano
Ciao DideC