settime atomclock
7 messages in this thread
I am trying to use the "Settime.rexx" script that came with your
program, AtomClock V.1.2a. I get an "error 26 in line 32; missing or
unexpected END settime.rexx failed (return code 10)". Here is the
script, would you check it out and tell what may be wrong? The 32nd
line is the last line.
/* settime.rexx */
/* If you have AREXX and WShell you can insert this in your */
/* startup sequence. Will run AtomClock just once a month and */ /* set
the hardware clock */
paramstr = 'z/EDT n/*70,1-202-653-0351 c10' /* set command line arguments
for AtomClock */
'DATE >RAM:LastSet.dat'
NewMonth = GetMonth('RAM:LastSet.dat');
IF EXISTS('S:LastSet.dat') THEN
OldMonth = GetMonth('S:LastSet.dat')
ELSE
OldMonth = 'Nul' /* arbitrary – to make unequal */
'DELETE RAM:LastSet.dat'
IF OldMonth ~= NewMonth THEN
DO
'AtomClock' paramstr
IF rc = 0 THEN
DO
'COPY RAM:LastSet.dat S:'
/* change this for your hardware clock if necessary */
'SETCLOCK SAVE'
END
EXIT
GetMonth:
arg filename
CALL OPEN('datefile',filename,'R');
datestr = READLN('datefile');
CALL CLOSE('datefile')
PARSE VAR datestr WeekDay DD '-' Mon '-' YR Time
RETURN Mon
RJ……….on AutoPilot
Robert,
Where is the closing end for this DO?
|–DO
| 'AtomClock' paramstr
| IF rc = 0 THEN
| |—-DO
| | 'COPY RAM:LastSet.dat S:'
| |/* change this for your hardware clock if necessary */
| | 'SETCLOCK SAVE'
| |—-END
|–EXIT
GetMonth:
arg filename
CALL OPEN('datefile',filename,'R');
datestr = READLN('datefile');
CALL CLOSE('datefile')
PARSE VAR datestr WeekDay DD '-' Mon '-' YR Time
RETURN Mon
Clark,
I know next to nothing when it comes to programming. You have asked me in
essence what my post is asking. How do I get settime.rexx to work? Are you
saying that I must type the word END somewhere or replace a word with it
and if so, where? From your message it looks like I should replace the
word EXIT with END. Is this so? I appreciate your help.
RJ……….on AutoPilot
RJ,
Sorry I should have posted that question to the person you were posting
to! I think you need an END END EXIT as in
END
END
EXIT
It looks as though the second end is missing. Try it and see what
happens! It shouldn't hurt anything. You need to pop into an editor and
add the extra END. I don't know your expertise level with AmigaDOS so
please forgive me if I seem patronizing here. You could use a Word
Processor (such as ProWrite), but remember to save your edits as ASCII
(TEXT ONLY) and not as NORMAL.
See what happens and let me know if it works or fails.
Clark -|-
Williams –O-o-O– Via George
Clark,
Your suggestioncorrected part of the problem. Now, when the program
checks and finds it is a new month it runs atomclock and attempts to save
the Ram:Lastset.dat to the s: directory. The problem is that settime.rexx
has already deleted Lastset.dat from Ram: and cannot open ram:Lastset.dat
for input. If I take out line 14, ('DELETE RAM:LastSet.dat') will that
mess up the program? The line must be there for a purpose I would think.
RJ……….on AutoPilot
RJ,
I'm not sure what Art was trying to do exactly, but you might try the
following code at the line which currently reads:
'COPY RAM:LastSet.dat S:'
replace that with the line
'DATE > S:LastSet.dat'
I think tha Art was just trying to update the current date as the 'old'
date. It is hard to tell exactly since the comments are rather sparse.
I can't guarantee this will solve your problem, but I think this should
help you out.
Clark -|-
Williams –O-o-O– Via George
Clark,
I moved the 'delete ram:LastSet.dat' between the END and EXIT lines and it
seems to work fine now. I've come across a few Arexx programs that always
seem to need a little tweeking. I don't understand how someone can upload
a program that doesn't work. You would think they would have tested it and
are using it themselves first.
RJ……….on AutoPilot