Richard,
I think you are very brave staying with the Wizard generated code... I gave up 
totally trying to understand any of the auto generated code back in VFP7 days 
after being really stung with it.

Bite the bullet and get rid of it.... you know it makes sense rather than 
kludging all over the place!!

Dave

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Richard Kaye
Sent: 07 October 2015 16:25
To: [email protected]
Subject: RE: Weird problem with REFRESH()

Thanks for chiming in, Dave. The method code has props for the current workarea 
and record number and bits to select it before the REFRESH call as well as some 
other housekeeping stuff. (Don't tell anybody but this code goes back to the 
application wizard from VFP3/5.)

I also found an old ref to a VFP 7 REFRESH bug related to indexes. In this 
case, the view has no index.

I just added some very ugly code to add a local memvar for what it was 
complaining it couldn't find and the REFRESH call no longer throws an error. 
This is such an ugly kludge that my teeth hurt just looking at it. I hate not 
being able to figure out root cause.

--

rk

-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Dave Crozier
Sent: Wednesday, October 07, 2015 11:14 AM
To: [email protected]
Subject: RE: Weird problem with REFRESH()

Richard,
I have had problems similar but not the same when the class uses some code that 
moves the current selected area and doesn't put it back and the error then 
relates to a variable used to create the index which is a little misleading.

Make sure that whenever you use a select() area in a function/procedure that 
you save the alias in use when you enter the code and put it back before you 
exit the code.

If you do this then be prepared for the situation where you don't have a 
current alias() value on entry as this can screw you up big time even though it 
is very rare.

I have a function SelectAlias(<cAlias>) which does this automatically so you 
can do:

Function <myFunction>
  Local cOldAlias, lOK
  cOldAlias=SelectAlias()
...
... code
...
  lOK=.T.
 try
   Select(cOldAlias)
catch
    lOK=.F.
  endtry  
  *
  Return lOk
  *
Endfunc
        
Obviously you can interrogate the return value if you need to see whether there 
was an initial Alias specified or the initial alias has been closed somewhere 
in the ..code.. without you being aware.

Dave

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Richard Kaye
Sent: 07 October 2015 16:03
To: [email protected]
Subject: RE: Weird problem with REFRESH()

And just in case there's any confusion I'm referring to the native VFP 
REFRESH() function and not the Refresh() method of some object.

--

rk
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Richard Kaye
Sent: Wednesday, October 07, 2015 10:51 AM
To: [email protected]
Subject: Weird problem with REFRESH()

Here you go; a real VFP question.

This has been puzzling me greatly. I have a base container class with a bunch 
of buttons for nav and CRUD operations, etc. In the code that handles going in 
and out of edit mode, I have a bit that fires off a REFRESH() when the user 
goes into edit mode; the goal being to make sure the user has the most recent 
data before they start editing. Under certain very rare but reproducible 
circumstances, simply executing the REFRESH function results in a variable not 
found message. I cannot for the life of me figure out why this error is coming 
up when I call REFRESH. It's not a parameter for the view or a column in the 
underlying table. Anyway, I'm hoping this might stir up some similar memories 
out there in the finest list in the land. :-)

--

rk


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to