Hey! Welcome to my tutorial! Here we will be talking about user-defined instructions. User-defined instructions act kind of like gosub, excep you can add arguments and make your own codes! Well, lets start already!
User-defined instructions with no arguments
Yes, all of these use the def command. This is the section for the basics. Yay. Here are some rules for def:
1. You can't have a def in a def. Example:
will give you an error.
2. Def has to end with end. If it doesn't, the program won't know where to stop.
3. You probably want something in the def, if you don't it is useless.
With def you just put def then the name of the instruction. Then the code and end. I would not recommend putting end in the middle of a def/end code.
Here are some screenshots:
Less simple def/end
User instructions with arguments but no return values
The section above with arguments. Yay.
Arguments help define the outcome. Sure, you can have inputs in the def, but this is easier. Screenshots:
Simple Def/end with arguments
More complex Def/end with arguments
Note that the complex call has quotation marks on the third argument. That is because I used a string variable in defining on the third argument. If you don't know, normal variables can be used like V1, but string variables have a $ after them, like V1$.
So that was my tutorial, I'll try to learn the one with return values. After that, I will hopefully remember this and update it. Thank you for reading!