Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox again
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01064970
Message ID:
01064991
Views:
27
Naomi,
There may be an issue here. See the following,
...Art
(say hi to Michael Murphy for me)


http://www.leafe.com/archives/showMsg/117336

"I have a table buffered view for my bizobj. In the
Init() of the bizobj I need to set inital values of
several fields. However, if the user doesn't make
any further changes to the fields they should not
be asked to save changes. Currently what happens is
that if the form comes up and the user immediately
clicks exit they will be asked to save changes."

"This is because IsChanged() is using the
GetNextModified() function to determine if any
fields have changed. Being the savy programmer I
am (;>), I figured I'd use SetFldState() to reset
the state of the fields after they are modified
by the Init(). Unfortunately, GetNextModified()
is using some other critera than the field state.
Has anyone been able to reset a field so
GetNextModified() won't show it as modified?"

http://www.leafe.com/archives/showMsg/117356

"For some reason SetFldState() does not work with
GetNextModified(). For example, I make some
changes to a field, reset it with SetFldState()
then call GetNextModified() and it still returns
that record number.

This is because IsChanged() is using the
GetNextModified() function to determine if any
fields have changed. "

Michael G. Emmons (MichaelE At flashcreative .DOT com)



http://www.foxite.com/archives/setfldstate_vs_getnextmodified_0000068845.htm

"I'm using SETFLDSTATE to tell a paramaterized view
that it hasn't been modified. I think.

REQUERY('lvorderln')
SELECT lvorderln
REPLACE ALL iorigprod WITH iprod_id
REPLACE ALL norigquant WITH quantity
REPLACE ALL ctemp_id WITH TRANSFORM(iprod_id)
scan
=SETFLDSTATE('iorigprod',1)
=SETFLDSTATE('norigquant',1)
=SETFLDSTATE('ctemp_id',1)
endscan

GETFLDSTATE(-1,'lvorderln') returns a string of ones
for each record.

But when I check for changes to the table GETNEXTMODIFIED
tells me there have been changes. Am I missing a step? Or
is GETNEXTMODIFIED above such trickery?"

Terry



"I have reported this as a bug in the Beta of every
version of VFP from at least 6.0 onwards. The answer
is always that GetNextModified does not use GetFldState()
in order to determine whether a record has changes so it
is not affected by the changes you make with SetFldState().
This is still a bug in my opinion :)

The only solution is to use a SCAN and GetFldState()...."

Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform