which is faster (a repeat structure question)
Shao Sean
shaosean at unitz.ca
Thu Sep 26 02:25:00 EDT 2002
repeat with i = 127 to 255
replace numToChar(i) with ("=" & toUpper(baseConvert(i,10,16))) in
inputData
end repeat
return inputData
repeat for each char inputDataChar in inputData
if (charToNum(inputDataChar) >= 127) then
put "=" & toUpper(baseConvert(charToNum(inputDataChar),10,16)) after
outputData
else
put inputDataChar after outputData
end if
end repeat
return outputData
is "repeat for each" really that much quicker? i realize that the amount of
data being converted is a major factor, but the first one only needs to loop
128 times whereas the second one has to loop for each char, which could be
well more than 128 chars..
TIA - Sean
More information about the metacard
mailing list