[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Date and time not updating in Applesoft BASIC program?
On Feb 5, 12:25 pm, "Michael J. Mahon" <mjma...@aol.com> wrote:
> DMn2004404 wrote:
> > And, if my program should include storing values in memory locations
> > (such as losses in location 768, ties in location 769, and wins in
> > location 770), what will happen to those values when the program
> > encounters the FLUSH command?
>
> Nothing whatsoever. Page 3 is safe from just about everything.
>
>
>
> > Michael J. Mahon wrote:
>
> >>Michael J. Mahon wrote:
>
> >>>DMn2004404 wrote:
>
> >>>>Here's the scenario: I have written an Applesoft BASIC program that
> >>>>uses a No-Slot Clock in my Enhanced Apple //e. I have RUN the program
> >>>>and had it execute a routine that displays the system date and time.
> >>>>When the program reaches this routine at, let's say, 6:32 PM, it says
> >>>>the time is 6:32 PM. So far, it appears the date and time routine is
> >>>>working properly. But, let's say I've had this same program running
> >>>>continuously for, say, two minutes, and the time is now 6:34 PM, but
> >>>>when I send the computer back to the date and time routine, the
> >>>>program says the time is still 6:32 PM. What's the deal here, and is
> >>>>there any way to rectify it?
>
> >>>You didn't mention how your Applesoft program was getting the time,
> >>>but I'm guessing that it's PEEKing it from the locations in the
> >>>ProDOS global page.
>
> >>>ProDOS only updates this location when a ProDOS file operation is
> >>>executed. If you do a PRINT CHR$(4)"verify" command, ProDos will
> >>>update the global page time and date.
>
> >>Sorry, I misremembered--the proper command to update the date/time
> >>on the global page without messing anything else up is FLUSH.
>
> >>So just insert:
>
> >>1234 PRINT CHR$(4)"FLUSH"
>
> >>(with the appropriate line number, of course) before you read the
> >>global page bytes and they will be up-to-date. No machine language
> >>needed.
>
> -michael
>
> NadaNet 3.1 for Apple II parallel computing!
> Home page: http://home.comcast.net/~mjmahon/
>
> "The wastebasket is our most important design
> tool--and it's seriously underused."
Everything except an "OpenApple-Control-Reset," right?
Brandon