I have some code to create fields...
if not exists(field sector3) then
create invisible field sector3
put "7,8,9,10,11,12,25,26,27,28,29,30" into field sector3
end if
if not exists(field sector2) then
create invisible field sector2
put "5,6,17,18,19,20,21,22,31,32,33,34" into field sector2
end if
if not exists(field sector1) then
create invisible field sector1
put "1,2,3,4,13,14,15,16,23,24,35,36" into field sector1
end if
Problem was that all three fields had the sector1 contents.
However when I re-ordered them as 1,2,3 the contents
of each is correct.
Any explanation appreciated.
What's going on here?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
What's going on here?
Life is just a bowl of cherries.
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
While I have no immediate explanation, I would advise that you quote the names of your fields when you refer to them:
Otherwise, Revolution starts looking for a variable named 'sector3' - and if it exists then it will see what's inside variable 'sector3' and use that as the name of the field. If such a variable doesn't exist, Revolution will create it for you and initialize its contents with "sector3".
Jan Schenkel.
Code: Select all
if there is not a field "sector3" then
create invisible field "sector3"
put "..." into field "sector3"
end if
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com