F
Frank
I need to make a program that will import data from a
text file into a database.
I have already designed the user interface, and I am
coding a class to open the file and handle the data. Now
an object of the class will be initialised and I will
call the data procedure in it though a method, and pass
it ref parameter for update of a counter in the user
interface, when the user press a start button. All that
seems fine.
However, if the user needs to stop the operation, I need
to somehow be able to break the import. I guess that I
could have a stop button, which could call another method
in the object, that would set a private cancel variable
for the object to the value true. The running import
procedure could then check on the cancel variable.
However, would that ever work, since the first method
that is doing the import, is not complete yet?
Is this a situation where another thread needs to be
used? I have not been working with threads before, so if
this is the case, perhaps someone can explain a bit, and
direct me to some articles in the help system that will
clarify this.
With kind regards,
Frank
text file into a database.
I have already designed the user interface, and I am
coding a class to open the file and handle the data. Now
an object of the class will be initialised and I will
call the data procedure in it though a method, and pass
it ref parameter for update of a counter in the user
interface, when the user press a start button. All that
seems fine.
However, if the user needs to stop the operation, I need
to somehow be able to break the import. I guess that I
could have a stop button, which could call another method
in the object, that would set a private cancel variable
for the object to the value true. The running import
procedure could then check on the cancel variable.
However, would that ever work, since the first method
that is doing the import, is not complete yet?
Is this a situation where another thread needs to be
used? I have not been working with threads before, so if
this is the case, perhaps someone can explain a bit, and
direct me to some articles in the help system that will
clarify this.
With kind regards,
Frank