CR & LF importing

Ron rbarber at yhb.att.ne.jp
Tue Jul 2 06:03:02 EDT 2002


Well, I struck out. The third strike was my ignorance. Turns out the script
works fine and is not a problem with transcript's implementation of cr and
lf nor with my understanding of that. The clue was that it worked in one
stack and not the other. The problem was that the textfont of the 'bad'
stack was set to 'Osaka'. I guess this is a no-no even though there were no
2byte characters in the fld or the custom properties.

Resetting the textfont of the stack to 'Geneva' or 'Courier' solves the
problem and the methods below work fine. Sorry to trouble the list over
this, but I'll be back...

Thanks
Ron

> From: Ron <rbarber at yhb.att.ne.jp>
> Reply-To: use-revolution at lists.runrev.com
> Date: Tue, 02 Jul 2002 11:57:32 +0900
> To: <use-revolution at lists.runrev.com>
> Subject: CR & LF importing
> 
> Hi
> 
> I'm starting with 2 strikes against me: I come from another xtalk background
> and I have been Mac only so please keep me from striking out.
> 
> I am trying to read in a custom prop to a list fld. The data is of the form:
> 
> part1,a*b*c*d*k
> part2,z*s*w*e*d
> 
> it is stored in a custom prop that is part of a custpropset ('names') in the
> mainstack ('startwd'). I am trying to read it in to a fld in a substack.
> The script that reads it in is:
> 
> put the names of stack "startwd" into thelist
> split thelist by return and comma
> put thelist[part1] into thetext
> replace "*" with return in thetext
> put thetext into fld "otbook"
> 
> The result is a single line of text with a lf symbol? in place of the '*'.
> However, if the same script is put in another mainstack and read into a list
> fld of the same attributes as the list fld in the original mainstack, the
> items are correctly separated and display in the fld one per line.
> 
> I've tried to get rid of the lf symbol but can't paste it anywhere to get
> it. I've tried various combinations of numtochar(10) and (13) and still
> haven't been successful.
> 
> The entry for return in the dictionary states:
>> The return constant is a synonym for linefeed. This is different from some
>> other languages, in which return is equivalent to the carriage return
>> character (ASCII 13, Control-M). For most purposes, Revoluton translates the
>> linefeed constant and its synonyms into the appropriate end-of-line character
>> for the current operating system. However, you should keep this nuance in
>> mind
>> when processing data from another system, which Revolution has not
>> translated:
>> return is not ASCII 13.
> 
> So, I was expecting Rev to handle this but it does not act the way I expect.
> Can someone help me adjust my thinkng and get the line of items to display
> one per line in a list fld of the original mainstack?
> 
> Thanks
> Ron
> 
> BTW this is on OS 9
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 




More information about the Use-livecode mailing list