Search code examples
basic

What is the pound/hash symbol for in BASIC?


So, I'm struggling with a school project, I have a BASIC code, that is programmed on a PALM, I need to translate that to LabView, so first I'm translating the code to pseudocode, but I've never used BASIC before, so I'm having trouble with some lines.

So far, I know that: VariableName# = 15, means the type of the variable is double, and that it can be used on the right side of a number to convert it to double, like VariableName# = 15#

I also have on my code: OPEN "LPT1" FOR OUTPUT AS #1, opens serial port found on COM1, and names it "LPT1"

But a few lines later I found this, and I don't know what is it supposed to do:

225 FOR J = 1 TO 6000: PRINT #1, 40; : NEXT J
226 FOR ZZ = 1 TO S9: PRINT #1, 41; : NEXT ZZ

I know how FOR statements work, but what is it supposed to print?

PS: It's a solar positioning system.

edit: S9 is defined at the beggining of the program, it's 450.


Solution

  • Lines 225 and 226 are printing to #1 which is mapped to line printer 1 (e.g. the parallel port and usually a centronics connectors)

    OPEN "LPT1" FOR OUTPUT AS #1
    

    Next, decimal 40 and 41 are ( and ) respectively. So it's formatting and printing those symbols to your printer.