[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, 11:25 am, rich12345 <aiiad...@gmail.com> wrote:
> On Feb 5, 10:58 am, DMn2004404 <dmn2004...@gmail.com> wrote:
>
>
>
> > On Feb 5, 12:50 pm, DMn2004404 <dmn2004...@gmail.com> wrote:
>
> > > 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
>
> > And of course, by that, I also mean anything else that would trigger a
> > reboot, including a "PR#6".
>
> > Brandon
>
> Ummm try it?
0 poke 768,1:poke 769,2:poke 770,3
10 for i = 0 to 2
20 print "peek ";768+i;" = ";peek(768+i)
30 next i
try pr#6, then run the above program without line 0
same with control reset...
Rich