Update External file

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
peterpan
Posts: 2
Joined: August 5th, 2021, 8:00 am

Update External file

Post by peterpan »

update external file

hello, could you help me ...
I need to update an external file,

I try to use the writecase function,

do you have an example to help me,
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Update External file

Post by aaronw »

This is a two step process 1) load the case into memory you want to update 2) write the case.

For example, let's say I have a STAFF_DICT with a staff id and staff name. Let's say the data file has a single value:

STAFF_ID = 001
STAFF_NAME = Erin

To update the staff name, the logic would look like this:
    STAFF_ID = 1;
   
if loadcase(STAFF_DICT, STAFF_ID) then
        // data from staff 001 is loaded into memory

        // update name
       
STAFF_NAME = "Aaron";

        // write update
       
writecase(STAFF_DICT);
   
endif;
Post Reply