Please fix my C10 code

Another newbie question. What is wrong with this code? I’m missing something simple but fundamental here.
Edit: It doesn’t compile

PROGRAM

    INCLUDE('equates.clw'),ONCE 

  MAP

    HelloMsg  PROCEDURE
     
  END

MyWindow WINDOW(' Fixer 1.0'),AT(,,188,106),GRAY,FONT('Tahoma',9,,FONT:regular),RESIZE,CENTER,GRAY,ICON('WIZFIND.ICO'),SYSTEM,STATUS

        PROMPT('Scan and replace text in Clarion text files'),AT(10,10),FONT(,12,,FONT:regular)
        PROMPT('(c) Copyright 2019 Black and White Inc'),AT(10,30),FONT(,9,,FONT:regular)
        BUTTON('&Go'),AT(100,80,36,14),USE(?OkButton),DEFAULT,LEFT,MSG('Scan the files'),TIP('Scan the files')
        BUTTON('&Exit'),AT(140,80,36,14),USE(?CloseButton),LEFT,MSG('Close the program'),TIP('Close the program')
           
    END

    CODE
        OPEN(MyWindow)
        ACCEPT
            CASE FIELD()
            OF 0
               CASE EVENT()
               OF EVENT:OpenWindow
               END
            OF ?OkButton
               CASE EVENT()
                OF EVENT:Accepted
                    MyWindow{PROP:StatusText} = '(c) Copyright 2019 Black and White Inc'
                    HelloMsg
               END
            OF ?CloseButton
               CASE EVENT()
               OF EVENT:Accepted
                  POST(EVENT:CloseWindow)
               END
            END ! Case
        END ! Accept

 HelloMsg   PROCEDURE
  CODE
    MESSAGE('Hello World!','Clarion')
    RETURN

The app doesn’t compile, ever since I added the HelloMsg stuff. Before that it worked fine.

Line 7: Expected: ( , * ; -

That’s the line in the MAP region that reads
“HelloMsg PROCEDURE”

Line 43: Expected: ( [ &= :=: { @ . ;

That’s the line that reads " HelloMsg PROCEDURE" 4 lines from the end

Line 48: Missing procedure definition: HELLOMSG

The project (not app) compiles and runs for me, C10 and C11.

1 Like

Make sure your indentation is correct. HelloMsg on Line 7 must begin in column 1.

Thanks for the prompt reply. As I said it was a newbie question. It seems to be working now.

Donn there’s 2 ways to declare procedures in the MAP - one MUST begin at column 1, the other way doesn’t have to start at column one eg

                    MAP
! Style one must begin at column number 1
ProcDeclarationStyleOne PROCEDURE(STRING paramOne,LONG paramTwo),LONG

! Style two doesn't have  to start at column 1 - notice no PROCEDURE

                        ProcDeclarationStyleTwo(STRING paramOne,LONG paramTwo),LONG
                        HelloMsg() !Style Two with empty brackets indicating no parameters

                    END
1 Like

I never understood why the compiler couldn’t just compile style #1 at any column. It should know what I mean. <g>

1 Like

Hi Jeff,

Agreed - but then computer applications are stupid - why for example did my posted code above have bold sections or change colours mid line - I didn’t (knowingly) tell it to.

Ideally 6th or 7th generation RAD solutions should be thought driven :grinning:

1 Like

Thanks for the clarification. You guys are extremely helpful (and patient)