Help with the loop stuff attempt
a loop has scar repeat stuff as many times as defined (told to)
it is included within a procedure
SCAR Code:
program TheLoop;
begin
repeat //this starts the loop everything after will be repeated
TypeSend('ABCDEF');
until(false); // this ends the loop
This loop will endlessly TypeSend the string ABCDEF because
there is nothing to be defined as false
basically everything between repeat and end will be looped
this is a bad idea because you eventually want it to end so you need a way
to make it end eventually or when it has done something a number of times
this is done with variables
SCAR Code:
program TheLoop;
var //defines there will be a variable following
x: = Integer; //Says that x will be an integer
// an integer is a number
//so x might = 1,7, or 182081 ect.
begin
x: = 0 //defined x as 0
repeat //this starts the loop everything after will be repeated
x: = x + 1; //This makes x = x + 1, so [x = 0 + 1], when it repeats it
//will be [x = 1 + 1] because the first time you added 1 to x
TypeSend('ABCDEF');
until(x > 4); //now it will check if x is greater than 4
{The first time x will equal 1. 1 is less than 4 so it will
keep repeating. Then when it checks again x will = 2 which is
still less than 4 so it will continue and so on}
{Once x = 5, because it is not [x=4], it will stop}
Did that help?
If not then post here or pm me and I will try to do better