WhileEx and AndWhile

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Locked
User avatar
Dudus
Posts: 120
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

WhileEx and AndWhile

Post by Dudus »

Hi,

today I'm playing with While + EndWhile, but again some issues.

WhileEx "[TextEntry1]<[#32] and [TextEntry2]<[#32]"
AlertBox "Error" "Empty fileds"
Else
AlertBox "OK" "Now the code will countinue"
EndWhile
. And here starts the rest of the code


I think i do something wrong... When [TextEntry1] and [TextEntry2] are True, than the code will continue on the page, but
if Flase and they are empty than the rest of the code will not execute.

What should i change?
Thanks
D
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: WhileEx and AndWhile

Post by Gaev »

Dudus:

1) You can not use Else inside WhileEx/EndWhile ... only inside a If/Endif or IfEx/EndIf code block.

2) If you are merely trying to check contents of TextEntry boxes, you do not need to use WhileEx/WhileEnd, just place this code in the Text Change section of each of the TextEntry boxes ...

Code: Select all

GoSub "CheckForEmpty"
... and your subroutine would look like ...

Code: Select all

:CheckForEmpty
IfEx"[TextEntry1]<[#32] and [TextEntry2]<[#32]"
   AlertBox "Error" "Empty fields"
EndIf
Return
3) If you have reason to use While/EndWhile or WhileEx/EndWhile in other circumstances, you can use ExitWhile to exit the loop.
User avatar
Dudus
Posts: 120
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Re: WhileEx and AndWhile

Post by Dudus »

Hi Gave,

thank you I found some other solution:

WhileEx "[TextEntry1]<[#32] or [TextEntry2]<[#32]"
AlertBox "Error" "Must be filled"
Else
EndWhile
AlertBox "Okay" "Now it's correct"

Duus
User avatar
virger
Posts: 540
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: WhileEx and AndWhile

Post by virger »

Code: Select all

WhileEx "[TextEntry1]<[#32] or [TextEntry2]<[#32]"
AlertBox "Error" "Must be filled"
Else
EndWhile
AlertBox "Okay" "Now it's correct"
ESTO NO FUNCIONA. CORRA EL PRG CON 'F9' Y OBSERVE EN EL 'DEBUGGER-ACTIONS'
THIS DOES NOT WORK. RUN THE PRG WITH 'F9' AND SEE THE 'DEBUGGER-ACTIONS'
COSTA RICA
PURA VIDA
Locked