Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Martin Krivka
  Where is Martin Krivka?
 
 Czech Republic
 Martin Krivka
 Tags
Subject: RE: SCAN WHILE not working with conditions
Thread ID: 331077 Message ID: 331172 # Views: 27 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Tuesday, December 27, 2011 2:40:27 PM         
   


> Hello Mustapha,
>
>
> >
> > Hello Martin
> >
> > no problemo concerning the interruption
> > for each post, everyone is invited to discuss and share his point of view
> > "au contraire" your example may enlight this post
> >
>
> Thanks !
>
>
>
> >
> > Evaluate("fce1(id)") : Yes, used that way it will always works 'cause the function do not return .T. or .F.
> > it just prints dot until the scan reach the end of the table
>
> No -:)
> The function always return .T. (This is default value when no return command is present.)
>
>
> >
> > in case of an evaluation of fields or variables the "returning" result has an impact on the statement that call it
> > at the time of the evaluation all depends on the active record or the state of variables
>
> Yes, exactly. With the notice that eval() is faster than other methods. (Macro & for example.)
>
>
> >
> > Notes : "au contraire" means "contrariwise"
> >
> > Regards
> > Mustapha Bihmouten
>
>
>
> What seems strange for me is the command itself: scan while ... for ...
>
> I had never seen/use similar construction. I'm not sure what have a precedence. While or For ?
>
>
> Martin

SCAN WHILE expr1 FOR exprl2


is equivalend to

SCAN WHILE expr1
   IF NOT exprl2
      LOOP
   ENDIF



Also works with LOCATE, REPLACE and most probably a few more xbase commands


CREATE TABLE temp (x int, y int,z int)
INSERT INTO temp VALUES (1,10,1)
INSERT INTO temp VALUES (1,11,2)
INSERT INTO temp VALUES (1,13,3)
INSERT INTO temp VALUES (1,10,4)
INSERT INTO temp VALUES (1,14,5)
INSERT INTO temp VALUES (1,10,6)
INSERT INTO temp VALUES (1,10,7)
INSERT INTO temp VALUES (1,11,8)
INSERT INTO temp VALUES (1,10,9)
INSERT INTO temp VALUES (2,10,1)
INSERT INTO temp VALUES (2,11,2)
INSERT INTO temp VALUES (2,13,3)
INSERT INTO temp VALUES (2,10,4)
INSERT INTO temp VALUES (2,14,5)
INSERT INTO temp VALUES (2,10,6)
INSERT INTO temp VALUES (2,10,7)
INSERT INTO temp VALUES (2,11,8)
INSERT INTO temp VALUES (2,10,9)
INSERT INTO temp VALUES (3,10,1)
INSERT INTO temp VALUES (3,11,2)
INSERT INTO temp VALUES (3,13,3)
INSERT INTO temp VALUES (3,10,4)
INSERT INTO temp VALUES (3,14,5)
INSERT INTO temp VALUES (3,10,6)
INSERT INTO temp VALUES (3,10,7)
INSERT INTO temp VALUES (3,11,8)
INSERT INTO temp VALUES (3,10,9)

LOCATE FOR x=2
SCAN WHILE x=2 FOR y=10
	?z
ENDSCAN


Regards
Tushar

ENTIRE THREAD

SCAN WHILE not working with conditions Posted by Cecil Champenois @ 12/26/2011 4:35:13 PM
RE: SCAN WHILE not working with conditions Posted by Mustapha Bihmouten @ 12/26/2011 4:57:18 PM
RE: SCAN WHILE not working with conditions Posted by Cecil Champenois @ 12/26/2011 5:04:12 PM
RE: SCAN WHILE not working with conditions Posted by Mustapha Bihmouten @ 12/26/2011 5:34:11 PM
RE: SCAN WHILE not working with conditions Posted by Cecil Champenois @ 12/26/2011 5:46:57 PM
RE: SCAN WHILE not working with conditions Posted by Mustapha Bihmouten @ 12/27/2011 11:34:01 AM
RE: SCAN WHILE not working with conditions Posted by Martin Krivka @ 12/27/2011 12:57:21 PM
RE: SCAN WHILE not working with conditions Posted by Mustapha Bihmouten @ 12/27/2011 1:41:37 PM
RE: SCAN WHILE not working with conditions Posted by Martin Krivka @ 12/27/2011 1:56:58 PM
RE: SCAN WHILE not working with conditions Posted by Anil Sharma @ 12/27/2011 1:59:29 PM
RE: SCAN WHILE not working with conditions Posted by Mustapha Bihmouten @ 12/27/2011 2:27:28 PM
RE: SCAN WHILE not working with conditions Posted by tushar @ 12/27/2011 2:40:27 PM
RE: SCAN WHILE not working with conditions Posted by Martin Krivka @ 12/27/2011 4:41:41 PM
RE: SCAN WHILE not working with conditions Posted by tushar @ 12/26/2011 7:42:37 PM
RE: SCAN WHILE not working with conditions Posted by Anil Sharma @ 12/26/2011 8:19:52 PM