gettingstarted
[Top] [All Lists]

Re: Option Characters to binary

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Option Characters to binary
From: Peter Gatti <petegat at ix dot netcom dot com>
Date: Mon, 24 Nov 2003 03:32:38 -0500
References: <200311231831 dot 1ao6vb5qV3NZFl40 at penguin>



But Joe, I used Len() because the Language Reference states that the integer parameter for the read method is 'reads count characters,' so that's what I used.

The documentation is wrong; the parameter is bytes (it would be quite impractical for it to read a certain number of characters). Please file a bug against the documentation.

I did some more experimenting and found that a file I had saved using Len() 
read back just fine using lenB(). I see what you mean, but the two behave as if 
they're interchangeable.  Just the same, I will file the bug.


Ah, but of course that's not really the case; there are only 127 ASCII numbers and they don't include any of what you're calling "option characters."

After reading this comment, I decided to find out what the ASC number is for (option g) or the 
character © so I wrote a little program to display it using 
me.text=str(Asc("©")) in an edit field's open event. It's 169. So I expanded the 
code to:

 for x= 0 to 169
   s=chr(x)+chr(13)
   me.text=me.text + str(x)+"  "+s
 next

RB just stalled and quit. So I limited the loop to x= 164 to 169 and this is 
the result.

164  ¬¨¬®¬¨¬Æ¬¨¬®¬¨?ÜÄö?Ñ??àöÄ àöàÇÄö? ??¬¨à´
165  Äö?Ñ??àö?ëàöàÇÄö? ??àö?´¬¨¬®¬¨¬¢
166  ¬¨¬®Äö? ?á
167  àö?º
168  ®
169  ©

I found the dwindling pattern odd so I changed the loop to x= 167 to 171 and 
this is what I got.

167  Äö?Ñ??àöÄ àöàÇÄö? ??¬¨à´
168  ¬¨¬®àö?ú
169  ©
170  Ѣ
171  ´


Notice how less and less gibberish prefixes the option characters as the loop 
progresses. I can't begin to understand what's going on with that, but whatever it 
is, I'm convinced it is at the root of my problem. Joe, the copyright symbol © 
is commonly used and IMO it's a real limitation if RB can't handle these key 
combination characters which have ASC numbers above 127.


Well, for now I would suggest you simply put Encodings.UTF8, which will be correct as long as the data you wrote out came from an EditField and you didn't do any conversions on it. It didn't work because now I understand Encoding is not the problem. It's RB not being able to deal with ASC characters above 127. Is there another solution for this problem? Thank you, Pete Gatti



- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>