Populating groups with data
Josh Mellicker
josh at dvcreators.net
Sat Feb 4 19:42:33 EST 2006
Hi Sarah,
Thanks so much for the reply!
The groups have not been created, so I need to clone a group for each
task... but your code certainly gives me a clear path to follow.
Thanks!
Josh
On Feb 4, 2006, at 2:51 PM, Sarah Reichelt wrote:
>> I have data returned from a PHP script, like this:
>>
>> total number of tasks: 4
>> project_id: 3|take trip|task_id: 47|get cookies|vanilla wafers,
>> oreos, choc chip|duncan|3|
>> project_id: 3|take trip|task_id: 46|buy funny hats|all kinds of hats|
>> duncan|3|
>> project_id: 3|take trip|task_id: 40|buy bikes|cool bikes!|duncan|3|
>> project_id: 3|take trip|task_id: 48|get shiny stuff|shiny|duncan|3|
>>
>>
>> I want the data to populate a scrolling group of groups that will
>> look something like this:
>>
>> http://revcoders.org/populating-groups-with-data/
>
> How about something like this:
>
> put last word of tPHPdata into tNumGroups
> delete line 1 of tPHPdata
>
> set the itemDelimiter to "|"
> repeat with g = 1 to tNumGroups
> put line g of tPHPdata into tLineData
> put item 2 of tLineData into field "ProjectName" of group ("Task"
> & g)
> put item 4 of tLineData into field "TaskName" of group ("Task" & g)
> put item 5 of tLineData into field "TaskDetails" of group ("Task"
> & g)
> put item 6 of tLineData into tTaskOwner
> if btn "TaskOwner" of group ("Task" & g) contains tTaskOwner is
> false then
> put cr & tTaskOwner after btn "TaskOwner" of group ("Task" & g)
> end if
> get lineOffset(tTaskOwner, btn "TaskOwner" of group ("Task" & g))
> set the menuHistory of btn "TaskOwner" of group ("Task" & g) to it
> end repeat
>
>
> This assumes that all the groups have been created and are called
> "Task1", "Task2" etc. If they don't already exist, you need to clone
> them and position them. If you make lots in advance, you may want to
> show & hide them depending on how many are full.
>
> BTW, I wasn't sure what all the data segments in your PHP data were,
> but this should give you enough to display the rest wherever you need
> them.
>
> Cheers,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
More information about the use-livecode
mailing list