aldweb

Fermer I. aldweb

Fermer II. Gratuitiels PC

Fermer III. Gratuitiels Palm

Fermer IV. Partagiciels Palm

Fermer V. iziBasic Palm

Fermer VI. Connaissance Palm

Fermer VII. Ordinateur Poche

Fermer VIII. miniPortail

Spécial !



Version mobile
de l'aldweb Site

m.aldweb.com


Ni Français, ni Anglais ?

Essayez donc l'un de ces drapeaux :
[de] [es] [it] [pt]
Recherche




Météo / Spam / www

Météo Lyon


aldweb contre le SPAM


Newsletter
Pour avoir des nouvelles de ce site, inscrivez-vous à notre Newsletter.
S'abonner
Se désabonner
298 Abonnés
Sites web de la famille

Webmaster - Infos
News Amis
Visites

   visiteurs

   visiteurs en ligne

Sondage
Comment trouve-tu le nouvel habillage de l'aldweb Site ?
 
Superbe !
Joli
Moyen
Moche...
Résultats
forum.gifForum - iziBasic - Sujet n°1454

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

actif  Sujet n° 1454  IF/THEN/ELSE behavior - finally figured it out

le 23/09/2006 @ 23:02
par Dave O\'Brien

Anonyme



FYI, I just figured out what was causing a frustrating bug in my program.

I was using code like this:

IF A=B
'do something
ELSE
'do something else
ENDIF

It compiled just fine, but didn't work.

Took me a long while to realize I was missing the THEN keyword. As soon as I put that in, it worked properly.

In a future release of iziBasic, perhaps it would be useful to either:
- make the THEN optional in IF/ELSE statements (like it is for IF statements without the ELSE), or
- keep the THEN required, but generate a syntax error at compile time.

Thoughts?
  Poster une réponse  Haut

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1
--------
le 24/09/2006 @ 18:20
par aldweb

Anonyme

visiteur
Hello Dave,

You are right, the checks performed by the compiler are not 100% efficient with the IF statement and someone can get the bad side effect you got. It is then difficult to find back where the mistake is. I will have to enhance the iziBasic syntax checker in this area for the next release.

What you got as a side effect is because of the 2 syntaxes allowed for the IF statement:
IF A=B Statement
and :
IF A=B THEN Statement
[ELSE Statement]
ENDIF


The first syntax is equivalent to the second one expressed this way:
IF A=B Statement : ENDIF

In your code, this is how iziBasic interpreted it:
IF A=B : ENDIF
ELSE Statement
ENDIF

Of course this has no chance to work!

Thanks for reporting, I'll work it for next iziBasic version.

Cheers,


@+
aldweb
Ecrire à aldweb   Poster une réponse  Haut
actif sujet actif   clos sujet clos   Important! Important!   Nouveau Nouveau message   -   Rectifier Rectifier message   Clôturer Clôturer sujet   Remonter Remonter
[]
Catégories de discussion  Forum 



 
^ Haut ^