Re: [Gambas-user] IDE CR/LF bug with improperly indented comment line after If...Then...Else...Endif

2014-12-12 Thread Kevin Fishburne
On 12/11/2014 04:42 PM, Benoît Minisini wrote:
 Le 11/12/2014 08:54, Kevin Fishburne a écrit :
 If you have an If...Then...Else...Endif block where there is an
 improperly indented comment line after the initial If, pressing Enter at
 the end of the If line will mistakenly insert and Endifbelow it.Example:

  ' Check if ship is player ship.
  If Ship[ShipIndex].Type = 0 Then
  ' Play player ship firing sound effect.
AudioCreate(laser_3.wav, Bullet[BulletIndex].PositionX,
 Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.15, 0, 0)
  Else
' Play NPC ship firing sound effect.
AudioCreate(laser_2.wav, Bullet[BulletIndex].PositionX,
 Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.5, 0, 0)
  Endif

 Becomes this when pressing Enter after the initial Then:

  ' Check if ship is player ship.
  If Ship[ShipIndex].Type = 0 Then

  Endif
  ' Play player ship firing sound effect.
AudioCreate(laser_3.wav, Bullet[BulletIndex].PositionX,
 Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.15, 0, 0)
  Else
' Play NPC ship firing sound effect.
AudioCreate(laser_2.wav, Bullet[BulletIndex].PositionX,
 Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.5, 0, 0)
  Endif

 Minor issue, but every time a bug dies an angel gets its wings.

 It's not really a bug. Anyway I fix it in revision #6719 by ignoring
 comment lines when analysing the indentation to decide if the control
 structure must be completed or not.


Thanks. I assumed GAMBAS recursed through subsequent 
If...Then..Else..EndIf's to determine whether code should be autocreated 
as a convenience. I didn't realize it was indentation-based.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IDE CR/LF bug with improperly indented comment line after If...Then...Else...Endif

2014-12-11 Thread Benoît Minisini
Le 11/12/2014 08:54, Kevin Fishburne a écrit :
 If you have an If...Then...Else...Endif block where there is an
 improperly indented comment line after the initial If, pressing Enter at
 the end of the If line will mistakenly insert and Endifbelow it.Example:

 ' Check if ship is player ship.
 If Ship[ShipIndex].Type = 0 Then
 ' Play player ship firing sound effect.
   AudioCreate(laser_3.wav, Bullet[BulletIndex].PositionX,
 Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.15, 0, 0)
 Else
   ' Play NPC ship firing sound effect.
   AudioCreate(laser_2.wav, Bullet[BulletIndex].PositionX,
 Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.5, 0, 0)
 Endif

 Becomes this when pressing Enter after the initial Then:

 ' Check if ship is player ship.
 If Ship[ShipIndex].Type = 0 Then

 Endif
 ' Play player ship firing sound effect.
   AudioCreate(laser_3.wav, Bullet[BulletIndex].PositionX,
 Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.15, 0, 0)
 Else
   ' Play NPC ship firing sound effect.
   AudioCreate(laser_2.wav, Bullet[BulletIndex].PositionX,
 Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.5, 0, 0)
 Endif

 Minor issue, but every time a bug dies an angel gets its wings.


It's not really a bug. Anyway I fix it in revision #6719 by ignoring 
comment lines when analysing the indentation to decide if the control 
structure must be completed or not.

Regards,

-- 
Benoît Minisini

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] IDE CR/LF bug with improperly indented comment line after If...Then...Else...Endif

2014-12-10 Thread Kevin Fishburne
If you have an If...Then...Else...Endif block where there is an 
improperly indented comment line after the initial If, pressing Enter at 
the end of the If line will mistakenly insert and Endifbelow it.Example:

   ' Check if ship is player ship.
   If Ship[ShipIndex].Type = 0 Then
   ' Play player ship firing sound effect.
 AudioCreate(laser_3.wav, Bullet[BulletIndex].PositionX, 
Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.15, 0, 0)
   Else
 ' Play NPC ship firing sound effect.
 AudioCreate(laser_2.wav, Bullet[BulletIndex].PositionX, 
Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.5, 0, 0)
   Endif

Becomes this when pressing Enter after the initial Then:

   ' Check if ship is player ship.
   If Ship[ShipIndex].Type = 0 Then

   Endif
   ' Play player ship firing sound effect.
 AudioCreate(laser_3.wav, Bullet[BulletIndex].PositionX, 
Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.15, 0, 0)
   Else
 ' Play NPC ship firing sound effect.
 AudioCreate(laser_2.wav, Bullet[BulletIndex].PositionX, 
Bullet[BulletIndex].PositionY, Bullet[BulletIndex].PositionZ, 0.5, 0, 0)
   Endif

Minor issue, but every time a bug dies an angel gets its wings.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user