Shao, In the example you give, I would bet the "repeat with" is faster, since it only has to do 128 "replace" statements, whereas the "repeat for each" would have to adjust each character one at a time. It probably depends on the size of what's being converted - if it's small, "repeat for each", if it's large, "repeat with" (in *this* example).
Just my thoughts without benchmarking it... Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ ----- Original Message ----- From: "Shao Sean" <[EMAIL PROTECTED]> To: "Mail-List MetaCard" <[EMAIL PROTECTED]> Cc: "Mail-List MetaCard" <[EMAIL PROTECTED]> Sent: Thursday, September 26, 2002 1:13 AM Subject: which is faster (a repeat structure question) > 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 > > _______________________________________________ > metacard mailing list > [EMAIL PROTECTED] > http://lists.runrev.com/mailman/listinfo/metacard > _______________________________________________ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard