Filter by Item and What gives with my field?
Sarah Reichelt
sarah.reichelt at gmail.com
Sun Jul 26 20:22:50 EDT 2009
> I have two items that I hope someone can help on. One is very
> straightforward: I need to filter a field by the items.
> That is, I have a field with zillions of records with four items (comma
> delimited)
>
> itemone,itemtwo,itemthree,itemfour
>
> I want itemfour to disappear after I put the field into a variable. The
> problem is that item four is never the same, so I can't filter by a specific
> string. I'm sure there must be a way to just have all of item four go poof.
set the columnDelimiter to comma
split tData by column
delete variable tData[4]
combine tData by column
> Second, I have a field that is full of TAB delimited records like this:
>
> Southern Arizona Trip TAB 5/27/1973 TAB This was the trip when we got two
> flat tires in the middle of nowhere.
>
> Just three items each. Sometimes, however, item three is a whole ten-page
> essay with paragraph returns but no tabs of course.
>
> When I pasted all of these records in a field, not everything appears there
> if you scroll through it. However, if you script: answer fld journal, you
> see the complete version. If you copy the journal field to the clipboard it
> is also complete. But you cannot SEARCH the field for the things in it
> because they're hidden. Is there some field property that is truncating the
> field in various places? I feel that I am back to hypercard with the 30,000
> character limit. What gives?
A couple of things:
If you want to keep one record per line, you will need to replace the
returns in item 3 with something else.
Use a single weird character or *CR* or whatever you like. Then you
can replace it back again for viewing & editing.
Fields have a maximum number of characters per line - I think it is 65535.
After that, you will start seeing weird things happening to the
display, although as you say, the data is still there.
The best solution is to store the data in a custom property instead of
a field and have the data for a single record displayed in 3 different
fields when required. If the third item still ends up with lines
longer than 65535 it may not matter if the field wraps. If it still
does mess up the display, then you might have to add some extra
returns when displaying it.
HTH,
Sarah
More information about the use-livecode
mailing list