getting data from a field and putting it into another field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
CAsba
Posts: 452
Joined: Fri Sep 30, 2022 12:11 pm

getting data from a field and putting it into another field

Post by CAsba »

Hi,
Just when you thought you'd got rid of me...

The code is

Code: Select all

put item 1 of line 2 of fld "arraydata" into fld "de11"
.
The problem is, Instead of just getting item 1, it puts the whole line - 3 items - into fld de11.

I have tried putting the items into fld arraydata using tab and using "," as the delimiter.

I could of course, bypass arraydata and put the fields directly into the de** fields, but I don't want to do that as I want to rename and keep the arraydata field to produce duplicate copies of the document if required.

To summarise, how can I get the items of each line in fld arraydata into new individual fields ?
glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: getting data from a field and putting it into another field

Post by glenn9 »

Hi CAsba,

did you set the 'itemdelimiter'?

Regards,
Glenn
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: getting data from a field and putting it into another field

Post by dunbarx »

Glenn makes a point; though you mentioned the itemDel, there is no context to see what is going on.

Your single line code example tells un nothing about the actual string you are trying to process.

What is that string?

Try again... :wink:

Craig
stam
Posts: 3214
Joined: Sun Jun 04, 2006 9:39 pm

Re: getting data from a field and putting it into another field

Post by stam »

I was gonna say... this doesn't quite make sense.
perhaps post some of the text you're trying to process and your handler?

S.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: getting data from a field and putting it into another field

Post by dunbarx »

Stam.

I think we have the handler, or at least a line in it that is of interest.

What we don't have is the contents of what seems to be a single line of text, in which the problem lies. Or rather, I bet, missing items...

Craig
CAsba
Posts: 452
Joined: Fri Sep 30, 2022 12:11 pm

Re: getting data from a field and putting it into another field

Post by CAsba »

Thanks Glenn, I didn't know the itemdelimiter setting was necessary for the extraction of data from a field. It works !
Thanks again.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: getting data from a field and putting it into another field

Post by Klaus »

The DEFAULT itemdelimiter = COMMA, so you need to set it everytime you need something else as a delimiter!
CAsba
Posts: 452
Joined: Fri Sep 30, 2022 12:11 pm

Re: getting data from a field and putting it into another field

Post by CAsba »

Very good, Klaus, I'll remember that ! Many thanks.
Post Reply