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: FourthWorld, heatherlaine, Klaus, kevinmiller

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

getting data from a field and putting it into another field

Post by CAsba » Sun May 07, 2023 7:17 pm

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: 223
Joined: Wed Jan 15, 2020 10:45 pm
Location: Europe

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

Post by glenn9 » Mon May 08, 2023 12:34 am

Hi CAsba,

did you set the 'itemdelimiter'?

Regards,
Glenn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Post by dunbarx » Mon May 08, 2023 12:38 am

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: 2777
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

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

Post by stam » Mon May 08, 2023 2:35 am

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: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Post by dunbarx » Mon May 08, 2023 4:25 am

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: 389
Joined: Fri Sep 30, 2022 12:11 pm

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

Post by CAsba » Mon May 08, 2023 9:12 am

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: 13878
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Mon May 08, 2023 9:46 am

The DEFAULT itemdelimiter = COMMA, so you need to set it everytime you need something else as a delimiter!

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

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

Post by CAsba » Mon May 08, 2023 12:29 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”