text in fields (CR/LF, CR, LF) which is correct?
Richard Gaskin
ambassador at fourthworld.com
Thu Aug 29 13:14:01 EDT 2002
Kee Nethery wrote:
> -- Test A
> I am pulling text from a database and in the text, I have the word
> "Default", followed by an ASCII 13 which is a CR or return, followed
> by another word "Your". In Hypercard and in Tex-Edit under MacOS X
> this displays as
>
> Default
> Your
>
> In Revolution on MacOSX it displays as
>
> DefaultYour
>
> When I copy all the characters starting with "t" and ending with "Y"
> and paste into Tex-Edit, it shows that I have indeed captured three
> characters and the middle character is a return. But in the
> revolution text field the two words appear to run together.
...
> -- Questions
> 1. What the ... is going on here?
>
> 2. Why is Revolution ignoring the lone CR initially and then not
> ignoring it later?
> 3. Why is Revolution changing the CR LF characters to CR CR?
Rev gives you a choice of having line engings converted or not (see #5
below).
> 4. What does Revolution want to see between the "t" and the "Y" so
> that the "Y" appears to be on the line below the "t"?
Depends on how you tell it to read yhe data (see #5 below).
> 5. Is there some setting I should use that will cause Revolution to
> pay attention to returns in text fields without having to paste into
> a text editor and then copy them back?
You can read as text or binary. Text converts line endings, binary leaves
everything as it is natively.
As text:
open file tMyFile for read
- OR -
open file tMyFile for text read
- OR -
put url ("file:"&tMyFile) into tMyData
As binary:
open file tMyFile for binary read
- OR -
put url ("binfile:"&tMyFile) into tMyData
> 6. Is there some hack, some magic moves I can perform in script to
> get Revolution to display the lone returns?
replace numtochar(10) with cr in tMyText
--
Richard Gaskin
Fourth World Media Corporation
Custom Software and Web Development for All Major Platforms
Developer of WebMerge 2.0: Publish any database on any site
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the use-livecode
mailing list