A question about the clock.
A question about the clock.
(OP)
Hello,
I am translating a book for my class "How programming started ..." from English to Spanish. However, I did not answer a question from a student.
A week ago, during a dBase brush up; while we were examining ASSIST, he asked me: "how does the clock works continuously" referring to a clock put at the beginning of the page which, with the program not working, showed the actual time running the hour, minutes and seconds.
I was afraid of this question; I had already examined the code, but without results and the book I had was very frugally with the matter.
I couldn't answer the question.
Is there someone who can help me with the dBase code for this watch?
Thanks very much.
I am translating a book for my class "How programming started ..." from English to Spanish. However, I did not answer a question from a student.
A week ago, during a dBase brush up; while we were examining ASSIST, he asked me: "how does the clock works continuously" referring to a clock put at the beginning of the page which, with the program not working, showed the actual time running the hour, minutes and seconds.
I was afraid of this question; I had already examined the code, but without results and the book I had was very frugally with the matter.
I couldn't answer the question.

Is there someone who can help me with the dBase code for this watch?
Thanks very much.
RE: A question about the clock.
RE: A question about the clock.
When you say Clock, I assume you are referring to the time function.
At the dot prompt type ? TIME()
or as follows:-
. ? time()
you will then see the time displayed.
Phil Thoms
RE: A question about the clock.
I would like to continue giving the time without having to ask again.
Example:
"hh: mm: 01"
"hh: mm: 02"
"hh: mm: 03"
...and so on
RE: A question about the clock.
I think you have to get the time from the server, but I need to look into this further.
RE: A question about the clock.
One example:
do while .not. eof()
store substr(time(),1,8) to waa
@ 24,70 say waa
enddo
I hope you find the correct code...
RE: A question about the clock.
ct=0
do while ct<>1
store substr(time(),1,8) to waa
@ 24,70 say waa
enddo
RE: A question about the clock.
I assume you are using Dbase III plus. If so the time always appears in the top right hand corner of the screen in the assistant menu as it used to be called.
Dbase III plus therefore uses the system settings for this purpose.
Phil T
RE: A question about the clock.
I tried to convert TIME()in a normal variable, but nothing, same thing.
Since time() is a function whose result is a string of characters ("hh:mm:ss"), why not take advantage of this condition and use the string?
RE: A question about the clock.
Set Clock on and set clock to (position on screen) was introduced in the first windows version of dBase. I used dBase III plus for a short time only and thereafter migrated to FoxPro 2 for DOS and shortly after to FoxPro 2.6 Windows. I currently use Visual FoxPro 6. The FoxPro language is the same as dBase but the updates were far more frequent. I will try to find any useful time() function programs which may be of interest.
RE: A question about the clock.
RE: A question about the clock.
The FoxPro updates were more frequent than dBase and the clock settings appeared in the first windows version Dbase 5.
RE: A question about the clock.
RE: A question about the clock.
RE: A question about the clock.
RE: A question about the clock.
RE: A question about the clock.
Yes, I think it wise to forget it for now. You could try to get a copy of dBase V.
RE: A question about the clock.
I don't explain how they could put a code of dBase V when this didn't exist yet...
RE: A question about the clock.
I don't understand your last sentence, please clarify.
RE: A question about the clock.
Is clear enough?
(Meanwhile, they came to my house to vaccinate me against Covid (I am in a wheelchair))
RE: A question about the clock.
The commands for this; Set Clock on or off) and Set Clock to [row, column].
New versions of dBase contained improvements on the previous version; dBase III plus contained commands that dBase III dis not have and dBase III had commands that dBase II did not have, etc. dBase is now up to version 8.1
RE: A question about the clock.
In 1977?
I have no idea when dBase V came out, but surely AFTER dBase III, dBase IV and before they wrote it in these old books, let alone dBase III.
I agree with you that a piece of other software was included, that explains how there is no way to do it with dBase III, but it is not a piece of dBase V.
Come to think of it, I don't think they have mixed software, the code is written in dBase III !, but how?
RE: A question about the clock.
You should look into the history of dBase under Ashton Tate (owners).
The following shows approximate dates of new releases for dBase:-
1983 dBase II
1984 dBase III
1986 dBase III plus
1988 dBase IV (versions 1 and 2)
1994 dBase V
All new releases introduced new commands and functions.
I am not sure what you are not understanding about new releases or updates.
RE: A question about the clock.
Anyway, the books I have were printed BEFORE any of those occasions (1977).
How can you be so sure a piece of dBase V was added if you don't even know the code? Do you imagine?
Can you prove it?
RE: A question about the clock.
This is what normally happens when updates are released for any software.
RE: A question about the clock.
This is what normally happens when updates are released for any software."
OK this is known, but this does not answer my concerns, nor the fact of the dates.
Ashton Tate knew beforehand dBase V ...
RE: A question about the clock.
What do you mean by Ashton Tate knew beforehand dBase V ... ???
RE: A question about the clock.
beforehand = at an earlier time
These words mean at an earlier time.
RE: A question about the clock.
Just to clarify; many amendments/additions were introduced in dBase 4 and 5 that were not available in 3 plus.
Ask Joe, as he already knows about some of the dBase history.
RE: A question about the clock.
I misread the book's date. The correct date is 1987
I'am sorry...
RE: A question about the clock.
No problem,
we can all misread dates and times etc.
RE: A question about the clock.
CODE -->
RE: A question about the clock.
Have you tried this? At first glance it looks okay but I will try it in Visual FoxPro because it uses the same language as dBase and will let you know.
RE: A question about the clock.
Yes your program works perfectly. It probably needs a clear command before exit, but you may not want to clear the screen for some reason.
RE: A question about the clock.
It's has worked for two and a half days on one of my applications that I use frequently.
RE: A question about the clock.
Instead of cd=inkey() etc. you could put the following
If inkey()=27 && user presses escape key
EXIT
endif
RE: A question about the clock.
RE: A question about the clock.
CODE -->
RE: A question about the clock.
If I want to add the clock to a program that for example produces an input screen then the exit procedure would have to be modified?
I will try to run this with another program and let you know. Your program is a benefit to users still operating Dbase III plus.
RE: A question about the clock.
Next, I show how I inserted it into a program that I use frequently:
CODE -->
RE: A question about the clock.
I have run the above program which changed my Foxpro screen to dark blue
So it would be good for Dbase III plus to keep the clock running while answering the option question was answered. CD = inkey() seems to get in the way.
However it is a very good step forward for 3 plus.
RE: A question about the clock.
If the option appears, it means that, for some reason, has left the DO WHILE. I don't know, I would have to watch the program or know more about Foxpro.
You gave me the clue when you said "...be activated once when you run your program..." so this is the reason for the DO WHILE, keep the loop as long as a key is not pressed.
But the mystery of how they do it at ASSIST continues ...
Sorry for the delay answering
RE: A question about the clock.
Sorry about my delay in responding. The ASSIST may be written in a different language for some reason.
However, I will look into this interesting mystery as soon as possible...
RE: A question about the clock.
Get in touch if you find something interesting.
RE: A question about the clock.
Not found anything too exciting, but I've done a simpler version of continuous time on screen:-
Do While .T.
@20,30 say time()
@20,40 say 'PRESS ESCAPE TO CLEAR'
if inkey()=27
clear
exit
endif
Enddo
In the meantime I'll keep looking
RE: A question about the clock.
RE: A question about the clock.
Definitely, it must be written in other language.
RE: A question about the clock.
In the early days in dBase and FoxPro some displays like the clock were hard coded where the user was not able to make modifications.
I have seen some of the requests for certain commands/functions to be introduced in the next program update. I remember them bring discussed in various magazines of the time. Still looking
RE: A question about the clock.
Google
Perhaps ASSIST was written in the same language?
RE: A question about the clock.
Yes, Foxpro was helped by the C+ language. Probably these are the answers. I have a book of user defined functions from the late 1980s which helped dBase and FoxPro users and was called 101+ FoxPro & dBase user-defined functions by Philip Steele. If you are looking for anything in particular (apart from time stuff) let me know.