English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 03 August 2012, 13:04   #1
alphagemini
Registered User
 
Join Date: Nov 2011
Location: Folkestone, Kent
Posts: 119
Alarm program in Hi Soft basic

I need code in Hi Soft basic for an alarm program,to warn me of time
sensitive actions. Anyone help?
alphagemini is offline  
Old 03 August 2012, 14:20   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Like this:

Code:
timer on
on timer(60) gosub checktime
...


checktime:
if left$(time$, 5) = "11:55" then print "put the kettle on"
return
Leffmann is offline  
Old 03 August 2012, 22:33   #3
alphagemini
Registered User
 
Join Date: Nov 2011
Location: Folkestone, Kent
Posts: 119
Thanks for the code. I need to enter the time on screen, so this is too simple!
alphagemini is offline  
Old 04 August 2012, 14:46   #4
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Sorry I haven't got a complete alarm clock program for you, but you can f.ex do this to enter time in HH:MM format:

Code:
input "set alarm: ", t$
and then under checktime you replace the "11:55" with t$ to make it respond on the time you entered. The HiSoft Basic manual will have everything you need to turn it into a complete program.
Leffmann is offline  
Old 05 August 2012, 08:37   #5
alphagemini
Registered User
 
Join Date: Nov 2011
Location: Folkestone, Kent
Posts: 119
Thanks for the help
alphagemini is offline  
Old 05 August 2012, 09:18   #6
alphagemini
Registered User
 
Join Date: Nov 2011
Location: Folkestone, Kent
Posts: 119
Thanks for the help. I have written the following:

input "set alarm ",t$
TIMER ON
ON TIMER(1) GOSUB checktime
checktime:
IF LEFT$(TIME$,6) = t$ then sound 300,3,255,2

Is this OK?
alphagemini is offline  
Old 05 August 2012, 18:00   #7
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Your program continues as normal after you've started the timer, so unless there's anything else that needs to be done then you'd have to write it like this:
Code:
input "set alarm: ", t$
timer on
on timer(1) gosub checktime
do
 sleep
loop

checktime:
if left$(time$, 5) = t$ then sound 300, 3, 255, 2
return
and you have to include leading zeroes in the time, e.g. 6:55 has to be entered as 06:55.
Leffmann is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Manuals for GFA Basic and Hi-Soft Basic 2 ricky500 request.Apps 20 12 February 2013 21:06
Hi Soft Basic help wanted alphagemini Coders. General 4 11 January 2013 11:39
Which 'free' Basic language program? keitha1200 Coders. Language 29 04 October 2012 00:08
Hi Soft Basic help wanted alphagemini Coders. Scripting 10 13 September 2012 12:43

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06821 seconds with 13 queries