PDA

View Full Version : About count?


pierre
04-19-2004, 07:08 AM
Hi all:
I want to make a dialog window that it can input a nubmer by user when I uses a loop to count.

It means the AMS5.0 can display a dialog window after clicking a button. Then it can input a number by user to count for looping. If the AMS5.0 call a window, I key a number is five. The meaning my program codes can do five loops on this program.

How can I do it? Who has a example that it can reach my purpose? Thanks.

Worm
04-19-2004, 07:41 AM
nLoop = Dialog.Input("Loops", "How many times would you like to cycle the loop?", "5", MB_ICONQUESTION)
nLoop = String.ToNumber(nLoop)
if nLoop == 0 then
Dialog.Message("Invalid Input", "Please use a numeric value greater than 0.")
else
for n=1, nLoop do
Dialog.Message("Loop", "This is loop " .. n .. " of " .. nLoop)
end
end



Hi all:
I want to make a dialog window that it can input a nubmer by user when I uses a loop to count.

It means the AMS5.0 can display a dialog window after clicking a button. Then it can input a number by user to count for looping. If the AMS5.0 call a window, I key a number is five. The meaning my program codes can do five loops on this program.

How can I do it? Who has a example that it can reach my purpose? Thanks.

pierre
04-19-2004, 07:45 AM
Worm:
Thank you for replying quickly. I had tried your methods that it is ok. Thank you again.