Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A question about the clock.

Status
Not open for further replies.

Rosciano

Technical User
Jun 16, 2003
64
0
0
IT
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. [sad]

Is there someone who can help me with the dBase code for this watch?

Thanks very much.



 
Hi Rosciano,
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
 
I knew the funtion TIME(), it returns the system time in a string of characters: "hh: mm: ss", but it is static, it does not move.
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

 
Hi,
I think you have to get the time from the server, but I need to look into this further.

 
I tried with different dBase codes, but none worked:

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...

 
This code also works, but it doesn't let me go further...

ct=0
do while ct<>1
store substr(time(),1,8) to waa
@ 24,70 say waa
enddo

 
Your coding won't work as a continuous time because it will only be activated once when you run your program.
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
 
Yes, I am using dBase III Plus v1.1. The time indeed appears in the top right hand corner of the screen in the Assistant Menu.
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?

 
Hi,
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.
 
I hope they haven't mixed FoxPro and dBase with the clock...

 
Hi,
The FoxPro updates were more frequent than dBase and the clock settings appeared in the first windows version Dbase 5.


 
To add to my previous post; dBase V was first released in 1994 followed soon after by a Windows version. I think version 8.1 is the latest.
 
Hi,
Yes, I think it wise to forget it for now. You could try to get a copy of dBase V.

 
You mean that whit dBase V I could find an answer?

I don't explain how they could put a code of dBase V when this didn't exist yet...

[ponder]

 
A lot of updates were put into dBase V and there was also a Windows version, so yes I think the clock/time parameters were more flexible.

I don't understand your last sentence, please clarify.



 
I do not understand how they could put a dBase V code when it (dBase V) did not exist yet ...
Is clear enough?

(Meanwhile, they came to my house to vaccinate me against Covid (I am in a wheelchair))
[wink]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top