IO Variants: 2
Variant: 1
charptr32 filename
bool32.rising save
bool32.rising load
None
objref table
objref SDapi
int rem_sz;
bool trig;
if (inlet_load && !trig) {
trig = 1;
rem_sz = attr_SDapi.fsize(inlet_filename) % (attr_table.LENGTH * sizeof (attr_table.array));
attr_SDapi.fload(inlet_filename,(char *) &attr_table.array[0],rem_sz);
}
if (inlet_save && !trig) {
trig = 1;
rem_sz = attr_table.LENGTH * sizeof (attr_table.array);
attr_SDapi.fsave(inlet_filename,(char *) &attr_table.array[0],rem_sz);
}
if (!inlet_load && !inlet_save) trig = 0;
Variant: 2
charptr32 filename
bool32.rising save
bool32.rising load
None
objref table
objref SDapi
bool trig;
if (inlet_load && !trig) {
trig = 1;
int filesize = attr_SDapi.fsize(inlet_filename);
int dstsize = attr_table.LENGTH * sizeof(*attr_table.array);
int rem_sz = (filesize > dstsize) ? dstsize : filesize;
attr_SDapi.fload(inlet_filename, (char *)&attr_table.array[0], rem_sz);
}
if (inlet_save && !trig) {
trig = 1;
int rem_sz = attr_table.LENGTH * sizeof(*attr_table.array);
attr_SDapi.fsave(inlet_filename, (char *)&attr_table.array[0], rem_sz);
}
if (!inlet_load && !inlet_save)
trig = 0;