03-14-2005, 01:13 AM
Hey guys the list not working so i am taking it of from my program. I got tomorrow morning to hand this up.
Anyhow i have built two programs. Could you guys look at it and tell me which one i should go with.
PROGRAM #1:
DECLARE SUB editvid ()
DECLARE SUB addvid ()
DECLARE SUB delvid ()
DECLARE SUB listvid ()
DECLARE SUB searchvid ()
DECLARE SUB LEAVE ()
DECLARE SUB mainmenu ()
TYPE videotype
id AS INTEGER
vidname AS STRING * 100
vidgenre AS STRING * 100
vidactor AS STRING * 100
vidratin AS STRING * 2
END TYPE
DIM vid AS videotype
CLS
mainmenu
SUB addvid
COLOR 2
DIM vid AS videotype
CLS
OPEN "vid.id" FOR RANDOM AS #1 LEN = LEN(vid)
DO UNTIL response$ = "n"
INPUT "please enter video's barcode number", number
vid.id = number
INPUT "enter name of video", vid.vidname
INPUT "enter main actor of film", vid.vidactor
INPUT "enter rating of video ?/10 ", vid.vidratin
INPUT "enter genre of the movie being borrowed", vid.vidgenre
PRINT "you added a new video"
PUT #1, vid.id, vid
INPUT "do you want to add any another videos? y-Yes, n-No ", response$
LOOP
CLOSE #1
END SUB
SUB delvid
DIM vid AS videotype
CLS
OPEN "vid.id" FOR RANDOM AS #1 LEN = LEN(vid)
DO UNTIL response$ = "n"
INPUT "please enter video's bar code number", number
vid.id = number
GET #1, vid.id, vid
PRINT "This is the video's name", vid.vidname
PRINT " this is the video's main actor", vid.vidactor
PRINT "this is the video's rating", vid.vidratin
PRINT "this is the video's genre", vid.vidgenre
INPUT "do you wish to delete the record?y/n", responset$
IF responset$ = "y" THEN
vid.vidname = ""
vid.vidactor = ""
vid.vidratin = ""
vid.vidgenre = ""
PUT #1, vid.id, vid
PRINT "You deleted the record"
ELSE
PRINT "You cancelled the delete"
END IF
INPUT "do you want to delete any other records?", response$
LOOP
CLOSE #1
END SUB
SUB editvid
DIM vid AS videotype
CLS
OPEN "vid.id" FOR RANDOM AS #1 LEN = LEN(vid)
DO UNTIL response$ = "n"
INPUT "please enter video's bar code number", number
vid.id = number
GET #1, vid.id, vid
PRINT "This is the video's name", vid.vidname
PRINT " this is the video's main actor", vid.vidactor
PRINT "this is the video's rating", vid.vidratin
PRINT "this is the video's genre", vid.vidgenre
INPUT "do you wish to edit the record?y/n", responset$
IF responset$ = "y" THEN
vid.vidname = ""
vid.vidactor = ""
vid.vidratin = ""
vid.vidgenre = ""
PUT #1, vid.id, vid
INPUT "edit the name of video", vid.vidname
INPUT "edit the actor of the video", vid.vidactor
INPUT "edit the rating of the video", vid.vidratin
INPUT "edit the genre of the video", vid.vidgenre
PUT #1, vid.id, vid
ELSE
PRINT "You decided not to edit the record"
END IF
INPUT "do you want to edit any other records?", response$
LOOP
CLOSE #1
END SUB
SUB LEAVE
COLOR 9
PRINT "Goodbye user!!!!!"
PRINT "Come Back Soon"
END SUB
SUB listvid
END SUB
SUB mainmenu
COLOR 10
20 PRINT "WELCOME TO VIDEOTRONICS V1.0 DATABASE"
PRINT "Please Select an Option from below"
PRINT "1 - Add a new video"
PRINT "2 - Delete a video that was lent to the customer"
PRINT "3 - List all videos in stock"
PRINT "4 - search a video"
PRINT "5 - Edit video details"
PRINT "6 - EXIT DATABASE "
100 INPUT C
SELECT CASE C
CASE IS = 1
addvid
CLS
GOTO 20
CASE IS = 2
delvid
CLS
GOTO 20
CASE IS = 3
listvid
CLS
GOTO 20
CASE IS = 4
searchvid
CLS
GOTO 20
CASE IS = 5
editvid
CLS
GOTO 20
CASE IS = 6
LEAVE
CASE ELSE
PRINT "You inserted an invalid option"
GOTO 100
260 END SELECT
END SUB
SUB searchvid
DIM vid AS videotype
CLS
DO UNTIL response$ = "n"
INPUT "please enter video's bar code number", number
vid.id = number
OPEN "vid.id" FOR RANDOM AS #1 LEN = LEN(vid)
GET #1, vid.id, vid
CLOSE #1
PRINT "This is the video's name", vid.vidname
PRINT " this is the video's main actor", vid.vidactor
PRINT "this is the video's rating", vid.vidratin
PRINT "this is the video's genre", vid.vidgenre
INPUT " Do you wish to search for another record?", response$
LOOP
CLOSE #1
END SUB
Thats the one i have been showing you all here.
HERE IS PROGRAM #2
DECLARE SUB editvid ()
DECLARE SUB addvid ()
DECLARE SUB delvid ()
DECLARE SUB listvid ()
DECLARE SUB searchvid ()
DECLARE SUB LEAVE ()
DECLARE SUB mainmenu ()
TYPE videotype
id AS INTEGER
vidname AS STRING * 100
vidgenre AS STRING * 25
vidactor AS STRING * 50
vidratin AS STRING * 2
END TYPE
DIM vid AS videotype
CLS
mainmenu
SUB addvid
COLOR 2
DIM videos AS videotype
CLS
OPEN "videos.dat" FOR RANDOM AS #1 LEN = LEN(videos)
DO UNTIL response$ = "n"
INPUT "please enter video's barcode number", number
videos.id = number
INPUT "Enter name of video", videos.vidname
INPUT "Enter main actor of film", videos.vidactor
INPUT "Enter rating of the video ?/10", videos.vidratin
INPUT "Enter genre of the video", videos.vidgenre
PRINT "You added a record"
PUT #1, videos.id, videos
INPUT "do you want to add another videos? y-Yes, n-No", response$
LOOP
CLOSE #1
END SUB
SUB delvid
DIM videos AS videotype
CLS
OPEN "videos.dat" FOR RANDOM AS #1 LEN = LEN(videos)
DO UNTIL response$ = "n"
INPUT "Please enter video's barcode number", number
videos.id = number
GET #1, videos.id, videos
PRINT "This is the video's name", videos.vidname
PRINT "This is the video's main actor", videos.vidactor
PRINT "This is the video's rating", videos.vidratin
PRINT "This is the video's genre", videos.vidgenre
INPUT "do you wish to delete the record? y/n", responset$
IF responset$ = "y" THEN
videos.vidname = ""
videos.vidactor = ""
videos.vidratin = ""
videos.vidgenre = ""
PUT #1, videos.id, videos
PRINT "You deleted the record"
ELSE
PRINT "you cancelled the delete"
END IF
INPUT " do you wish to delete any other records?", response$
LOOP
CLOSE #1
END SUB
SUB editvid
DIM videos AS videotype
CLS
OPEN "videos.dat" FOR RANDOM AS #1 LEN = LEN(videos)
DO UNTIL response$ = "n"
INPUT "Please enter video's barcode number", number
videos.id = number
GET #1, videos.id, videos
PRINT "This is the video's name", videos.vidname
PRINT "This is the video's main actor", videos.vidactor
PRINT "This is the video's rating", videos.vidratin
PRINT "This is the video's genre", videos.vidgenre
INPUT "do you wish to edit the record? y/n", responset$
IF responset$ = "y" THEN
videos.vidname = ""
videos.vidactor = ""
videos.vidratin = ""
videos.vidgenre = ""
PUT #1, videos.id, videos
INPUT "Enter the name of the video", videos.vidname
INPUT "Enter the main actor of the video", videos.vidname
INPUT "Enter the rating of the video", videos.vidratin
INPUT "Enter the genre of the video", videos.vidgenre
PUT #1, videos.id, videos
ELSE
PRINT "You decided not to edit the record"
END IF
INPUT "Do you want to edit any other records? y/n", response$
LOOP
CLOSE #1
END SUB
SUB LEAVE
COLOR 9
PRINT "Goodbye User"
PRINT "Come back soon"
END SUB
SUB listvid
END SUB
SUB mainmenu
COLOR 10
20 PRINT "WELCOME TO VIDEOTRONICS V1.0 DATABSE"
PRINT "Please select an option from below"
PRINT "1 - Add a new video"
PRINT "2 - Delete a video"
PRINT "3 - List all videos in stock"
PRINT "4 - Search a video"
PRINT "5 - Edit video details"
PRINT "6 - Exit Database"
100 INPUT c
SELECT CASE c
CASE IS = 1
addvid
CLS
GOTO 20
CASE IS = 2
delvid
CLS
GOTO 20
CASE IS = 3
listvid
CLS
GOTO 20
CASE IS = 4
searchvid
CLS
GOTO 20
CASE IS = 5
editvid
CLS
GOTO 20
CASE IS = 6
LEAVE
CASE ELSE
PRINT "You inserted an invalid option"
GOTO 100
260 END SELECT
END SUB
SUB searchvid
DIM videos AS videotype
CLS
OPEN "videos.dat" FOR RANDOM AS #1 LEN = LEN(videos)
DO UNTIL response$ = "n"
INPUT "Please enter video's barcode number", number
videos.id = number
GET #1, videos.id, videos
PRINT "This is the video's name", videos.vidname
PRINT "this is the video's main actor", videos.vidactor
PRINT "This is the video's rating", videos.vidratin
PRINT "This is the video's genre", videos.vidgenre
INPUT "Would you like to search for another record", response$
LOOP
CLOSE #1
END SUB
which one has less chance of crashing on me.
Please reply ASAP and tell me which one i should go with!!!!
I like the second one.
Meg thanks for all your help.
Anyhow i have built two programs. Could you guys look at it and tell me which one i should go with.
PROGRAM #1:
DECLARE SUB editvid ()
DECLARE SUB addvid ()
DECLARE SUB delvid ()
DECLARE SUB listvid ()
DECLARE SUB searchvid ()
DECLARE SUB LEAVE ()
DECLARE SUB mainmenu ()
TYPE videotype
id AS INTEGER
vidname AS STRING * 100
vidgenre AS STRING * 100
vidactor AS STRING * 100
vidratin AS STRING * 2
END TYPE
DIM vid AS videotype
CLS
mainmenu
SUB addvid
COLOR 2
DIM vid AS videotype
CLS
OPEN "vid.id" FOR RANDOM AS #1 LEN = LEN(vid)
DO UNTIL response$ = "n"
INPUT "please enter video's barcode number", number
vid.id = number
INPUT "enter name of video", vid.vidname
INPUT "enter main actor of film", vid.vidactor
INPUT "enter rating of video ?/10 ", vid.vidratin
INPUT "enter genre of the movie being borrowed", vid.vidgenre
PRINT "you added a new video"
PUT #1, vid.id, vid
INPUT "do you want to add any another videos? y-Yes, n-No ", response$
LOOP
CLOSE #1
END SUB
SUB delvid
DIM vid AS videotype
CLS
OPEN "vid.id" FOR RANDOM AS #1 LEN = LEN(vid)
DO UNTIL response$ = "n"
INPUT "please enter video's bar code number", number
vid.id = number
GET #1, vid.id, vid
PRINT "This is the video's name", vid.vidname
PRINT " this is the video's main actor", vid.vidactor
PRINT "this is the video's rating", vid.vidratin
PRINT "this is the video's genre", vid.vidgenre
INPUT "do you wish to delete the record?y/n", responset$
IF responset$ = "y" THEN
vid.vidname = ""
vid.vidactor = ""
vid.vidratin = ""
vid.vidgenre = ""
PUT #1, vid.id, vid
PRINT "You deleted the record"
ELSE
PRINT "You cancelled the delete"
END IF
INPUT "do you want to delete any other records?", response$
LOOP
CLOSE #1
END SUB
SUB editvid
DIM vid AS videotype
CLS
OPEN "vid.id" FOR RANDOM AS #1 LEN = LEN(vid)
DO UNTIL response$ = "n"
INPUT "please enter video's bar code number", number
vid.id = number
GET #1, vid.id, vid
PRINT "This is the video's name", vid.vidname
PRINT " this is the video's main actor", vid.vidactor
PRINT "this is the video's rating", vid.vidratin
PRINT "this is the video's genre", vid.vidgenre
INPUT "do you wish to edit the record?y/n", responset$
IF responset$ = "y" THEN
vid.vidname = ""
vid.vidactor = ""
vid.vidratin = ""
vid.vidgenre = ""
PUT #1, vid.id, vid
INPUT "edit the name of video", vid.vidname
INPUT "edit the actor of the video", vid.vidactor
INPUT "edit the rating of the video", vid.vidratin
INPUT "edit the genre of the video", vid.vidgenre
PUT #1, vid.id, vid
ELSE
PRINT "You decided not to edit the record"
END IF
INPUT "do you want to edit any other records?", response$
LOOP
CLOSE #1
END SUB
SUB LEAVE
COLOR 9
PRINT "Goodbye user!!!!!"
PRINT "Come Back Soon"
END SUB
SUB listvid
END SUB
SUB mainmenu
COLOR 10
20 PRINT "WELCOME TO VIDEOTRONICS V1.0 DATABASE"
PRINT "Please Select an Option from below"
PRINT "1 - Add a new video"
PRINT "2 - Delete a video that was lent to the customer"
PRINT "3 - List all videos in stock"
PRINT "4 - search a video"
PRINT "5 - Edit video details"
PRINT "6 - EXIT DATABASE "
100 INPUT C
SELECT CASE C
CASE IS = 1
addvid
CLS
GOTO 20
CASE IS = 2
delvid
CLS
GOTO 20
CASE IS = 3
listvid
CLS
GOTO 20
CASE IS = 4
searchvid
CLS
GOTO 20
CASE IS = 5
editvid
CLS
GOTO 20
CASE IS = 6
LEAVE
CASE ELSE
PRINT "You inserted an invalid option"
GOTO 100
260 END SELECT
END SUB
SUB searchvid
DIM vid AS videotype
CLS
DO UNTIL response$ = "n"
INPUT "please enter video's bar code number", number
vid.id = number
OPEN "vid.id" FOR RANDOM AS #1 LEN = LEN(vid)
GET #1, vid.id, vid
CLOSE #1
PRINT "This is the video's name", vid.vidname
PRINT " this is the video's main actor", vid.vidactor
PRINT "this is the video's rating", vid.vidratin
PRINT "this is the video's genre", vid.vidgenre
INPUT " Do you wish to search for another record?", response$
LOOP
CLOSE #1
END SUB
Thats the one i have been showing you all here.
HERE IS PROGRAM #2
DECLARE SUB editvid ()
DECLARE SUB addvid ()
DECLARE SUB delvid ()
DECLARE SUB listvid ()
DECLARE SUB searchvid ()
DECLARE SUB LEAVE ()
DECLARE SUB mainmenu ()
TYPE videotype
id AS INTEGER
vidname AS STRING * 100
vidgenre AS STRING * 25
vidactor AS STRING * 50
vidratin AS STRING * 2
END TYPE
DIM vid AS videotype
CLS
mainmenu
SUB addvid
COLOR 2
DIM videos AS videotype
CLS
OPEN "videos.dat" FOR RANDOM AS #1 LEN = LEN(videos)
DO UNTIL response$ = "n"
INPUT "please enter video's barcode number", number
videos.id = number
INPUT "Enter name of video", videos.vidname
INPUT "Enter main actor of film", videos.vidactor
INPUT "Enter rating of the video ?/10", videos.vidratin
INPUT "Enter genre of the video", videos.vidgenre
PRINT "You added a record"
PUT #1, videos.id, videos
INPUT "do you want to add another videos? y-Yes, n-No", response$
LOOP
CLOSE #1
END SUB
SUB delvid
DIM videos AS videotype
CLS
OPEN "videos.dat" FOR RANDOM AS #1 LEN = LEN(videos)
DO UNTIL response$ = "n"
INPUT "Please enter video's barcode number", number
videos.id = number
GET #1, videos.id, videos
PRINT "This is the video's name", videos.vidname
PRINT "This is the video's main actor", videos.vidactor
PRINT "This is the video's rating", videos.vidratin
PRINT "This is the video's genre", videos.vidgenre
INPUT "do you wish to delete the record? y/n", responset$
IF responset$ = "y" THEN
videos.vidname = ""
videos.vidactor = ""
videos.vidratin = ""
videos.vidgenre = ""
PUT #1, videos.id, videos
PRINT "You deleted the record"
ELSE
PRINT "you cancelled the delete"
END IF
INPUT " do you wish to delete any other records?", response$
LOOP
CLOSE #1
END SUB
SUB editvid
DIM videos AS videotype
CLS
OPEN "videos.dat" FOR RANDOM AS #1 LEN = LEN(videos)
DO UNTIL response$ = "n"
INPUT "Please enter video's barcode number", number
videos.id = number
GET #1, videos.id, videos
PRINT "This is the video's name", videos.vidname
PRINT "This is the video's main actor", videos.vidactor
PRINT "This is the video's rating", videos.vidratin
PRINT "This is the video's genre", videos.vidgenre
INPUT "do you wish to edit the record? y/n", responset$
IF responset$ = "y" THEN
videos.vidname = ""
videos.vidactor = ""
videos.vidratin = ""
videos.vidgenre = ""
PUT #1, videos.id, videos
INPUT "Enter the name of the video", videos.vidname
INPUT "Enter the main actor of the video", videos.vidname
INPUT "Enter the rating of the video", videos.vidratin
INPUT "Enter the genre of the video", videos.vidgenre
PUT #1, videos.id, videos
ELSE
PRINT "You decided not to edit the record"
END IF
INPUT "Do you want to edit any other records? y/n", response$
LOOP
CLOSE #1
END SUB
SUB LEAVE
COLOR 9
PRINT "Goodbye User"
PRINT "Come back soon"
END SUB
SUB listvid
END SUB
SUB mainmenu
COLOR 10
20 PRINT "WELCOME TO VIDEOTRONICS V1.0 DATABSE"
PRINT "Please select an option from below"
PRINT "1 - Add a new video"
PRINT "2 - Delete a video"
PRINT "3 - List all videos in stock"
PRINT "4 - Search a video"
PRINT "5 - Edit video details"
PRINT "6 - Exit Database"
100 INPUT c
SELECT CASE c
CASE IS = 1
addvid
CLS
GOTO 20
CASE IS = 2
delvid
CLS
GOTO 20
CASE IS = 3
listvid
CLS
GOTO 20
CASE IS = 4
searchvid
CLS
GOTO 20
CASE IS = 5
editvid
CLS
GOTO 20
CASE IS = 6
LEAVE
CASE ELSE
PRINT "You inserted an invalid option"
GOTO 100
260 END SELECT
END SUB
SUB searchvid
DIM videos AS videotype
CLS
OPEN "videos.dat" FOR RANDOM AS #1 LEN = LEN(videos)
DO UNTIL response$ = "n"
INPUT "Please enter video's barcode number", number
videos.id = number
GET #1, videos.id, videos
PRINT "This is the video's name", videos.vidname
PRINT "this is the video's main actor", videos.vidactor
PRINT "This is the video's rating", videos.vidratin
PRINT "This is the video's genre", videos.vidgenre
INPUT "Would you like to search for another record", response$
LOOP
CLOSE #1
END SUB
which one has less chance of crashing on me.
Please reply ASAP and tell me which one i should go with!!!!
I like the second one.
Meg thanks for all your help.
ill Gates time is almost up.... i am taking over