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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make the alarm program in foxpro

Status
Not open for further replies.

jezky82

MIS
Jul 7, 2012
39
0
0
ID
I hope all aid to friend
A. like where do I create an alarm program in foxpro
2. how to change the character data to nomerik time, I've tried with val, but only the data changed hours minutes and seconds while the data is not
sample time () 10:10:10
? val (time) 10
3 make the program run the command with the time requirements
Thank you.
 
I'm quite sure you mean "how" not "where".

Well, even then, it's like asking how or where do I prepare pizza with my ferrari? VFP is a programming language for data based applications. If you want an alarm in your program, that's of course possible nevertheless, but there are better alternatives anyway.

Scheduled task will be watched for by the OS, so if a task is scheduled and activated the alarm will work. If you add alarms to your application data, your application will of course need to be up and running to alarm a use, like an Outlook Appointment also only will be displayed, if Outlook runs.

So far just the thoughts that come to mind without even talking about the language and technical aspect.

If you still want to go for it, use the datetime type to store an appointment, nut just TIME(), you will be able to calculate and compare a datetime value with the current dateteim stamp, which you get via DATETIME() called without parameters.

And that's about all you need for an alarm.

1. A datetime to alarm the user, stored in some appiontment table. Together with a flag field (logical), if the alarm has been made yet, inited to fals (.F.)
2. A timer, for example running each 10 seconds (interval = 10000), looking for any appointments having reached the current datetime
eg similarly to
SELECT * from Appointments where iUserID = goApp.iLoggedInUSerID;
AND DATETIME()>=tAppiontmentDateTime AND Not lAlarmed
INTO Cursor curAlarms NOFILTER

3. A messagebox or any other form you pop up to alarm the user.
4. setting all appointments as lAlarmed = .t. to denote the alarm has been made,
eg similarly to
UPDATE Appointments SET lAlarmed = .T. FROM curAlarms WHERE Appointments.ID = curAlarms.ID

Bye, Olaf.
 
PS: I was concentrating on the essential stuff for the alarms and talking of other things apropos of nothing.

For example I am indirectly assuming you have some goApp application object programmed and that has some property iLoggedInUIserID, in which you store the ID of the current user of your application after a successful login. If you don't get the idea of a timer comparing appointment data with the current DATETIME(), I can expand a bit.

Bye, Olaf.
 
thank you
I intend to make a foxpro program which provided a certain time he automatically run certain commands that I made.
and conditions of the time it was taken from the database fields. can be modified to change the time.
 
Are you intending to do this in foxpro 2.6? Because then some things I mentioned may not exist, eg a timer base class.
The easiest thing would be to create an exe, which will do what you program right away and schedule it via Windows Task scheduler to run at that time or regularly weekly, daily, monthly, etc.

Bye, Olaf.
 
For example I am indirectly assuming you have some goApp application object programmed and that has some property iLoggedInUIserID, in which you store the ID of the current user of your application after a successful login. If you don't get the idea of a timer comparing appointment data with the current DATETIME(), I can expand a bit.

Nice ideas. When did they add objects and datetime() to FP2.x? ;-)
 
I heard they are no longer developing FoxPro 2.6. maybe this time I was forced to give up using vf.9. I actually really love foxpro 2.6. I've been using FoxPro 2.6 for 12 years.
 
I mean like making billing time. such as computers Rental per hour. so when time is up automatic computer is on a standby position and close all programs
 
Scheduled task will be watched for by the OS, so if a task is scheduled and activated the alarm will work. If you add alarms to your application data, your application will of course need to be up and running to alarm a use, like an Outlook Appointment will also be displayed only, if Outlook runs. <- What if the task is scheduled only supervised by a program of foxpro. so if the program does not open in os the alarm did not go.
 
>What if the task is scheduled only supervised by a program of foxpro. so if the program does not open in os the alarm did not go.

I don't get what you're saying.

But a scheduled task is watched by the OS, therefore it can't fail to execute on that level, unless you shutdown the OS or delete the scheduled task. But a user needs priviliges to do so.

So by all means scheduled tasks are a solution.

Bye, Olaf.
 
I mean like making billing time. such as computers Rental per hour. so when time is up automatic computer is on a standby position and close all programs

This sounds like you want to measure elapsed time. This is VERY different from scheduling or alarms.

In VFP we'd likely store a start time and use a Timer object to detect when the user has passed his allotted time. There is no Timer object in Foxpro 2.x.
 
If the overall tpic is an internet cafe and rented times, there are turn-key ready systems for that. I wonder who would get the idea to use foxpro, even more so fox 2.6 to program some device for that use, even just a system used by supervisor.

If you want to turn on a computer for a rented time period and turn it off a computer after a rented time period elapsed, the first thing to look for would be pcs with wake on lan capabilities and how to control them and what software or language to best use for that and that would most likely not involve foxpro at all. Neither dos nor windows version.

Bye, Olaf.
 
It is interesting to see that this same poster initially placed a related question in the VFP area
where he indicated that he was 'a beginner in vf'

Either way (FP or VFP) I agree with Olaf that using FP or VFP to time a user's workstation activity in an 'internet cafe' does not seem to be the best approach when there 'turn-key ready systems for that'

jezky82 - If you are going to use FP or VFP, make up your mind and post your questions in either one of the specific forum areas (forum184 or forum182), but not both.

Good Luck,
JRB-Bldr
 
JRB-Bldr I apologize, I actually want to resolve my issue FoxPro 2.6 to FoxPro 2.6, but if it's possible swordfish. I will use vf9. thank you
 
how to get the data within 2 hours FUTURE. to get the current time time = time (). I try WAKTU2 = TIME () -7200 or waktu2 = time () - 2 can not be
 
TIME() is returning a string, you can't compute with a string.

Bye, Olaf.
 
jezky82 - you are still going back and forth between the 2 forum areas (Old FP and VFP).

You need to keep your questions and all of the replies in one single forum area - the ONE which is language-appropriate (or in this case FP/VFP version appropriate) !

Either post your continuing questions to:
thread184-1690041
or this one:
thread182-1690016

Not back and forth between the 2 when your questions are all about the same issue(s).

PLUS the answer to your question is already in the VFP forum posting (thread184-1690041)

Good Luck,
JRB-Bldr
 
THANK YOU jrbbldr, maybe the solution is just to vf, but I am still a big question in my mind why my favorite FoxPro 2.6 will not be able to do what I expected.
 
My first issue has nothing to do with whether you use FP or VFP for your answers.

It has to do with posting essentially the same questions at-the-same-time in BOTH language-specific forum areas.

Pick ONE and get your answers there.
If the answer is "This is not the correct language to use", then you ask in the correct place.

As to you your other question - why not use FP2.6

For one BIG reason - it does not have DateTime functions, no DateTime data table fields and no DateTime variable types.

Can you write your own functions in FP2.6 to handle this information?
Sure, but why would you want to do that?

Remember that current time time = TIME() will give you a character string representing the time, as Olaf has said above, this values is NOT a value that can be used in a mathematical operation such as finding 2 Hours from now.

Have you even tried to execute the code examples that have been provided to you in your 2 postings?

Try it yourself in your FP2.6 and confirm this for yourself.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top