Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working
Show menu Show menu

Do-While loop

Scripts example - Do-While loop

// regional settings
$decimalsymbol=".";
$listseparator=",";
//
cls;
// do-while loop example
do {
	i=rand(10);
	print i;
	println; 
} while (i<>5)

Output

1
3
2
8
9
2
10
2
5

Since this script uses random numbers, the output of this script will differ each time it is executed.

See also