I'm not sure if this it's a bug

Previous topic - Next topic

mentalthink

I guys I hvae this function in my code, but I look something extrange the part I "mark" with here... It's a bug?¿ becuase the compiler seems understand like Ok, the line on I have self.xplosion_Y%   , but draw anim don't have all this num of parameters and it's only this instruction...

Really i don't know if it's a problem but I think it's something extrange it's the same if I put only a number in a line, the compiler have to say something. ins't?¿----

Thanks and sorry if this not it's a problem, but I preffer advise for in a future can complicate somethin internal in GLbasic...



Code (glbasic) Select
FUNCTION explode_Enemy_Class1:
LOCAL  max_Value%      = 32
STATIC speed_Xplosion% = 8

IF self.val_energyhasEne%<=0
IF  self.val_Seq_Enemy_Exp < self.max_value_Explosion
//This it's a Simple Counter for Move the Missile
DEC self.xplosion_X%
//Paint each Frame of the Sequence
INC self.val_Seq_Enemy_Exp,0.5
DRAWANIM self.enemies_how_Explode   , _
          self.val_Seq_Enemy_Exp%   , _
self.xplosion_X%   , _
self.xplosion_Y%
// PRINT "Explosion ActivadA"+self.val_Seq_Enemy_Exp,  self.xplosion_X%   , _
    self.xplosion_Y%   <<< HERE!!!!!

ENDIF
ENDIF




ENDFUNCTION

mentalthink

Hey guys I reply to myself, I search a curios and I think a problem

If you write this...
  //      PRINT "Explosion ActivadA"+self.val_Seq_Enemy_Exp,       self.xplosion_X%                                 , _
                                                                                            self.xplosion_Y%   <<< HERE!!!!!

The compiler don't say nothing but if you write this ... focus in the missing , _
  //      PRINT "Explosion ActivadA"+self.val_Seq_Enemy_Exp,       self.xplosion_X%                               
                                                                                            self.xplosion_Y%   <<< HERE!!!!!

In the second case I get a compiler error-.---

I think the compiler when we write Comments, if we leave , _ the compiler undestand we are doing a carry in the line...

Well this I can say, perhaps this can cause problems to someone , be carefull !!!!

Regards,

kanonet

I think its ok, that the compiler thinks your comment goes to next line too. - But if it does, the IDE should also mark 2nd line as a comment. So current behaviour is not 100% correct IMHO.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

mentalthink

Thanks Kano really you have reason the compiler will be think the next line it¡s a comment, but Really don't is... well I think the Masters have to decide about this, perhaps can be used like a trick for put on and off wuickly some lines of code...
:booze: Thanks for your reply kano.

erico

I´d like to help Mental, but I really have no idea what is going on on that code :(
I think it is going to be a few years till I even get what a function is up to.

Anyways, I´m around here if anything I can help is up to. ;)