# Please fix my C10 code

**URL:** <https://clarionhub.com/t/please-fix-my-c10-code/2757>\
**Category:** questions\
**Tags:** handcode, compiler\
**Created:** [August 6, 2019, 7:48am UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757 "2019-08-06T07:48:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DonnEdwards](https://clarionhub.com/user_avatar/clarionhub.com/donnedwards/32/1047_2.png) [@DonnEdwards](https://clarionhub.com/u/DonnEdwards)\
**Post date:** [August 6, 2019, 7:48am UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/1 "2019-08-06T07:48:19Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![DonnEdwards](https://clarionhub.com/user_avatar/clarionhub.com/donnedwards/32/1047_2.png) [@DonnEdwards](https://clarionhub.com/u/DonnEdwards)\
**Post date:** [August 6, 2019, 11:01am UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/3 "2019-08-06T11:01:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [August 6, 2019, 11:32am UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/4 "2019-08-06T11:32:22Z")

</div>

> [@DonnEdwards](#):
>
> The app **doesn’t compile** , ever since I added the HelloMsg stuff. Before that it worked fine.

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

---

<div class="post-metadata">

**Author:** ![dcash](https://clarionhub.com/letter_avatar_proxy/v4/letter/d/edb3f5/32.png) [@dcash](https://clarionhub.com/u/dcash)\
**Post date:** [August 6, 2019, 11:38am UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/5 "2019-08-06T11:38:29Z")

</div>

> [@DonnEdwards](#):
>
> The app **doesn’t compile**

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

---

<div class="post-metadata">

**Author:** ![DonnEdwards](https://clarionhub.com/user_avatar/clarionhub.com/donnedwards/32/1047_2.png) [@DonnEdwards](https://clarionhub.com/u/DonnEdwards)\
**Post date:** [August 6, 2019, 11:42am UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/6 "2019-08-06T11:42:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Graham\_Dawson](https://clarionhub.com/user_avatar/clarionhub.com/graham_dawson/32/1331_2.png) [@Graham\_Dawson](https://clarionhub.com/u/Graham_Dawson)\
**Post date:** [August 6, 2019, 12:42pm UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/7 "2019-08-06T12:42:38Z")

</div>

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

```auto
                    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

```

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [August 6, 2019, 2:43pm UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/8 "2019-08-06T14:43:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Graham\_Dawson](https://clarionhub.com/user_avatar/clarionhub.com/graham_dawson/32/1331_2.png) [@Graham\_Dawson](https://clarionhub.com/u/Graham_Dawson)\
**Post date:** [August 6, 2019, 2:54pm UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/9 "2019-08-06T14:54:11Z")

</div>

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 😀

---

<div class="post-metadata">

**Author:** ![DonnEdwards](https://clarionhub.com/user_avatar/clarionhub.com/donnedwards/32/1047_2.png) [@DonnEdwards](https://clarionhub.com/u/DonnEdwards)\
**Post date:** [August 8, 2019, 7:40am UTC](https://clarionhub.com/t/please-fix-my-c10-code/2757/10 "2019-08-08T07:40:07Z")

</div>

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