Hi Devon,
Thanks for trying to help me.
If there is no database when I launch the app I create a new one. This
database contains 2 tables. One for the data red from the text file and
one to store the modification time of the text file used to populate the
database which I get with: "tsrep (0 1 {:: 1!:0 FILEPATH)". If I don't
modified the text file while the app is running, its modification time
is the same as the one store in the database. Hence I have a verb which
just do that and returns 1 if it's OK and 0 if the 2 values aren't equal.
I check this in the boolean condition of the while loop of "agenda" below.
So in the verb below, I want:
1- display something
2- run a loop (or anything) inside which I check if the file has been
updated
3- stay in that loop if there is no update or exit if any update
4- delete the database and create a new one
5- call "agenda" again
I did have lisp like version of this which run perfectly, this is the
reason why I started to do that in J. But may be this is not the J way
of doing it? Should I use a "goto" instead of the loop or anything else?
So far my J implementation is really fast and gives me very good
results. But now I'm stuck on something I thought would be very easy...
Best
Le 02/01/2021 à 21:23, Devon McCormick a écrit :
My initial thought is "don't use a while loop". If all you're doing is
waiting for the file to be OK, what does this mean and how do you
check for
it?
On Sat, Jan 2, 2021 at 2:38 PM cilz <[email protected]> wrote:
here is my verb in pseudo code:
agenda : 3 : 0
echo (something)
while. (test for file ok)
do. (wait for 20s)
end.
(update data base)
agenda''
)
Any idea?
Regards
Eric
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm