Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help on private data sessions
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00110146
Message ID:
00110153
Views:
25
>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
Map
View

Click here to load this message in the networking platform