Repeats, creating multiple field boxes to mimic grid -SOLVED
Posted: Wed Sep 03, 2008 5:26 pm
Hi, New to the Revolution trying to get my head around the syntax, I normaly program web sites with PHP.
I'm trying to mimic a grid by creating multiple rows of field boxes.
The number of rows will be determined by the number of rows in a database.
So far I have this: (testing with preset values from a button action)
on mouseUp
put 100 into xpos
put 100 into ypos
put 1 into dbdfieldscountstart
put 4 into dbfieldscountend
put 5 into dbrowscount
repeat with dbrows = 1 to dbrowscount
repeat with dbfields = dbdfieldscountstart to dbfieldscountend
create field dbfields
set the location of card field dbfields to xpos,ypos
set the width of card field dbfields to 50
set the height of card field dbfields to 20
add 50 to xpos
end repeat
put 100 into xpos
add 30 to ypos
put dbfieldscountend into dbfieldscountstart
put 8 into dbfieldscountend
end repeat
end mouseUp
This creates the rows but removes each row during the next repeat which I do not understand?
Also the initial created field box remians in situ?
You may be asking 'why dosn't he use the field table?' - I want to easily specify backround colours of individual fields dependent on content. Looking through the docs and searching the forums this does not seem possible....apart from this it's also a good exercise for me.
Any help will be much appreciated.
Andy
I'm trying to mimic a grid by creating multiple rows of field boxes.
The number of rows will be determined by the number of rows in a database.
So far I have this: (testing with preset values from a button action)
on mouseUp
put 100 into xpos
put 100 into ypos
put 1 into dbdfieldscountstart
put 4 into dbfieldscountend
put 5 into dbrowscount
repeat with dbrows = 1 to dbrowscount
repeat with dbfields = dbdfieldscountstart to dbfieldscountend
create field dbfields
set the location of card field dbfields to xpos,ypos
set the width of card field dbfields to 50
set the height of card field dbfields to 20
add 50 to xpos
end repeat
put 100 into xpos
add 30 to ypos
put dbfieldscountend into dbfieldscountstart
put 8 into dbfieldscountend
end repeat
end mouseUp
This creates the rows but removes each row during the next repeat which I do not understand?
Also the initial created field box remians in situ?
You may be asking 'why dosn't he use the field table?' - I want to easily specify backround colours of individual fields dependent on content. Looking through the docs and searching the forums this does not seem possible....apart from this it's also a good exercise for me.
Any help will be much appreciated.
Andy