Deleting lines within a 'repeat for each' loop

Rob Cozens rcozens at pon.net
Tue Aug 19 17:35:00 EDT 2003


>An alternate approach would be to build a new list and not try to 
>delete lines from the original, depending on what you have in mind.

Martin, Dar, et al:

I use this approach in maintaining SDB indexes:

For example, SDB Server maintains a locked record index with a format 
of recordId & tab & clientId & return for each lock.  When a client 
logs off, the sever updates the locked record index like so--

	set item delimiter to tab
	put empty into newList
	put lockedRecordList[sdbDbId] into oldList
	repeat for each line lockedRecord in oldList
		if item 2 if lockedRecord is sdbClientId then next repeat
		put lockedRecord& return after newList
	end repeat
	put newList into lockedRecordList[sdbDbId]

-- 
Rob Cozens, CCW
Serendipity Software Company
http://www.oenolog.net/who.htm

"And I, which was two fooles do so grow three.
  Who are a little wise, the best fooles bee."

 From "The Triple Foole"
by John Donne 1573-1631



More information about the use-livecode mailing list