Page 1 of 1

Javascript "For" statment makes crash the program

Posted: Sun Dec 20, 2015 6:55 pm
by DjPoke
The "For" statment in Javascript makes crash the program.
I also noticed that where there is the ";", the script change its color to green...

Code: Select all

! For( var i = 1 ; i < 10 ;i++) {
! }

If OpenWindow(0, 0, 0, 800, 190, "IAS : Intelligence Artificielle Subjective", #PB_Window_TitleBar | #PB_Window_ScreenCentered)
  TextGadget(1, 10, 10, 780, 25, "Saisissez une question et validez", #PB_Text_Center)
  StringGadget(2, 10, 40, 780, 25, "")
  ButtonGadget(3, 290, 70, 100, 25, "Micro")
  ButtonGadget(4, 410, 70, 100, 25, "Ok")
  TextGadget(5, 10, 130, 780, 25, "Voici votre réponse", #PB_Text_Center)
  StringGadget(6, 10, 160, 780, 25, "", #PB_String_ReadOnly)  
EndIf

Re: Javascript "For" statment makes crash the program

Posted: Sun Dec 20, 2015 8:16 pm
by Peter
JavaScript is case sensitive.

For != for ;-)

Greetings ... Peter

Re: Javascript "For" statment makes crash the program

Posted: Sun Dec 20, 2015 8:44 pm
by DjPoke
Thanks for this information :)