at the first glance I notice two things in your code, that can be optimized:
the repeat loops do have to determine the number of list items on each iteration, because you write it like:
repeat with i = 1 to templist.count
so each iteration it must be calculated if i is already greater than templist.count, which requires to count templist.
if the number of items in templist do not change, you better count the list once and stoire the result in a local variable:
listcount = templist.count repeat with i = 1 to listcount ...
you can also avoid this problem by looping 'backwards' (although you then must take care of this fact furtheron):
repeat with i = templist.count down to 1 ...
that way templist.count has to be evaluated only once and furtheron it must only be checked if i >= 1
this method also allows you to delete list items inside the repeat loop (as opposed to the other method).
in case of needing to add items to the list things are different, though.
-------
second and much mor important optimization is:
dont't refer always to member(x).text since the text of member(x) must be dereferenced each time, which is very slow. and setting the text of a textmember is veeeery awfully slow.
so you're better of to build your string first in a string variable in RAM (setting the text of a member saves it at the same time to disk, whereas working with a string variable takes place in the MUCH faster RAM entirely)
and when you're done set the text of the text meber ONE SINGLE time.
I bet this change will improve the performance by a significant amount.
also this can even be improved further by using old style lingo
strVar = "<html><head><style type='text/css'>BR {page-break-after: always}</style></head><body> "
put "<table width=95%'><tr><Td colspan=4><font size=+2>" after strVar
put templist[i][j][1][1] after strVar
...
etc.
member("temptext").text = strVar
but in your case it looks like you even don't need to put the string into the text member at all (unless you display it on stage, of course) !
printfile = the moviepath & "\data\printteamfile.htm" fileerror = baWriteFile(printfile, strVar) -- write to file for printing
At 11:59 Uhr +0000 23.01.2004, Lee Blinco wrote:
Another difficulty i have experienced on this project is wanting to insert a value in a list at a given point and not overwriting the existing data but moving it and all subsequent data along one place. I have to do this with a repeat loop every time so that in effect to insert a value in a list at a given place i have to step through the whole list. Is there a better way to do this ?
list.addAt(position, value) --
||| a�ex --
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
