can't close tables with FOR loop 
Author Message
 can't close tables with FOR loop

Hello
In FPW 2.6 and FPD 2.0:
I want to close all but 1 or 2 tables, and am trying to use something
like the below.  It's not closing ANY tables.  When I STEP thru it, it
seems to behave correctly except it simply won't close the tables this
way.  I realize I can use a bunch of SELECT <table>, USEs but a FOR loop
sure seems more elegant and is less maintenance should we add tables to
the project.  The example below is simplified for clarity; the real
project has maybe 15-20 tables open and I LOOP thru all work areas in
that case.  We're running on a Novell network, v. 3 on the server.

tia
wayne
remove "omit" for email reply

select 5
use m:\projmast noupdate
select 4
use m:\m_invtry noupdate
select 3
use m:\plinker noupdate
select 2
use m:\paddress noupdate
select 1
use m:\userdata noupdate
for i = 1 to 5
        if !empty(alias(i)) and alias() != 'USERDATA'
                use in i
        endif
endfor



Fri, 04 May 2001 03:00:00 GMT  
 can't close tables with FOR loop
Hi Wayne,

[snip]

Quote:
>use m:\userdata noupdate
>for i = 1 to 5
> if !empty(alias(i)) and alias() != 'USERDATA'
> use in i

~~~~~~~~

Change the above commando to:

use in (i)

HTH

Renato



Fri, 04 May 2001 03:00:00 GMT  
 can't close tables with FOR loop

Quote:

>select 1
>use m:\userdata noupdate
>for i = 1 to 5
>     if !empty(alias(i)) and alias() != 'USERDATA'
>         use in i
>     endif
>endfor

Your IF statement should read:

IF !EMPTY(ALIAS(i)) AND ALIAS(i) != "USERDATA"

Your current version checks the alias of the current work area to see if the
name of the alias is USERDATA [which it is].

--
Matt McQueen
Matt McQueen Software Ltd.

ICQ# 22135548



Fri, 04 May 2001 03:00:00 GMT  
 can't close tables with FOR loop

Quote:

>[snip]

>>use m:\userdata noupdate
>>for i = 1 to 5
>> if !empty(alias(i)) and alias() != 'USERDATA'
>> use in i
>~~~~~~~~
>Hi Wayne,

>Change the above commando to:

>use in (i)

The advice will probably work, but when I encountered this problem, I used
construct
  SELECT i
  USE

which is guaranteed to work, and is practically as fast, too.

[ When replying, remove *'s from address ]
Alexandre Pechtchanski, Systems Manager, RUH, NY



Sat, 05 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. HELP (VFP3) My Loop Doesn't Loop?

2. Closing windows using form's Close Button

3. Closing project manager closes open tables -why?

4. Activex event doesn't fire when using a do while loop

5. Playing WAV's in a loop

6. Can't Loop and IF-else...

7. How to loop through free table fields?

8. Visual Fox pro Screen doensn't close

9. I can't close form

10. I can't close a Form

 

 
Powered by phpBB® Forum Software