[futurebasic] RE: [FB] IF statement problem!

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2000 : Group Archive : Group : All Groups

From: GonsalvesML@...
Date: Mon, 14 Feb 2000 14:47:34 -0500

	Yes Al Boyd, that's what I'm trying to do.  I'm trying what Joe
suggested me now.

	Let me put the whole probram so you'll  know exactly what I am
doing.  I made 10 checkboxes and 10 dot boxes.  Notice all the checkboxes
and the dotboxes have the same cordinates.  therfore, one of them will pop
up according to the value of seconds.  i'm using seconds as input (X value).

	Thanks for both of your help.



	-----------program---------

	


// === Globals
====================================================================

'---> Constants


'enter key ASCII
'return key ASCII




begin globals

dim hour%, minute%, second%
dim err%
dim t$
dim gt%
dim thestep%
dim counter%
dim Dat$
dim txtSize%
dim gptr&
dim temp$
dim quit%
dim x% as int
dim gUncheckedTime% as int
Dim gCheckedTime% As int
dim closeBtn% as int
dim CDEF
dim currentTime$, seconds
dim gQuit%

end globals




WINDOW 1,"Pacific Crest",(0,0)-(500,300),_docNoGrow


BUTTON 20,_activeBtn,"Exit",(430,100)-(490,150),_shadow
local fn statusBar'Beeps when mouse is clicked
Beep:Beep
end fn

poke( gptr& + 2 ), 65
text _applFont, 12, 48, 0

call textSize ( txtSize% )
txtSize% = 12700

'include "tlbx speechsynthesis.incl"
't$ = str$(USR second)
'err = fn speakstring(t$)

currentTime$=TIME$
seconds% = val(right$(currentTime$,2))
do


Edit field 1,"", (60,180)-(403,250),_statFramed, _centerJust 'draw optional
2-pixel border
DIM aRect.8
CALL SETRECT(aRect, 60, 180, 403, 250)       'define initial rectangle
EDIT FIELD 2,"", @aRect,_statFramed, _centerJust
CALL INSETRECT (arect, -2, -2)          ' resize aRect 2 pixels larger all
around 
DEF BORDER (_true, aRect)               ' make border using arect coordinates
CALL INSETRECT (arect, 2, 2)            ' put back to original size
call iutimestring([_time], _true,t$)
print %(180,140);t$
Call IUDATESTRING([_time] , _LongDate , Dat$)
print %(10,20);Dat$
call IUTIMESTRINg([_time], _true, t$)
print "The time is now ";t$



'COMPILE LONG if def _usingLiteRuntime = _false

'compile end if
'long if fn SpeechManagerVersion => 0
'FN SpeakString ("It is.")
'while FN SpeechBusy
'wend
'FN SpeakString (t$)
'end if
 COMPILE  0,_dimmedVarsOnly

gUncheckedTime% = 50
	gCheckedTime% = 40
 
FOR x% = 1 to 10
select case x%


Case 1:
button 1, 1, "", (85,200)-(115,225), 128+2+4 
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



case 2:
button 2, 1, "", (114,200)-(144,225), 128+2+4
Delay gUncheckedTime%
button 2, 2, "", (114,200)-(144,225), 128+2+4

button 2, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 2, 2, "", (85,200)-(115,225), 128+2+10



case 3:
button 3, 1, "", (143,200)-(173,225), 128+2+4
Delay gUncheckedTime%
button 3, 2, "", (143,200)-(173,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10 
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



case 4:
button 4, 1, "", (172,200)-(202,225), 128+2+4     
Delay gUncheckedTime%
button 4, 2, "", (172,200)-(202,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



case 5:
button 5, 1, "", (201,200)-(231,225), 128+2+4
Delay gUncheckedTime%
button 5, 2, "", (201,200)-(231,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



Case 6:
button 6, 1, "", (230,200)-(260,225), 128+2+4
Delay gUncheckedTime%
button 6, 2, "", (230,200)-(260,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



case 7:
button 7, 1, "", (259,200)-(289,225), 128+2+4
Delay gUncheckedTime%
button 7, 2, "", (259,200)-(289,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



case 8:
button 8, 1, "", (288,200)-(318,225), 128+2+4
Delay gUncheckedTime%
button 8, 2, "", (288,200)-(318,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



case 9:
button 9, 1, "", (317,200)-(347,225), 128+2+4
Delay gUncheckedTime%
button 9, 2, "", (317,200)-(347,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



case 10:
button 10, 1, "", (346,200)-(376,225),128+2+4
Delay gUncheckedTime%
button 10, 2, "", (346,200)-(376,225), 128+2+4

button 1, 1, "", (85,200)-(115,225), 128+2+10
Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+10



end select

NEXT
for
closeBtn% = 1 to 10
     'This for/next loop closes the checkboxes
button close closeBtn%
 next CloseBtn%




LOCAL FN buildWind'Creates window with edit field

fn statusBar'Calls the statusBar function above

end fn

local fn HandleDialog

'---> Variables
DIM EditStr$,DlgEV%,DlgID%
'---> Get Event Info
DlgEV% = DIALOG(0)
DlgID% = DIALOG(DlgEV%)
'---> Quit on Close Window
long IF DlgEV% = _btnClick
if DlgID% = 20 THEN end
end if
end fn





'--------- Main Loop ----------

on Dialog fn HandleDialog
do

handleevents
 long if fn button 
fn statusBar
xelse
end if  'or fn button


'--------- End Program ---------
 
until mouse(_btnClick)

until quit%=_btnClick