Denial Forum Index Denial
The Commodore Vic 20 Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Databaseic - Easy and space saving database tip
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Denial Forum Index -> General Topics
View previous topic :: View next topic  
Author Message
Boray
Musical Smurf


Joined: 03 May 2004
Posts: 2758
Location: Sweden

PostPosted: Thu Feb 02, 2006 3:13 pm    Post subject: Databaseic - Easy and space saving database tip Reply with quote

You know my "TextWalker"... Using the basic editor as a text editor. Now it's time to use the basic editor as a database.

You need a "find"-command, for example a Vic-20 with Programmer's Aid or Buti, or a C64 with The Final Cartridge.

Now let's say you have a video collection with cassettes labeled 1,2,3,4 and so on and you want to do a register over them. Turn on your computer. Ready. Now let's input the data. For example on cassette 1 you have two James Bond films. Then write the following to the screen:
1"james bond - goldfinger + the spy who loved me
and then press return. Note that the "-sign at the start of the line is needed, or you won't be able to search the database.

On the next cassette is your Star Trek collection, then write:
2"star trek, episode 1-4
and then press return and continue in the same manner with all your films.

To save the database, do as you normally save a program:
save"videos",8

Then when you want to find a film, just start the computer, load your database file and use the find command:
find "goldfinger"
.. and that line will be displayed:
1 "james bond - goldfinger + the spy who loved me

Aha, tape number 1. Or if I want to find all james bond films:
find "bond"


There are many advantages with this database:

1. You don't have to load any database program, you only have to load one single file.
2. You don't have to learn a database program.
3. As there is no database program in memory, you can use all of the available memory for the actual data.
4. Your database is compatible with all 8-bit Commodore computers and can export to petascii and ascii (see post below)

I think a C64+TheFinalCart would be the ultimate for this. Then you will have loads of memory, a find command, and both fast disk and tape turbos. It will just take a couple of seconds to load a big database. If you compare to a PC, the time it will take to start the computer and load the database will be just amazing. And for a video film register, you could connect your c64 or vic to the VCR itself and you won't need a monitor.

If you have a lot of information to enter for every title, then you could add a zero to the line number throughout the database. So that title 1 starts on 10 and title 2 starts on 20. The lines in between is additional information for the title above. Like this:

20 "star trek episodes 1-4
21 "1: the black hole, 2: warf the robot
22 "3: bla bla bla 4: blabalbla
30 "the next tape (=tape nr 3)

If you like you can start in the first manner, with lines 1,2,3 and then if you see that you can't fit all the info on a single line, you can just do a RENUMBER10,10 to convert the database to the second manner.

Now, why haven't I thought of this before???? Rolling Eyes

/Anders
_________________
Lost in the jungle of PRG files? PRG Starter is here!


Last edited by Boray on Thu Feb 02, 2006 4:46 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
Schlowski
NoMess!


Joined: 08 Jun 2004
Posts: 784
Location: Kiel, Germany

PostPosted: Thu Feb 02, 2006 4:03 pm    Post subject: Reply with quote

Clever idea Smile

But how about filtering and sorting, two of the most used and needed features of a database?
And there are some problems with more complex search functions with combined conditions like "all Bond films with 'gold' in the title", I think.
(Is there any other Bond film beside Goldfinger with Gold in the title anyway?)

But to put this into the right context, I'm maybe not your target audience for this as I have to program with databases on a daily basis in my job Wink


I think it must be possible by some simple redirects or so to disable the tokenizer, so one has not to worry about the basic key words and could input the data without quotes. With this and some preconditions one could even have sort of recordsets delimited by special characters, me thinks...

See what happens? Can't resist to try to make a database program out of this Twisted Evil

Björg
Back to top
View user's profile Send private message Send e-mail
Boray
Musical Smurf


Joined: 03 May 2004
Posts: 2758
Location: Sweden

PostPosted: Thu Feb 02, 2006 4:29 pm    Post subject: Reply with quote

The "-sign is for the FIND command to understand that it's a string.

Another benefit: The database will be compatible with all Commodore 8-bit computers.


How to export the database to petascii:

open 1,8,1,"file"
cmd 1
list
print#1
close 1


How to export the database to ascii:

Convert the file above with for example lc2ascii:
http://user.tninet.se/~pug510w/datormuseum/lc2ascii.html


How to print a list of all bond films on the printer:

open 1,4
cmd 1
find "bond"
print#1
close1
_________________
Lost in the jungle of PRG files? PRG Starter is here!
Back to top
View user's profile Send private message Visit poster's website
Boray
Musical Smurf


Joined: 03 May 2004
Posts: 2758
Location: Sweden

PostPosted: Thu Feb 02, 2006 4:36 pm    Post subject: Reply with quote

Sorting, well, they are always sorted by film number Wink But it would of course be possible to write a more complex search algorithm in ML if one really likes. But I don't think it's worth the effort for the kind of applications this would be used for...
_________________
Lost in the jungle of PRG files? PRG Starter is here!
Back to top
View user's profile Send private message Visit poster's website
Schlowski
NoMess!


Joined: 08 Jun 2004
Posts: 784
Location: Kiel, Germany

PostPosted: Thu Feb 02, 2006 4:36 pm    Post subject: Reply with quote

So you just invented a 'databasic' Cool

Björg
Back to top
View user's profile Send private message Send e-mail
Boray
Musical Smurf


Joined: 03 May 2004
Posts: 2758
Location: Sweden

PostPosted: Thu Feb 02, 2006 4:39 pm    Post subject: Reply with quote

Schlowski wrote:

(Is there any other Bond film beside Goldfinger with Gold in the title anyway?)


The man with the golden gun Wink
_________________
Lost in the jungle of PRG files? PRG Starter is here!
Back to top
View user's profile Send private message Visit poster's website
Boray
Musical Smurf


Joined: 03 May 2004
Posts: 2758
Location: Sweden

PostPosted: Thu Feb 02, 2006 4:45 pm    Post subject: Reply with quote

Schlowski wrote:
So you just invented a 'databasic' Cool

Björg


Laughing Or.... Databaseic! Laughing
_________________
Lost in the jungle of PRG files? PRG Starter is here!
Back to top
View user's profile Send private message Visit poster's website
carlsson
Class of '6502


Joined: 10 Mar 2004
Posts: 5522
Location: Västerås, Sweden

PostPosted: Thu Feb 02, 2006 7:10 pm    Post subject: Reply with quote

SELECT COUNT(id) FROM databaseic WHERE title LIKE "%gold%"

The FIND command would show all the lines, but you would want a mechanism to count how many lines of output you got.
_________________
Anders Carlsson

Back to top
View user's profile Send private message Send e-mail Visit poster's website
Boray
Musical Smurf


Joined: 03 May 2004
Posts: 2758
Location: Sweden

PostPosted: Fri Feb 03, 2006 5:14 am    Post subject: Reply with quote

carlsson wrote:
SELECT COUNT(id) FROM databaseic WHERE title LIKE "%gold%"

The FIND command would show all the lines, but you would want a mechanism to count how many lines of output you got.


Now, that seems so increadibly important to me Rolling Eyes
_________________
Lost in the jungle of PRG files? PRG Starter is here!
Back to top
View user's profile Send private message Visit poster's website
Boray
Musical Smurf


Joined: 03 May 2004
Posts: 2758
Location: Sweden

PostPosted: Fri Feb 03, 2006 5:15 am    Post subject: Reply with quote

The LIST command is of course also essential to Databaseic. If you for example have recorded a new film at the end of, let's say tape 43. Then do the following:

list 43

Which would bring up, for example:

43 "Indiana Jones and the last crusade

Like normal basic editing, just go up with the cursor to add the new information.

43 "Indiana Jones and the last crusade, Toy Story 2

and press return...


To save and replace an existing file on the disk, there is a special trick:

save "@0:file",8

(The 0 is a zero)
_________________
Lost in the jungle of PRG files? PRG Starter is here!
Back to top
View user's profile Send private message Visit poster's website
carlsson
Class of '6502


Joined: 10 Mar 2004
Posts: 5522
Location: Västerås, Sweden

PostPosted: Fri Feb 03, 2006 5:52 am    Post subject: Reply with quote

Well, those of us who have worked with databases and in particular SQL, have an idea which kind of queries are essential, useful and nice to have if you want to pretend it is a real database. However, I don't expect even the dedicated database programs for VIC/64 or even Amiga always have as much functionality.
_________________
Anders Carlsson

Back to top
View user's profile Send private message Send e-mail Visit poster's website
Schlowski
NoMess!


Joined: 08 Jun 2004
Posts: 784
Location: Kiel, Germany

PostPosted: Fri Feb 03, 2006 6:12 am    Post subject: Reply with quote

Wasn't there a DBase version for the C=64? I have some vague memories about that, but it also might be an error on my side...

Björg

PS: Wouldn't it be enough to save "@file",8? "0:" is only for drive number in dual disk drives. And wasn't there an error with the scratch and save function with "@"? I remember reading about this and that it won't work...
Back to top
View user's profile Send private message Send e-mail
Boray
Musical Smurf


Joined: 03 May 2004
Posts: 2758
Location: Sweden

PostPosted: Sat Feb 04, 2006 5:08 am    Post subject: Reply with quote

carlsson wrote:
Well, those of us who have worked with databases and in particular SQL, have an idea which kind of queries are essential, useful and nice to have if you want to pretend it is a real database. However, I don't expect even the dedicated database programs for VIC/64 or even Amiga always have as much functionality.


Now, I think you are being silly. Instead of admiting that my idea was a rater good one, you argue over what the word "database" means, as if that would be your own property... Like if Basic 2.0 wouldn't be a programming language just because there are more advanced programming languages today... Well, let's say my idea is a register or a record keeper instead then. Does that make you happy? Rolling Eyes

carlsson wrote:
SELECT COUNT(id) FROM databaseic WHERE title LIKE "%gold%"


Well, it's just to use this very simple databaseic command:

open 1,8,1,"file"
cmd 1
find "gold"
print#1
close 1

1000 open1,8,0,"file"
1010 get#1,a$:if st<>0then close 1: print x : end
1020 if a$=chr$(13) then x=x+1
1030 goto 1010
goto1000

...or you could use this amiga program:
http://user.tninet.se/~hlw771b/sel_count.html

and use:
count FILE file TEXT ASCII 13


...As if it would be likely that you wouldn't be able to count the records yourself as they appear on the screen with the amount of data (I couldn't say database could I) that would fit into the memory of a vic-20 or c64...

(Btw, I have used SQL too, and I still think you are being silly!)

/Anders
_________________
Lost in the jungle of PRG files? PRG Starter is here!
Back to top
View user's profile Send private message Visit poster's website
CurtisP
Vic 20 Amateur


Joined: 08 Mar 2005
Posts: 41

PostPosted: Mon Feb 06, 2006 11:08 am    Post subject: Reply with quote

Schlowski wrote:
Wasn't there a DBase version for the C=64? I have Wouldn't it be enough to save "@file",8? "0:" is only for drive number in dual disk drives. And wasn't there an error with the scratch and save function with "@"? I remember reading about this and that it won't work...


There is a bug with the @ command on the 1541, due to the DOS being a patched version of a two drive DOS. By always using @0: you prevent this bug from ocurring.
Back to top
View user's profile Send private message
Schlowski
NoMess!


Joined: 08 Jun 2004
Posts: 784
Location: Kiel, Germany

PostPosted: Mon Feb 06, 2006 1:24 pm    Post subject: Reply with quote

Good to know, thanks for pointing out this one! I was always a little bit afraid of this bug and used to use new filenames and eventually scratch the unused older ones...

Björg
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Denial Forum Index -> General Topics All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group