"while" won't want to obey (SOLVED) (I'm with stoopid)

Started by Monsieur OUXX, Wed 28/04/2010 19:10:14

Previous topic - Next topic

Monsieur OUXX

OK, I've got this code :

Code: ags

      #define RED 55
      #define AGSH_RBNode_Parent 0+
      #define AGSH_RBNode_Color  3+
      #define TO_LOCAL -
      #define SEGADDR_INT  33

      int memInt[100];

      int debug2 = memInt[AGSH_RBNode_Parent(z  TO_LOCAL SEGADDR_INT)]; 
      int debug3 = memInt[AGSH_RBNode_Color(debug2)];                   
      while ( debug3 == RED) {
           ...
      }



When I complie, I get error "Parse error in expr near '55'", for the line containing while (...

I just don't get why.


Here is a clearer picture of what the code looks like after the pre-processor has replaced the macros :
Code: ags

      int memInt[100];

      int debug2 = memInt[0+(z  - 33)]; 
      int debug3 = memInt[3+(debug2)];                   
      while ( debug3 == 55) {
           ...
      }



I'm confused.  ???
Could it be a bracket or similar missing somewhere else in the code?
 

Dualnames

Code: ags

      #define RED 55
      #define AGSH_RBNode_Parent 0+
      #define AGSH_RBNode_Color  3+
      #define TO_LOCAL -
      #define SEGADDR_INT  33

      int memInt[100];
      int debug2, debug3;

       function game_start() {        
   debug2 = memInt[AGSH_RBNode_Parent(z  TO_LOCAL SEGADDR_INT)]; 
  debug3; = memInt[AGSH_RBNode_Color(debug2)]; 
           while ( debug3 == RED) {
              ...
          }
     }
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Monsieur OUXX

#2
I don't get it. What's your point here?

In case you believe I forgot to include this code in a function body, then, no, I'm not so stupid.
It's a truncated version of the code, to explain my issue.

I've already written several thousands of lines of codes in the AGS script before :)
 

Monsieur OUXX

DAMMIT!

I found the issue.

My macro declaration was actually :
Code: ags

#define RED 55;


STOOPID!

Thanks for putting time into this, dualnames.
 

Dualnames

#4
Quote from: Monsieur OUXX on Wed 28/04/2010 19:36:53
DAMMIT!

I found the issue.

My macro declaration was actually :
Code: ags

#define RED 55;


STOOPID!

Thanks for putting time into this, dualnames.


Does the I'm with stoopid goes for me? :o

I usually kind of mess the declaration of variables, and I know your scripting is ACE. You even had an AGS benchmark for strings and integers, so it goes without saying.

EDIT: I was only getting dramatic. Glad you solved this on your own. :D
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Monsieur OUXX

Quote from: Dualnames on Wed 28/04/2010 19:53:32
Does the I'm with stoopid goes for me? :o

Of course not! It goes for me!!!!
You didn't have any way to guess that I actually didn't copy-paste my #define statement properly!!!

Sorry if it was confusing :)
 

Kweepa

Still waiting for Purity of the Surf II

SMF spam blocked by CleanTalk