Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacements into Related tables
Message
From
20/11/1999 17:59:45
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Replacements into Related tables
Miscellaneous
Thread ID:
00293539
Message ID:
00293539
Views:
58
got a problem with replacements into a related table happening when they shouldn't.

all my major tables have a field called 'locked' which can be set at various points in the application to prevent further amendments to the record.

I also allow users to write changes into related files in various circumstances. Safeguards include protected fields and protected records

i.e. the 'locked' records (and some others which are not relevant here) can't be amended by such replacements.

or at least thats how things should be.

In fact, if I set up test conditions, with, say, a couple of dozen records linked to locked records in a related file and then do the replacement, instead of blocking them all, it allows just one record - always the first - to be amended.

The code was originally

REPLACE ALL (FIELDNAME) WITH (FIELDGET) FOR &REPCOND

thought perhaps the redundant 'ALL' was causing the problem so shortened it to

REPLACE (FIELDNAME) WITH (FIELDGET) FOR &REPCOND

no improvement.

so replaced it with a scan loop

LOCATE
SCAN
IF &REPCOND
REPLACE (FIELDNAME) WITH (FIELDGET)
ENDIF
ENDSCAN

still no change.
At which point I ran out of ideas!

I might add that this seems to work fine in the DOS version. Only VFP gives me the problem.

Harry
Next
Reply
Map
View

Click here to load this message in the networking platform