Author Topic: Dr Mario WIP and problem with stray comma...  (Read 3373 times)

0 Members and 2 Guests are viewing this topic.

Brian Alvarez

  • Guest
Dr Mario WIP and problem with stray comma...
« on: July 31, 2019, 01:49:03 PM »
 Hello Charles, i am almost done with my excersize clone of Dr Mario.
But im having trouble with a stray comma that i dont see. Can you take a look? It was compiling
fine and when i added something it suddenly broke.

 I tries attaching a sample of the PowerBASIC compilation, but i couldnt because of the size.

 Until a few changes ago... it was compiling fine also for Oxygen... but no more. :(

 Help? By the way... comparisons still return 1.

Brian Alvarez

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #1 on: July 31, 2019, 01:52:54 PM »

 By itself this line doesnt cause any problems:

Code: [Select]
sprframe = (CHOOSE(offframe + 1, INT {1, 2, 3, 2}, countof))
 But something else in my program caused it to start complaining about this:

Code: [Select]
ERROR: ERROR: stray comma:
WORD: ,
IN: dlgproc
LINE: 3076
FILE: "main source

Brian Alvarez

  • Guest
Re: Dr Mario WIP (Playable)
« Reply #2 on: July 31, 2019, 02:26:41 PM »
 Attached is a playable demo of this code. This one is compiled in PowerBASIC,
but until a couple hours ago it was running fine on oxygen as well...

 Note: it is unfinished.
« Last Edit: July 31, 2019, 02:55:25 PM by Brian Alvarez »

Charles Pegge

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #3 on: July 31, 2019, 03:36:15 PM »
Something goes wrong in line 2221...

      IF ( area.lng(area.m(x,i), (0)).color = area.lng(area.m(x,y), (0) ) THEN

Arnold

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #4 on: July 31, 2019, 03:38:13 PM »
Hi Brian,

as long as I do not understand the diagnostic tools of Charles, I can only let me lead by the error messages. This is what I have done (I did not look much at the code, this is too much for me at the moment):

commented out line 4 and line 6 ($ filename .. / uses rtl32) - I run the code directly
commented out line 3076: sprframe = (CHOOSE(offframe + 1, INT {1, 2, 3, 2}, countof))
commented out line 3093: sprframe = (CHOOSE((offframe + 1), INT {5, 6}, countof))

replaced all GetModuleHandle with ¤GetModuleHandle (1539, 3009-3013)

Now I can see at least the (empty) window of the app and hear the sound of the .mid file. I assume something in function CHOOSE does not work properly.

Roland

Brian Alvarez

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #5 on: July 31, 2019, 03:39:06 PM »
Gahhhh!! im blind!!

 Thanks Charles!  :o

Brian Alvarez

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #6 on: July 31, 2019, 03:40:53 PM »
Now I can see at least the (empty) window of the app and hear the sound of the .mid file. I assume something in function CHOOSE does not work properly.

Arnold, i posted a playable version, in case you want to try it. Its very limited, i have only been working on it for a little bit. I need to go out now, but i hope tonight i can post an update. :)

Charles Pegge

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #7 on: July 31, 2019, 03:48:09 PM »
Another similar around line 2422

      IF (area.lng(area.m(i,y), (0)).color=area.lng(area.m(x,y), (0)) THEN

Brian Alvarez

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #8 on: July 31, 2019, 03:49:43 PM »
Another similar around line 2422

 I found dozens Charles... i think my engine is acting dumb.  :o

Brian Alvarez

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #9 on: July 31, 2019, 03:58:12 PM »
Fixed the engine for the wrong generation of .color, but the original problem still remains. In fact, i believe Oxygen was
compiling it correctly even with that error before (So, Arnold is correct, it compiles when removing CHOOSE).

Attached the code, because it is now over 10000 characters and the forum doesnt allow me to put it between code tags.

Charles Pegge

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #10 on: July 31, 2019, 04:00:11 PM »
Okay, I'm off to bed.

I traced it by insertions of  this expression as bug bait:

int g={1,2,3}

Brian Alvarez

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #11 on: July 31, 2019, 09:04:35 PM »
 If i comment out the code from BlockFell() and part of the code
from Destroyed()... it all works fine, but loses that functionality.

 In fact, if i remove anything, just to make the code smaller, it sometimes
compiles fine. The attached executable was compiled with oxygen...
but doesnt work like the other one.

Charles Pegge

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #12 on: August 01, 2019, 08:56:11 AM »
I've updated oxygen.dll to trap those expression nesting errors on the line. (OxygenProgress.zip). I think there were about 7 in all.

Aurel

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #13 on: August 01, 2019, 09:09:36 AM »
Brian

you started self-destruction sequence  ;D ;D ;D
one thing stray comma is a very powerful enemy

when you use o2 you must not think in a power basic way with whole bunch of UDT-s

Aurel

  • Guest
Re: Dr Mario WIP and problem with stray comma...
« Reply #14 on: August 01, 2019, 09:19:40 AM »
Is it really necessary to have custom AND,OR NOT ?
gee i cannot recognize what kind of programming language is that .

 :o