newbie question on fields
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
newbie question on fields
Hi,
The following script correctly "puts" a text file into a variable. The accurate number of characters is placed into the card variable "filesize".
put URL ("file:" & it) into tFileData
put the number of characters in tFileData into tFileChars
put tFileChars into field "filesize"
put tFileData into field "DataText"
However, the "field" "DataText" on a card only receives a portion of the text data, not the total number of characters. Is there a reason for the text to be limited in size? Is there a way to set the size of the text field?
Thanks -- and be prepared for more questions from this newbie !
The following script correctly "puts" a text file into a variable. The accurate number of characters is placed into the card variable "filesize".
put URL ("file:" & it) into tFileData
put the number of characters in tFileData into tFileChars
put tFileChars into field "filesize"
put tFileData into field "DataText"
However, the "field" "DataText" on a card only receives a portion of the text data, not the total number of characters. Is there a reason for the text to be limited in size? Is there a way to set the size of the text field?
Thanks -- and be prepared for more questions from this newbie !
Ken
Hi Ken,
What kind of file are you trying to import? If it is a plain text file, this should just work. If not, could you please tell a little more about it?
Best,
Mark
What kind of file are you trying to import? If it is a plain text file, this should just work. If not, could you please tell a little more about it?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
file type
Mark,
The file being imported is a plain text file -- however, it contains some html code characters. Here is a portion of the file:
<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 153<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 14<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 1<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 2<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 305<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 182<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 5<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM
If you would like to see the entire file, I would gladly email it to you.
Thanks so much for your assistance.
The file being imported is a plain text file -- however, it contains some html code characters. Here is a portion of the file:
<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 153<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 14<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 1<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 2<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 305<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 182<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 5<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM
If you would like to see the entire file, I would gladly email it to you.
Thanks so much for your assistance.
Ken
Hi Ken,
I have no idea why Rev would cut off the data when displaying it in a field. Feel free to send your stack and the text file to m . schonewille (at) economy-x-talk . com . I'll have a look.
Best,
Mark
I have no idea why Rev would cut off the data when displaying it in a field. Feel free to send your stack and the text file to m . schonewille (at) economy-x-talk . com . I'll have a look.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Ken,
Thanks for the stack and the data. Your file is a very messy HTML file, with lots of spaces in the beginning, some javascript and more garbage in the first 5456 (!) lines of the file. I just can't believe that people design web sites like this.
The actual data start with a header that looks as follows:
Date Com Mth Price Time Type Volume
---------- ----- -------- ------ --------- ------------ -----------
Unfortunately, the data following this header doesn't contain any linefeeds. As a result, the data consist of one line with a length equal to 65533 or more. Revolution cannot display lines that long and therefore the data is cut off at that line when displayed in a field.
You can solve this by including the line
in your script, right after the line that reads the data from the file. This will break up the data into smaller lines that can be displayed in a field.
Best regards,
Mark
Thanks for the stack and the data. Your file is a very messy HTML file, with lots of spaces in the beginning, some javascript and more garbage in the first 5456 (!) lines of the file. I just can't believe that people design web sites like this.
The actual data start with a header that looks as follows:
Date Com Mth Price Time Type Volume
---------- ----- -------- ------ --------- ------------ -----------
Unfortunately, the data following this header doesn't contain any linefeeds. As a result, the data consist of one line with a length equal to 65533 or more. Revolution cannot display lines that long and therefore the data is cut off at that line when displayed in a field.
You can solve this by including the line
Code: Select all
replace "<br>" with "<br>" & cr in tFileData
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
like a charm !
Mark,
That worked perfectly to bring the whole file into the text field.
Thanks a bunch.
Best regards,
That worked perfectly to bring the whole file into the text field.
Thanks a bunch.
Best regards,
Ken