Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exit nested FOR loops
Message
 
 
To
27/07/2007 10:36:49
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01244106
Message ID:
01244118
Views:
19
In the valid function you may set xx and yy variables to Max + 1 number in case of .f., so you would be thrown from the loops.

AFAIK all variables in FPD are private, so setting xx and yy in the inner procedure should work.

>When the VALID comes back .F. in this button:
>
>
>			@ 7,2 GET cmd_Next_Open ;
>				FUNCTION '*NH Add Appointment;Next Open;Cancel' ;
>				SIZE but_height, 8 ;
>				VALID v_cmd_Next_Open( cmd_Next_Open )
>
>
>I want to get out of all the FOR loops. Thanks!
>
>
>FOR yy = 1 TO max_room
>	FOR xx = 1 TO n_lines
>
>		IF xx + show_from - 1 <= max_slots
>			slot_val = VAL(slot_per_room( xx + show_from - 1, yy ))
>		ELSE
>			slot_val = 0
>		ENDIF
>
>
>* JJ - TESTING ONLY
>* disp_date = {^2007/07/27}
>m.TestTime = SUBSTR(TTOC(CTOT(TIME()) - 36000),12,8)
>
>
>		IF slot_val = 1 AND disp_date >= DATE() AND RIGHT( "0" + ALLTRIM( slot_time( xx + show_from + 1 ) ), 5 ) > LEFT( m.TestTime, 5 )
>
>			WAIT WINDOW "Next slot: " + 'Room ' + ALLTRIM(STR(yy)) + ' - ' + 'Line ' + ALLTRIM(STR(xx)) + ' : ' + ALLTRIM(STR(x_room( xx, yy ))) + ' / ' + ALLTRIM(STR(slot_val))
>
>			DEFINE WINDOW sch_Next_Open ;
>				FROM 0,0 TO 20,60 ;
>				&win_style ;
>				FLOAT ;
>				TITLE " Next Open Appointment " ;
>				FONT fonname, fonsize
>			MOVE WINDOW sch_Next_Open CENTER
>
>			ACTIVATE WINDOW sch_Next_Open
>
>			IF !EMPTY( m_disp_date )
>				STORE m_disp_date TO disp_date
>			ELSE
>				STORE DATE() TO disp_date
>			ENDIF
>
>			old_date = disp_date
>			m.NewDateValue = old_date
>
>			@ 3,2 SAY 'Date: ' + ALLTRIM( DTOC( disp_date ) ) + 'Time: ' + RIGHT( "0" + ALLTRIM( slot_time( xx + show_from + 1 ) ), 5 )
>
>			@ 7,2 GET cmd_Next_Open ;
>				FUNCTION '*NH Add Appointment;Next Open;Cancel' ;
>				SIZE but_height, 8 ;
>				VALID v_cmd_Next_Open( cmd_Next_Open )
>
>			READ CYCLE MODAL
>
>		ENDIF
>	ENDFOR
>ENDFOR
>
>* Want to end up here if .F. was returned from VALID
>
>
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform