Stripping Returns
J. Landman Gay
jacque at hyperactivesw.com
Wed Nov 19 11:14:30 EST 2014
Reading a file always gives you all the content regardless of the size, up to memory limits. Displaying a long line of text will truncate it after 62k but as I understand it, the truncation is visual only. If a script asks for the line it is all returned. (Better check that, but that was my understanding.)
But the restriction only applies to lines that don't wrap, such as those in list fields. If the text contains spaces or other delimiting tokens, the text will wrap and the restriction is lifted.
When reading a file from disk as text, line endings will be converted to the ones used by the current OS. Text read as binary will not be altered.
On November 19, 2014 4:44:53 AM CST, JB <sundown at pacifier.com> wrote:
>Thank you. The logic is simple enough.
>Even so it should be noted in the read
>file that reading to the end of a file will
>fail to provide you the info if the file has
>more than 65,535 characters.
>
>John Balgenorth
>
>
>On Nov 18, 2014, at 8:35 PM, dunbarx at aol.com wrote:
>
>> Hi.
>>
>>
>> Did you try this? Simple to do in a little test card. The chars
>beyond 65535 will be lost. Do you see what the likely answer to your
>second question is? Note that reading from a file does not anticipate
>what you will do with the data. Variables have no limits, within
>memory, of course, but what you do with that data may hit a wall.
>>
>>
>> Craig Newman
>>
>>
>>
>> -----Original Message-----
>> From: JB <sundown at pacifier.com>
>> To: How to use LiveCode <use-livecode at lists.runrev.com>
>> Sent: Tue, Nov 18, 2014 9:48 pm
>> Subject: Stripping Returns
>>
>>
>> A field has a limit on the amount of characters
>> you can have on each line. What if I put the
>> text of a field in a variable and it has 500,000
>> characters. Then I strip all of the returns that
>> are in the field. Does that leave only one line
>> with 500,000 characters? That exceeds the
>> amount of characters allowed per line so what
>> happens to the text in the variable?
>>
>> Another similar question is what happens if I am
>> reading a file until the end and it is very large. Will
>> returns be automatically placed if needed so the line
>> limit got characters is not exceeded or do I need to
>> read large files in sections that are less than the line
>> limit for characters?
>>
>> John Balgenorth
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>subscription
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>_______________________________________________
>use-livecode mailing list
>use-livecode at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list