While/Wend Problem

BlitzPlus Forums/BlitzPlus Beginners Area/While/Wend Problem

Siopses(Posted 2007) [#1]
;CONSTANTS 
Const WINDOW_WIDTH=500
Const WINDOW_HEIGHT=400
Const WINDOW_FLAGS=15
;EVENT CONSTANTS
Const X_HIT=$803;The 'X' was hit
Const GADGET_USED=$401;A gadget was used
;VARIABLES
DESKTOP_WIDTH=ClientWidth(Desktop())
DESKTOP_HEIGHT=ClientHeight(Desktop())
;This function is to get the program started
Function Start()
Main=CreateWindow("START UP GUI TEST #1",DESKTOP_WIDTH,DESKTOP_HEIGHT,WINDOW_WIDTH,WINDOW_HEIGHT,Main,15)
Button=CreateButton("CREATE",WINDOW_WIDTH-300,WINDOW_HEIGHT-300,100,100,Main,1)
Ev=WaitEvent()
Es=EventSource()
While Not KeyDown(1)
Select Es
Case Main:
Blah=Confirm("Positive?",True)
If Ev=$803 
If Blah=1 Then
End 
If Blah<>1 Then 
Notify("Find out what you"+Chr(10)+"want next time")
EndIf 
EndIf 
EndIf
End Select 
Wend 
End Function 
Start()
End 

My problem is that the error 'Wend without While' pops
up, Why?


b32(Posted 2007) [#2]
An 'End Select' command is missing, before 'Wend'


H&K(Posted 2007) [#3]
Indent your code, and this sort of thing is easier to fix


CS_TBL(Posted 2007) [#4]
yep, indent = king, at a lot easier to read for us as well.


Siopses(Posted 2007) [#5]
I got it to work, I'm kind of using the biteme example under
Blitz Plus Samples to assist me. I've been examining the code and have no idea what 'bDone' means; does anyone have any ideas?


GfK(Posted 2007) [#6]
While KeyDown() <> True

Shouldn't you be specifying a keycode with KeyDown()?


Siopses(Posted 2007) [#7]
Don't worry I fixed that, let me update the code... code updated. I'll work out any further problems on my own;
CS_TBL how did you learn blitz+ in a few days!?


CS_TBL(Posted 2007) [#8]
Well, before B+ I was already doing B3d for some years (tho you'll never see me in those 3d forums as I was only doing 2d with it. In fact I did buy it back then, but I kinda lost my install and BUID :D In fact I don't really give a hoot about it since my forte will never be 3d anyway). Before B3d I was using the freeware B2d, and before that I was using QBasic for many years. Before that I used MSX-Basic (kinda lika GW-Basic). So if you add all Basics together I've now about 17 years of Basic experience spread over 6 Basics (MSX, QB, B2d, B3d, B+, Bmax).

Needless to say I didn't learn B+ in a few days, but I did learn the new GUI stuff in a few days.. but that GUI is really simple anyway.

My first 'real' B+ app was a small window that could load an 512x212 image with a 16-color palette. One could hoover the mouse over the image and see zoomed pixels in a corner. One could see the 16-color palette with its RGB values and one could copy/replace colors using both mousebuttons. So nothing fancy really.


Siopses(Posted 2007) [#9]
Ok, this is my first programming language, ever and I used
to mess around with BlitzBasic a while back, nothing to complex; and now I'm really into it programming on average
once a day. So, I guess I'm slow with this because of me being a begginer in programming in general and the fact that I'm a slow learner.