Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetFldState not working in VFP 7
Message
From
04/10/2001 09:31:58
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00563930
Message ID:
00564103
Views:
20
Here are my answers:

>I still do not understand tha use case.
>For example, you put in table default value expression for primary key field. When you use APPEND BLANK command, new primary key generated automatically and put into the field value. I do not understand why you want to mark it as it is not changed. Is it not enough just clearing the field value?

[Christian]
The reason I do this is, that when the user closes the screen or attempts to move to another record, I check for changes with the GETFLDSTATE() function.
In most programs, when you click on the new button, you get a new record, or document or worksheet, but when you do not make any changes as user, you won't be prompted for saving or discarding changes when you close the application/document/worksheet etc.
From the user's standpoint, no changes have been done. From the program's standpoint, some fields may be changed. These should not be detected in GetFldState().
(Using another check than GETFLDSTATE for changes is much more work and time intensive.)

>
>BTW, try to clear the field value and then use SETFLDState. Maybe SETFLDState() in VFP7 is more complicated, so it see that value is changed really and prohibit to change state.

[Christian]
SETFLDSTATE also does not work when you appended the record with a default value, and then change the field value using REPLACE WITH.
The only way is not to use default values.

>
>Another suggestion: Did you tried to use INSERT INTO command instead of APPEND BLANK? As ar as I know, it does the same, but fields are not marked for change despite they;re pre-filled by default values.

[Christian]
This also has changed: Insert INTO changes the field state also for fields with default value in VFP 7.0.
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform