• Colons in AppleSoft

    From Tom Thumb@21:1/5 to All on Tue Aug 2 14:15:40 2022
    I was entering lines in AppleSoft from an Open Apple issue. Some lines begin with colons such as:

    350 : GOSUB 1000
    440 :: GOSUB 1000

    I know a colon separates statements on the same line but what are they doing it the above statements? Adding empty statements? For what purpose?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tom Thumb@21:1/5 to All on Tue Aug 2 16:13:17 2022
    It is possible they were just trying to indent the code to make it look
    more like a structured listing to make it easier to find sections.

    Hmm, I guess, thank you. I removed them all and the code runs the same, so, no functional purpose other than what you suggest. Again, hmm.
    I felt a little silly for asking, but, I'm impulsive.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Blakeney@21:1/5 to Tom Thumb on Tue Aug 2 19:01:03 2022
    On 2022-08-02 5:15 p.m., Tom Thumb wrote:
    I was entering lines in AppleSoft from an Open Apple issue. Some lines begin with colons such as:

    350 : GOSUB 1000
    440 :: GOSUB 1000

    I know a colon separates statements on the same line but what are they doing it the above statements? Adding empty statements? For what purpose?

    It is possible they were just trying to indent the code to make it look
    more like a structured listing to make it easier to find sections.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From qkumba@21:1/5 to All on Wed Aug 3 08:48:03 2022
    Depending on the source, it might be bad OCR, or there might have been code in the original that was erased with a hex-editor, but leaving the colons in place to prevent syntax errors.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Finnigan@21:1/5 to Jeff Blakeney on Wed Aug 3 20:35:22 2022
    Jeff Blakeney wrote:
    On 2022-08-02 5:15 p.m., Tom Thumb wrote:
    I was entering lines in AppleSoft from an Open Apple issue. Some lines
    begin with colons such as:

    350 : GOSUB 1000
    440 :: GOSUB 1000

    I know a colon separates statements on the same line but what are they
    doing it the above statements? Adding empty statements? For what purpose?

    It is possible they were just trying to indent the code to make it look
    more like a structured listing to make it easier to find sections.


    I agree. This is a technique that I've seen before in Applesoft listings.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Doherty@21:1/5 to D Finnigan on Wed Sep 28 12:45:10 2022
    On Wednesday, August 3, 2022 at 4:35:24 PM UTC-4, D Finnigan wrote:
    Jeff Blakeney wrote:
    On 2022-08-02 5:15 p.m., Tom Thumb wrote:
    I was entering lines in AppleSoft from an Open Apple issue. Some lines
    begin with colons such as:

    350 : GOSUB 1000
    440 :: GOSUB 1000

    I know a colon separates statements on the same line but what are they
    doing it the above statements? Adding empty statements? For what purpose?

    It is possible they were just trying to indent the code to make it look more like a structured listing to make it easier to find sections.

    I agree. This is a technique that I've seen before in Applesoft listings.
    I also agree with Jeff and Dave, it's just a programming workaround to provide a little bit of code indenting in a language that doesn't natively support doing that. There would be a slight performance penalty, but probably very little

    A guy named Andres Lozano built a nice pre-processor for Applesoft that lets you code in a virtualized, improved language he calls Virtual Basic which it translates into standard Applesoft for execution. Just thought I'd mention it for those of us who
    wish we could indent our Applesoft code :)
    https://virtualbasic.org/

    rem my main program
    print "this is my first test"
    gosub @printhello
    end

    rem my subroutine
    #printhello
    s$ = "hello world"
    print s$
    a= 10:b= 5
    print a + b
    return

    --Martin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)