2020-05-12 12:57:10

Hello all, and welcome to the first part of my guide to pure basic!
In this part, we will learn how to create a simple hello world program and learn how to make functions at the same time.
So, here is how you do it. Every single line of the code is commented.
Procedure hello(string.s);Procedure = what the thing is, hello = the function name, it is enclosed in brackets. The .s at the end of the word string but before the right parenthesis denotes the variable type, like a file extension but for a variable.
PrintN("hello, "+string+"!");the PrintN function allows you to print text to the console aka terminal with a new line at the end in order to look nice with screen readers. Also, the reason we have plus signs enclosing te variable name, is because, pretty much it is, "hello, " plus string plus an empty string ("") with a right paren at the end since it's a function and they are inclosed in brackets.
EndProcedure;You have to put this at the end of all of your procedures to let the program that it isn't ina  procedure declaration mode anymore.

OpenConsole();open a terminal window. Trying to print to one without doing this first will cause a crash to occur. Also, don't try it, it could lock up NVDA if you have a slow computer.
;now let's call the procedure we just made!
hello("world");we gave it the string "world" because the parameter, string, that we gave it, accepts a string, which is either a string of characters enclosed in quotation marks, another string, or a function that returns (gives back) a string (more on these in a later part)
Input();wait for the user to enter something, or nothing, it just keeps the program open so the user can view our texts.
;And that's it, you now have your first program in pb!


I hope you find this guide useful, please let me know whether you want extra parts in an email to "[email protected]"