Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error: Expression is not valid outside of WITH/ENDWITH #1940
Message
De
10/02/2000 13:05:27
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Error: Expression is not valid outside of WITH/ENDWITH #1940
Divers
Thread ID:
00330158
Message ID:
00330158
Vues:
104
This is a wierd bug of sorts. I kept getting it when starting a SCAN/ENDSCAN loop and I searched and searched to see if I had references a .property/method without starting off with WITH...

The actual code would bomb right on the SCAN line (not on a line that referenced a property. In fact, in this method (off of a .scx form), I did not reference *any* properties until later in the method and then these were all wrapped properly in WITH/ENDWITH.

So I thought maybe there was a problem with SCAN/ENDSCAN somehow so I changed the loop back to the old

LOCATE

DO WHILE NOT EOF()

.... code..
SKIP

ENDDO

only to have it bomb on the "LOCATE" which would have been the same line as where the SCAN started before. Hmmmm...I was even able to get the exact same error only this time was when the form rolled all the way back to READ EVENTS. Something wierd. Here is the basics of the form and what I was doing.

Grid on page 3 of a form that is bound to a cursor created via a view. Since the view pulls in a lot of records at times, I wanted to give the users some options to filter the grid for certain items. I then intended to apply SET FILTER TO... to the cursor (I can filter a cursor, no?...I have before).

The code above is done to tally up some subtotals etc that I show beneath the grid. I did not to another SELECT using SUM() etc because some of it is has a lot of conditions and it was easier to just do a SCAN then some convoluted series of SELECTs.

It seems to run fine the first time the form is fired but then it bombs out the 2nd time through after the user has pushed the "filter" button to apply certain filters.

I pulled the code right out of the method to see if I had some sort of compiled code problem (could not find a way to issue a COMPILE on a .scx although hacking the .scx, I see that there is an ObjCode field (or whatever it was called) for object code for all methods.)

Albert Gostick
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform