Many Cards vs. Lists vs. XML

Sivakatirswami katir at hindu.org
Mon Feb 18 15:16:19 EST 2008


Peter Alcibiades wrote:
> Sivakatirswami, thanks for a most interesting and thought provoking post and 
> approach that would never have occurred to me.  Perhaps the disadvantage of 
> it might be that exporting the data in a way that can be used by another 
> application might require extra work, if you feel the need to provide for 
> that? 

Work? I don't think so.., in  my "baby xtalk" way of coding

# export, tab delimited:

# let's get a header first
# assume card 1 has all fields that any record might have

  repeat with y = 1 to the number of flds of card 1
        put the short name of fld y & tab after tOutput
   end repeat

put cr after tOutput

# now the data:

put the card names of this stack into tRecords

repeat for each line x in tRecords
   repeat with y = 1 to the number of flds of card x
        put fld y & tab after the output
   end repeat
put cr after tOutput
end repeat

put tOutput into url "file:/myExport.txt"

Speed issues:

1) never load data runtime into a field (one line at a time) Always load 
a variable then put that into a field
(in case you are doing runtime lists-reports in the UI)
2) don't use " go to card x  # and then do stuff... instead. refer to 
the card by it's card name.. which you have
previously set to be the primary ID for the record-- which is  your key 
field in the UI...






>   
>
> But apart from that, its very interesting and I'll try it.
>
> Peter
> _______________________________________________
> 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