General information
Category:
Coding, syntax & commands
>Hi everyone!
>
>I just started using private data sessions and everything is o.k. so far except the following.
>
>I have a database with several deleted records, one of the is the first record on the table, this is why I noticed that VFP shows deleted records even whe with "set deleted on".
>
>It is not until I move the record pointer that VFP "hides" the deleted records, of course this is not a desired behavior because the user says that he still has the records he deleted "we all know they are there but not really"
>
>How do I get VFP to behave the same way it does on default data sessions? (to not show the deleted records right from the start)
>
>Thanx for any help
>
>Alfred
Surprise! You'll probably find some other particulars when using a private data session. Set talk, deleted, decimals, exact etc when using private datasessions. Most of us are used to coding something that sets up our environment when starting a new program:
Function init
set talk on
set echo off
set device to screen
etc...
Do the same thing with a container class:
1) add properties to hold the setting when it inits. Then have it set your environment the way you want it. If you want, you can set the environment back to the way it was when the object (placed on a form is released)
Add properties like
cTalk, cEcho, cDeleted etc. to hold your current settings: In the init event place code similar to:
oSetup.init
with this
.cOldTalk = set('talk')
.cOldEcho = set('echo')
.cOldDeleted = set('deleted')
endwith
Next - create other properties for what you want: (I use mostly logical)
.lTalk = .f.
.lEcho = .f.
.lDeleted = .t.
etc...
continued with the code from above in the .init event add the following:
with this
if .lTalk
set talk on
else
set talk off
endif
if .lEcho
set echo on
else
set echo off
endif
if .lDeleted
set deleted on
else
set deleted off
endif
etc...
endwith
On the destroy event - (if you wish)
oSetup.destroy
with this
lcStr = .cOldTalk
set talk &lcStr
lcStr = .cOldEcho
set echo &lcStr
lcStr = .cOldDeleted
set deleted &lcStr
etc...
endwith
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only