Page 1 of 1

Update External file

Posted: November 6th, 2021, 8:50 am
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,

Re: Update External file

Posted: November 9th, 2021, 5:17 pm
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;