09-06-2025 11:52 AM
@sinclair15 wrote:
ignore about the loops, i just want to be able to control the path and change files while the program is running, how do i do that?
This has already been answered. Did you try?
09-06-2025 01:04 PM
How do I try it, how do I close and open a new file? Where can I see an example of the architecture in question? What steps should I take? I'm really still a noob.
09-06-2025 02:22 PM
If you have a control for "file path (use dialog)" input, you can configure it (right-click - Propeties - Browse options), e.g. to allow a new file only; Open/Create/Replace File function has input for operation - you can select create, this causes error if an existent file name is passed to it; the function, if having unwired file path input, asks for file name and with a create-only operation (not e.g. "replace or create") will not overwrite an existent file. For closing a file, you have a Close File function.
Using a new file for each run seems to be more safe: when a run is terminated by an error, the file may contain an incomplete line, and appending to the file may append to the line, producing some nonsense data.
09-08-2025 09:23 AM
@sinclair15 wrote:
ignore about the loops, i just want to be able to control the path and change files while the program is running, how do i do that?
You can't just "ignore about the loops" because it's the loops that are the issue. As I said before you are going to need to use a proper program architecture like a simple state machine.
09-08-2025 11:50 AM
@RTSLVU wrote:
@sinclair15 wrote:
ignore about the loops, i just want to be able to control the path and change files while the program is running, how do i do that?
You can't just "ignore about the loops" because it's the loops that are the issue. As I said before you are going to need to use a proper program architecture like a simple state machine.
you could do two loops in parallel (producer consumer architecture),
but propably a state machine architecture (with one loop) is sufficient
09-08-2025 12:06 PM - edited 09-08-2025 12:06 PM
@alexderjuengere wrote:
@RTSLVU wrote:
@sinclair15 wrote:
ignore about the loops, i just want to be able to control the path and change files while the program is running, how do i do that?
You can't just "ignore about the loops" because it's the loops that are the issue. As I said before you are going to need to use a proper program architecture like a simple state machine.
you could do two loops in parallel (producer consumer architecture),
but propably a state machine architecture (with one loop) is sufficient
But even the Producer/Consumer architecture will need a simple State Machine as its core in the Consumer loop if the OP wants to change data files while the program is running.
Everybody needs to learn the state machine because it's by far the most used architecture.