Welcome, Guest. Please login or register.

Author Topic: Unterminated Macro Call  (Read 4933 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show all replies
    • http://www.EdwardGDanaII.info
Unterminated Macro Call
« on: April 21, 2009, 02:14:55 AM »
I'm attempting to learn Reaction for AmigaOS 3.9. Unfortunately, I'm encountering a problem for which I have no clue. I'd post this on UtilityBase, but it's still under the Google's "Attack Site" thumb, making navigation a pain in the S over there.

Whenever I try to compile this Reaction example:
Code: [Select]
objects[OID_MAIN] = WindowObject,
WA_ScreenTitle, "Reaction",
WA_Title, "Reaction CheckBox Example",
WA_Activate, TRUE,
WA_DepthGadget, TRUE,
WA_DragBar, TRUE,
WA_CloseGadget, TRUE,
WA_SizeGadget, TRUE,
WINDOW_IconifyGadget, TRUE,
WINDOW_IconTitle, "CheckBox",
WINDOW_AppPort, AppPort,
WINDOW_Position, WPOS_CENTERMOUSE,
WINDOW_ParentGroup, gadgets[GID_MAIN] = VGroupObject,
LAYOUT_SpaceOuter, TRUE,
LAYOUT_DeferLayout, TRUE,
LAYOUT_AddChild, gadgets[GID_CHECKBOX1] = CheckBoxObject,
GA_ID, GID_CHECKBOX1,
GA_RelVerify, TRUE,
GA_Text, "CheckBox _1",
CHECKBOX_TextPlace, PLACETEXT_RIGHT,
CheckBoxEnd,
CHILD_NominalSize, TRUE,
LAYOUT_AddChild, gadgets[GID_CHECKBOX2] = CheckBoxObject,
GA_ID, GID_CHECKBOX2,
GA_RelVerify, TRUE,
GA_Text, "CheckBox _2",
CHECKBOX_TextPlace, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_AddChild, VGroupObject,
GA_BackFill, NULL,
LAYOUT_SpaceOuter, TRUE,
LAYOUT_VertAlignment, LALIGN_CENTER,
LAYOUT_HorizAlignment, LALIGN_CENTER,
LAYOUT_BevelStyle, BVS_FIELD,
LAYOUT_AddImage, LabelObject,
LABEL_Text, "The checkbox may have its label placed\n",
LABEL_Text, "either on the left or right side.\n",
LABEL_Text, " \n",
LABEL_Text, "You may click the label text as well\n",
LABEL_Text, "as the check box itself.\n",
LabelEnd,
LayoutEnd,
LAYOUT_AddChild, ButtonObject,
GA_ID, GID_QUIT,
GA_RelVerify, TRUE,
GA_Text,"_Quit",
ButtonEnd,
CHILD_WeightedHeight, 0,
EndGroup,
EndWindow;


I get the following error:
Quote
134 W:\Projects\Amiga\Reaction\CheckBox\checkboxexample.c unterminated macro call


I know what a macro is, but I have no idea how to "terminate it." (Short of calling for Arnie's help, that is).

I'm using AmiDevCpp and compiling to a standard Amiga C++ program. I tried downloading their Reaction.DevPak but I end up with the MUI.DevPak instead. (Which has it's own problems too, I'll post on that later).

Any and all clues appreciated.

Ed.
Ed.
 

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show all replies
    • http://www.EdwardGDanaII.info
Re: Unterminated Macro Call
« Reply #1 on: April 22, 2009, 01:39:41 AM »
I noticed that too, Kronos, but not knowing enough about what's going on here I wasn't sure.


@ Thomas

Yea, I thought that might be the case, but the fact that I've used macros so little combined with the non-standard (for me) creation of the window, makes me unsure of just what's going on here.


@ Both

The problem is, even when I simplify the structure to just this:
Code: [Select]

objects[OID_MAIN]
= WindowObject,
    WA_ScreenTitle, "Reaction",
    WA_Title,       "Reaction CheckBox Example",
    WA_Activate,    TRUE,
    WA_DepthGadget, TRUE,
    WA_DragBar,     TRUE,
    WA_CloseGadget, TRUE,
    WA_SizeGadget,  TRUE,
  End;


I still get the unterminated macro error. Once again, I don't have enough understanding to diagnose what the real problem is, and for all I know, I didn't simplify it correctly or terminated it properly, yada, yada, yada...

Once again, if anyone has any ideas, I'd love to hear them.

Thanks,
Ed.
Ed.
 

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show all replies
    • http://www.EdwardGDanaII.info
Re: Unterminated Macro Call
« Reply #2 on: April 23, 2009, 04:30:59 AM »
Well, I doubt that I'll ever mix OS 3.9 with OS 4.0 since I don't have much use for a PPC machine. (Yep, I'm in the x86 camp). :)

I should probably be doing this in MUI, since Zune is its "clone" from AROS, but as I'm doing this more for fun than seriously, I want to try Reaction just for giggles.

I was missing "proto/window.h", but putting it in the source file doesn't cure the problem. I'm still getting the Macro error.

Any other ideas?

Ed.
Ed.
 

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show all replies
    • http://www.EdwardGDanaII.info
Re: Unterminated Macro Call
« Reply #3 on: April 23, 2009, 04:31:49 AM »
Oh, and does anyone have any examples that they know works? I'm willing to try anything here.
Ed.
 

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show all replies
    • http://www.EdwardGDanaII.info
Re: Unterminated Macro Call
« Reply #4 on: April 23, 2009, 04:47:03 AM »
Playing a hunch based on Thomas' comments, I changed the simplified code to look like this:
Code: [Select]

objects[OID_MAIN]
= WindowObject,
  WA_ScreenTitle, "Reaction",
  WA_Title,       "Reaction CheckBox Example",
  WA_Activate,    TRUE,
  WA_DepthGadget, TRUE,
  WA_DragBar,     TRUE,
  WA_CloseGadget, TRUE,
  WA_SizeGadget,  TRUE
);


Notice that the macro "End" has been changed to a ");".

This gets rid of the unterminated macro error and instead gives me new and more puzzling errors:
Quote
W:\Projects\Amiga\Reaction\CheckBox\checkboxexample.c In function `int main()':
138 W:\Projects\Amiga\Reaction\CheckBox\checkboxexample.c initialization to `long unsigned int' from `const char *' lacks a cast
138 W:\Projects\Amiga\Reaction\CheckBox\checkboxexample.c initialization to `long unsigned int' from `const char *' lacks a cast
138 W:\Projects\Amiga\Reaction\CheckBox\checkboxexample.c ANSI C++ forbids implicit conversion from `void *' in assignment
 W:\Projects\Amiga\Reaction\CheckBox\Makefile.win [Build Error] exe: *** [checkboxexample.o] Error 1


That the two strings are being miscast to longs makes no sense whatsoever, since those positions are clearly string constants.

(I'm ready shave my head, become a monk and give up programming forever... somebody stop me before it's to late.) ;-)

Ed.
Ed.
 

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show all replies
    • http://www.EdwardGDanaII.info
Re: Unterminated Macro Call
« Reply #5 on: April 24, 2009, 05:04:31 AM »
Thanks, Heinz. Your example actually compiles. I'll play with it more a little later. Unfortunately, my priorities have shifted now that my father is in the hospital. :(

Your point about OS3.9/4.0 is well taken, but I'm only doing this to sharpen my C/C++ skills. As to MUI, I've been trying it too, but it doesn't compile either. When I'm ready, I'll post my difficulties with it here later, but later, when things settle down.

Ed.
Ed.