referring to a field that is part of a group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
referring to a field that is part of a group
This seems like a really basic question but I can't find an explanation anywhere: how does one refer to a field that is part of a group.
I have a number of text fields grouped and the group is then used as a background extending across several cards. I want to be able to read the contents of a specific field on a specific card and transfer the contents to a variable. Presumably it is not necessary to ungroup the fields, read the specific field and then regroup.
I have a number of text fields grouped and the group is then used as a background extending across several cards. I want to be able to read the contents of a specific field on a specific card and transfer the contents to a variable. Presumably it is not necessary to ungroup the fields, read the specific field and then regroup.
Hi Alistair,
you already have the answer in your question:
If you do not have several fields with the same name on a card (you would never do so, right?
) then you don't even need to specify the groups name.
Definitvely NO need to ungroup or other tricky procedures
Hope that helps.
Best
Klaus
you already have the answer in your question:
Code: Select all
...
put fld "your field in a group here" of cd "whatever" into field_var
...

Definitvely NO need to ungroup or other tricky procedures

Hope that helps.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
If your field is part of a group woth backgroundbehaviour, you'll have to first 'go' to that specific card - otherwise you get the data from that same field as displayed on the current card. Preferably wrap this 'go' inside a lock/unlock screen pair to avoid that the user sees the change in cards.
HTH,
Jan Schenkel.
Code: Select all
on mouseUp
lock screen
go card 2
put field "Foobar" into tData
go back
unlock screen
answer tData
end mouseUp
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Sorry, Jan, but this is really not necessary!
You can simply do as I wrote in my first anwer:
Just tested and works 
You can simply do as I wrote in my first anwer:
Code: Select all
...
put fld "your field in a group WITH BG behaviour here" of cd "whatever" into field_var
...

-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Now I remember what my problem in this regard was - it was in the context of the 'value' function: http://quality.runrev.com/qacenter/show_bug.cgi?id=1836
Anyway, carry on, nothing to see here - Klaus was right from the start and I was making things more complicated because of a corner case...
Jan Schenkel.
Anyway, carry on, nothing to see here - Klaus was right from the start and I was making things more complicated because of a corner case...

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com