Jump to content
IGNORED

creating a file date for basic files in prodos


newTIboyRob

Recommended Posts

If you don't have a real time clock installed, Compute! published a program that lets you manually set a date and time in the April 88 issue. But it's static. Meaning if you run this program and input 8/3/23 16:00, then load some other program and save it 30 minutes later, it will still stamp it 16:00 and not 16:30.

 

One workaround is to save the program stamped at 16:00, reload the date/time program, reset the time to 16:30, then reload your program and re-save it to update the time stamp. 

 

The other option is if you dissect the program, you can find the two poke values that update hours and minutes. So you use the program at boot up to set the date and time, and then you can poke new hour and minute values, and save your program with the updated time stamp. Just be careful, poking the wrong address could prevent you from saving. 

 

Of course neither of these approaches for updating work if you are saving something inside say, AppleWorks. It's really only viable for working with basic programs. 

Link to comment
Share on other sites

45 minutes ago, magnusfalkirk said:

Another option would be to make the date the file was created part of the name, such as My File 08/03/23

As ProDOS is only 15 characters for file names, chewing up half of that for a date isn't usually viable. Even your example is invalid as it's 16.

Link to comment
Share on other sites

Wow, thanks for all the helpful suggestions.  True, I was only looking for this for basic programs, not AppleWorks, so just 2 questions:

 

1)  I found that April '88 article. Though the program is static as you say, I will give it a try with your workaround #1 option. 

"Poking" around in the computer makes me nervous to be honest, e.g. as it could prevent me from saving.

 

Unless.... do you happen to know by looking at that article (if you can read it!) which are the correct pokes for setting new hour and minute values to save the program with the updated time stamp?

In other words, if I type that program all in, would you know what exact changes I would need to make, and how to use those, so I don't poke incorrectly with the wrong thing thus messing up my 2c's other correctly working functions?

Sounds kind of dicey!

 

 

2) I assume the real time clock being installed is via am actual hardware mod, not a software thing?

 

I do like the idea of saving a file with the date, as long as it is shorter:  e.g. SUE8323

 

But it sounds like, in general, prodos really didn't have any way of assigning a date and time to a file. I find this odd. Another odd drawback of the Apple I would say.

 

 

Link to comment
Share on other sites

It's not a limit of ProDOS, it's a limit of the hardware to automate the time stamp. The date and time

can be poked into memory, that's what the Compute! program does. Because Apples (until the IIgs) don't have a RTC. Unless you added one, via a slot in a IIe or I believe there was a serial port clock that could plug into the //c back in the day. There were lots of options to add a RTC, they just weren't stock.
 

Which brings us to the next point. Yes, a real-time clock is a hardware mod and not software. It's usually not a hard mod to do. I believe most now days just sit under the cpu (even in the //c). So you remove the cpu from the motherboard socket, insert the "no slot clock" into the motherboard, then insert the cpu into the clock. And then you just have to replace the battery/batteries every 1-3 years or so. 
 

And you don't update the program with new pokes. You use the same pokes referenced in the program to update the time later from the basic prompt after you have already ran the program to set the initial date/time. Issuing a poke is not dangerous, as long as you don't typo the address. And I could tell you the exact pokes, but it would be more rewarding if you look at the listing and find them yourself. Give a man a fish, teach a man to fish, and all that. 

 

I believe there is one modification to the code to use it past the year 2000. But that is called out in the article. 

Link to comment
Share on other sites

Since you have a IIc, also in Nibble, there is a software program called ProMouse that lets you have a pretty accurate software clock.  It loses a few centiseconds during disk access, but otherwise it keeps time fairly good. If you haven't already, download the Nibble disk collection.  A lot of your questions can be answered by viewing the programs on the disks.

Link to comment
Share on other sites

Just so I understand. This would be a permanent thing though and would apply to every file saved in basic therafter? 

(Let's say you first type in the Compute! program and save that as "DATEANDTIME".  Now you type NEW, type and save a new program and save that as "NEWBIE"

If you then do a PR#6, then a CAT, DATEANDTIME and NEWBIE will both display the dates and times they were saved, and those different displays will appear instead of <NODATE> in the CAT listing. This is all corect?)

 

I just want to make sure I got it right before hours of typing that program in and may not be worth it because just saving as "NEWBIE8423" is a heck of a lot easier, no?

I mean, yes there is a 15 character limit, and technically no more than 9, if 6 are used for, e.g. 123023, but you still have 9 in there for a pretty decent file name. But you still see <NODATE> in the CAT, so I guess it boils down to

if you hate seeing that NODATE and don't mind spending a couple of hours typing.

Link to comment
Share on other sites

The date and time stamp for modified and created on the cat(alog) for any files saved while the date and time is in memory is permanent. At least as permanent as any other data on the disk.

 

But it will only time stamp files for the session you ran the program in. So if you reboot and that area of memory is wiped, anything new you save will no longer update the date/time. Unless you run the program again to put the values back into memory.

 

Also, as far as I'm aware, if a file has a modified date/time, if you re-save the file with no date/time in memory, it retains the previous date/time. It won't replace a previous date/time stamp with"no date". 

Link to comment
Share on other sites

Something you mentioned makes me think that this program's limitation is even too confining. Its only time stamping files for the session you ran the program in would be fine, but when you said that if you reboot, anything new you save will no longer update the date/time, that killed it for me.  To my way of thinking, what good is that?  That means if you created a program on August 4th, but came back to it the next day, changed a few things, and resaved it, it would still show its original creation date of August 4, and not August 5, meaningit didn't account for that you made any changes, i.e.  that you made updates to it.  This would only be good if simply wanted to know what day you made the file, not when you last worked on it.  I think I would rather see the update.

 

I also wouldn't want to have to run the program again just to put the values back into memory either, too much fuss it seems.

 

So I guess this circles me back to the other idea: ignore and/or get used to the <NODATE> in the CAT listing, and just save the file with the date right in it, e.g. NEWBIE8423. This way also gives more flexibility, as you can have the best of both worlds, actually 3 worlds, the original file,  to see when you first created the file, as well as any updated versions on that file creation date in case you wanted to see its evolution that date OR any revisions on subsequent days. 

 

Hence we have LOAD NEWBIE8423 (original file)  but then just save that as a new file of NEWBIE8423REV1  NEWBIE8423REV2, etc. (knowing that the higher the revision number, the more recent it is for that day) and/or even NEWBIE8523 if you wanted to keep all the earlier files to see their evolution, but the last one with the most recent date is where you left off with the subject matter.

 

Though more complete and interesting to have also had it time stamp it, since I will not doing record keeping where exact time figures are of the essence and/or critical, Ive concluded that the date concept is good enough.

With the program limitations, that program, though fun, doesn't seem quite worth it to me. But I know everyone is different.  I'm glad you expounded on and clarified things for me on this, thank you.

 

What's your opinion on the program and what I said?

 

 

Link to comment
Share on other sites

I think you are over thinking it. If your objective is to date/time stamp basic programs you are writing without any hardware modification, then this fits the bill. You just need to run it after booting each time. Certainly not the end of the world. And if you want up to date time stamps, you then poke a value before you save again.

 

You seem to want a solution with no interaction on your part. Well, then install a "no slot clock". But you also don't seem to want to do that (but even that will also require copying a driver .system file on your boot disk).

 

You seem to want modern convenience without acknowledging the fact these older systems didn't have built in RTCs. 
 

Honestly, at this point I'm not sure what you want. Or what you are willing to do to get it. 

Link to comment
Share on other sites

Nick, I was just trying to avoid doing a hardware modification, so I thought this program might be a good thing.  I am aware that these older systems had their limits, like not having built in RTCs. They were great for their time and still are.  I was just trying to gauge if it seemed worth it to type in that program, that's all.

 

You're obviously at a higher level in experience with these things than I am, like your knowledge of subroutines for example. I am trying my best to try things out on my 2c, but I do get stuck with syntax errors and other error messages that prevent me from continuing, and it becomes difficult and frustrating and a test of patience, so I turn to others for help.  I will try harder.

Link to comment
Share on other sites

Apologies if that came off a bit harsh. Not my intention. It's just your end goals don't seem to align with what you are willing to do. And further apologies if this comes off redundant, just trying to explain it differently. 

 

The compute program (and probably the nibble program mentioned as well) will absolutely time stamp your basic save files. And that time stamp is persistent on the disk. But this approach comes with the (minor) inconvenience that the program has to be run at boot time if you are going to do any modifications/saves. But the time stamp once it is saved is absolutely persistent.

 

If you boot and run a cat without running the date/time program, your files will retain the date/time of last save. But if you re-save without running the "clock" program, they will keep the old date/time (or "no date").

 

If you want to not have to run a program at boot, then you need to install a "no slot clock". It's probably the simplest hardware modification out there. But those almost always will still require a driver file on the boot disk in order for ProDOS to recognize it. Very easy to do, just copy the .system file to your boot disk. 

 

At this point it's really up to you to decide what you are willing or not willing to do to reach your goal.


<rant>


As for your other questions about writing basic programs, I'm still a big believer in the teach vs provide approach. It's great that you are interested and willing to learn. But instead of stopping and asking specific questions every time you hit a minor roadblock, look up some books/resources on basic programming. Look for other programs that do similar things you want to do, and then analyze them. Modify them. See how they react to your changes. 

 

Back in the 80s, that's how we learned. We didn't have the luxury of posting a question to the world and waiting for an answer. We had to read and learn a lot of this ourselves. Even to this day, I type in basic programs from magazines. And I always have typos. But I've learned how to interpret the various error messages and incorrect behaviors, and learned basic program structure, commands, subroutines, etc. And that all helps me troubleshoot my programs. Personally, I find it more rewarding when I figure this stuff out myself. Not to say you can't ask questions if you are really stuck. But maybe just put in a little more effort on your own.

 

And experiment. Never stop experimenting. That's another way we all learned this many years ago. Look at other programs. See how they accomplish similar things you want to do. Then modify those programs to see how those changes affect the end result. I can't count how many times as a kid I would modify magazine programs to figure out how the different commands worked. Once you start piecing things together, you'll be amazed at how simple it all really is. And you'll feel great about figuring it out yourself. 


</rant>
 

 

Link to comment
Share on other sites

I said all that because over the past week it seems like you put little to no effort into troubleshooting your programs. You just wait to be spoon fed fixes. And some of the questions/issues have been very entry level stuff. Stuff that is easily googled. And it also seems like you are sometimes trying to take on stuff that is clearly above your current ability. A better approach would be to start small and get a better understanding of the basics and then start applying what you learned to more advanced stuff. 

 

I personally have no problem with helping people if it seems like they are at least putting some effort in. But I haven't seen that here. If other people want to keep spoon feeding you, then more power to them. But I'm out.

 

Good luck. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...