Feb-25-2020, 06:31 PM
Hi everyone,
I'm somewhat new to the language so I'm hoping there's a better way to do this. I have some loops in my program that execute, but I want them to only act on a specific object once. If the object has been processed in the loop before, I don't want it to be processed again.
What I have been doing to work around this is to keep a text file, and write some distinguishing feature of the object to it... then write that into the loop, to check the file, and if object is not included in the file, then process the object... however this results in a super fragile program that is completely broken if the text file is modified.
I wish there were something with persistent memory that I could write to for this purpose.. but there has to be a better way?
EDIT - is shelf what I'm looking for? I could shelve the id then do an "if not in"?
I'm somewhat new to the language so I'm hoping there's a better way to do this. I have some loops in my program that execute, but I want them to only act on a specific object once. If the object has been processed in the loop before, I don't want it to be processed again.
What I have been doing to work around this is to keep a text file, and write some distinguishing feature of the object to it... then write that into the loop, to check the file, and if object is not included in the file, then process the object... however this results in a super fragile program that is completely broken if the text file is modified.
I wish there were something with persistent memory that I could write to for this purpose.. but there has to be a better way?
EDIT - is shelf what I'm looking for? I could shelve the id then do an "if not in"?