Hi,
Can someone pleases explain to me this AR(!) register, how it works and should be used?
please and thanx.
AR(1)
-
slamcity -
December 18, 2014 at 4:38 PM -
Thread is marked as Resolved.
-
-
It appears to be an argument.
You could call a program with an argument and use the argument to control what part of the program to run.
We use it to call a messaging program with an argument that displays the message that we want to appear on the screen.
So AR(1) might display "waiting on ejector return" and AR(2) might display "robot at home, Ready to Start"
-
This is an Argument register.
You will see it in a called program.
Before the call you will see a statement like
CALL Measure R[11], 25
R11 will be AR1 and 25 will be AR2
The value in R11 and 25 will be used satisfy the argument -
has anyone figured out how to program around uninitialized AR[]s in TPP yet? i have been looking though system variables from time to time over the last couple of years to see if they are saved anywhere that i can access. in Karel you can check a if a variable has a value in it with the IF UNINIT(variable) built in. it would be nice to call a sub program with an argument that has a default value.