Newbie question
Rob Cozens
rcozens at pon.net
Fri Aug 2 19:36:01 EDT 2002
>I don't see anything about Progress Bars on the documentation. Are
>there commands I did not see ?
Hi Fred,
I thought there was an example in one of the Rev stacks...but I can't
find it so here's a sample from one of my handlers. I've prefixed
each statement pertinent to the progress bar with "}"
if backingUp then
put "binfile:"&(the text of button "Destination Title") into backupFileName
set the label of stack "Backup Progress" to
sdbMessage(sdbBackupInProgressLabel)
put (field "File Index" of card 2 of stack
sdbStackName)&recordDelimiter into backupData
} put the number of cards of stack sdbStackName into lastRecord
} put lastRecord-3 into recordCount
} set the thumbPosition of scrollBar "Progress Scrollbar" to 0
} set the endvalue of scrollBar "Progress Scrollbar" to recordCount
} show scrollBar "Progress Scrollbar"
} put 0 into recordsProcessed
} put round(recordCount/(the width of scrollBar "Progress
Scrollbar")) into progressInterval
} put max(1,progressInterval) into progressInterval
repeat with x=4 to lastRecord
set cursor to busy
put field "Record Type" of card x of stack sdbFileName into theType
put field "Record Key" of card x of stack sdbFileName into theKey
put field "Record" of card x of stack sdbFileName into theRecord
put theType&&theKey&return&theRecord&recordDelimiter after backupData
} add 1 to recordsProcessed
} if (recordsProcessed mod progressInterval)=0 then set the
thumbPosition of scrollBar "Progress Scrollbar" to recordsProcessed
end repeat
} set the thumbPosition of scrollBar "Progress Scrollbar" to
recordCount -- yes, recordCount
else
--
Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/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 (1572-1631)
More information about the use-livecode
mailing list