Sure...
STR$() Converts a numeric value to a string.
LTRIM$() stands for Left Trim, which means it trims off any spaces to the left side of a string.
Strings are letters like, A,b,c, and other characters like #, *, etc. Now strings can also be numbers, but here's a big difference. Try the code below...
So printing a number as a numeric variable results in a space in front of the number, and a space in back of the number. Now when we use STR$() to represent the numeric variable as a string, it gets rid of the trailing space, but notice it still keeps that leading space. That space is reserved for a negative sign. See code below...
So if a negative sign was present, it wouldn't need to be "Left Trimmed" but you could still use LTRIM$(STR$(a)) if you want to. I always use it that way, as most of my work contains negative and positive numbers, so I just want one simple way to do it all. So LTRIM$(STR$(a)) makes the 1 just take up one space, instead of 3 spaces, and that is critical to aligning text.
Next, LOCATE...
LOCATE has two variables, ROW, COLUMN. So why did I leave the ROW part out and write LOCATE , 15 in the code? Well, omitting the ROW variable tells QB64 to locate on the current row. So if I'm on the 10th row, LOCATE , 15 keeps me on the 10th row, and starts the first text writing space at COLUMN 15. So, no need to write it as LOCATE 10, 15. It's neat typing saver!
Finally, the LEN() statement. LEN() measures the length of your string. Not a big deal if they are all the same length, but let's say the first variable is one space like "7" and in the row below it, the next variable is: "53" So the first variable has LEN("1") = 1 character in length, and the second LEN("53") would be 2-characters long. If we wanted to line up the variables, so they all end at column 9 we would need...
So the first statement starts at the current row at column 10 - length of the number 7, which is 10 - 1 or 9. It then prints 1 at column 9. Notice the PRINT statement is not followed by a semi-colon as in PRINT; so just PRINT alone tells QB64 to print and move down to the next row. A semi-colon added would tell it to stay on the same row. So since we omitted a semi-colon, we printed 7 and we are now on the next row, below. The second statement locates on that row at column 10 - 2, because our next number, 53, has a length of 2-characters. We use LTRIM$(STR$(53)) to get rid of the leading and trailing spaces. So the 5 of the 53 gets printed at column 8 (10 - 2) and the 3 ends up at column 9, the same column the number 7 is printed in, in the row above.
I hope this makes sense. If not, just ask.
Pete