Alright. Sorry for all the questions...But how does this look?
SET TEXT FONT "Oloron"
set text size 13
` Define the UDT
Type fbid
Name as string
Phone as string
Age as string
Crime as string
Crime2 as string
Crime3 as string
LKL as string
Sex as string
Ethnicity as string
GangName as string
Colors as string
Leader as string
Terrortories as string
Years as string
Colors as string
Operations as string
Graffiti as string
Allies as string
Enemies as string
Endtype
` Dimentionalize the UDT
Dim fbi(200) as fbid
ink rgb (0,0,225),0
` Make the variable index global so it works inside functions
global index
` Set the starting index number (because input adds 1)
index=-1
do
cls
Print "---*Welcome to the SAFBI Criminal Database*---"
print ""
Print "1. Load Up Criminal Files"
Print "2. Save Current Entries"
Print "3. Add new entry"
Print "4. View Last Entry"
Print "5. List of Gangs"
Print "6. Log Out"
input "Select an option by number: ";option$
if option$ = "1" then LoadData("fbiDatabase")
if option$ = "2" then SaveData("fbiDatabase")
if option$ = "3" then InputData()
if option$ = "4" then ShowData()
if option$ = "5" then ShowGangs()
if option$ = "6" then print "Logging out..."
loop
` Always put an END before the first function
function InputData()
cls
inc index
input "Enter the suspect's name: ", FBI(index).name
input "Enter the suspect's phone number: ", FBI(index).phone
input "Enter the suspect's age: ", FBI(index).age
input "Enter the suspect's crime(s): ", FBI(index).crime
input "Crime(s) 2: ", FBI(index).crime2
input "Crime(s) 3: ", FBI(index).crime3
input "Enter the suspect's Last Known Location: ", FBI(index).LKL
input "Enter the suspect's sex: ", FBI(index).sex
input "Enter the suspect's ethnicity: ", FBI(index).ethnicity
ShowData()
endfunction
function ShowData()
DO
cls
print "Current Index #"+str$(index);UPKEY()
print ""
print "Name: "+fbi(index).Name
print "Phone: "+fbi(index).Phone
print "Age: "+fbi(index).Age
print "Crime(s): "+fbi(index).Crime
print "Crime(s) 2: "+fbi(index).Crime2
print "Crime(s) 3: "+fbi(index).Crime3
print "Last Known Location: "+fbi(index).LKL
print "Sex: "+fbi(index).Sex
print "Ethnicity: "+fbi(index).ethnicity
` Wait for a keypress
input "To go back type in goback: ";a$
if a$ = "goback" then exit
loop
endfunction
function LoadData(File$)
open to read 1, File$
read word 1, index
for i = 0 to index
read string 1,fbi(i).Name
read string 1,fbi(i).Phone
read string 1,fbi(i).Age
` Make age the value of a$
read string 1,fbi(i).Crime
read string 1,fbi(i).Crime2
read string 1,fbi(i).Crime3
read string 1,fbi(i).LKL
read string 1,fbi(i).Sex
read string 1,fbi(i).Ethnicity
read string 1,""
next i
close file 1
endfunction
function SaveData(File$)
if file exist(File$) then delete file File$
open to write 1, File$
write word 1, index
for i = 0 to index
write string 1,fbi(i).Name
write string 1,fbi(i).Phone
` Save a string version of the integer Age
write string 1,fbi(i).Age
write string 1,fbi(i).Crime
write string 1,fbi(i).Crime2
write string 1,fbi(i).Crime3
write string 1,fbi(i).LKL
write string 1,fbi(i).Sex
write string 1,fbi(i).Ethnicity
write string 1,""
next i
close file 1
endfunction
global index
function ShowGangs()
cls
print "What would you like to do?"
wait 2000
cls
print "---*Gangs*---"
print "1. Add a new Gang entry"
print "2. View Last Gang Entry"
print "3. View known gangs"
print "4. Save Current Gang Entries"
print "5. Load Gang Entries"
print "6. Go to Login Screen"
print "7. Show Gang Entry"
input "Select an option by number: ";opt$
if opt$ = "1" then AddNewGang()
if opt$ = "2" then ShowGangData()
if opt$ = "3" then ViewKnownGangs()
if opt$ = "4" then SaveData("fbiDatabaseGangs")
if opt$ = "5" then LoadData("fbiDatabaseGangs")
if opt$ = "6" then SaveData("fbiDatabaseGangs")
endfunction
function ViewKnownGangs()
cls
Print "---*FBI Database*---"
Print "List of Known Gangs:"
wait 2000
Print "Los Aztecas"
wait 2000
Print "Grove Street Families"
wait 2000
Print "Ballas"
wait 2000
Print "Russian Mafia"
wait 2000
Print "Vercetti Crime Family"
wait 2000
Print "Underground Racers"
wait 2000
Print "Contract Killers/The Hitmen"
wait 2000
Print "Yakuza"
wait 2000
Print "Los Santos Pimps"
wait key
ShowGangs()
endfunction
function AddNewGang()
cls
cls
inc index
input "Enter the Gang's name: ", fbi(index).GangName
input "Enter the known or suspected leader: ", fbi(index).Leader
input "Enter Terrortories: ", fbi(index).Terrortories
input "Enter years of operation: ", fbi(index).Years
input "Colors: ", fbi(index).Colors
input "Enter the Gang's known activities: ", fbi(index).Operations
input "Enter Gang's known Graffiti: ", fbi(index).Graffiti
input "Enter the Gang's allies: ", fbi(index).Allies
input "Enter the Gang's Enemies: ", fbi(index).Enemies
wait key
ShowGangs()
endfunction
function ShowGangData()
cls
print "Current Entry #"+str$(index)
print ""
print "Gang's Name: "+fbi(index).GangName
print "Gang's Leader: "+fbi(index).Leader
print "Gang's Terrortories: "+fbi(index).Terrortories
print "Years in Operation: "+fbi(index).Years
print "Gang's Colors: "+fbi(index).Colors
print "Known Activities: "+fbi(index).Operations
print "Known Graffiti: "+fbi(index).Graffiti
print "Known Allies: "+fbi(index).Allies
print "Known Enemies: "+fbi(index).Enemies
` Wait for a keypress
wait key
ShowGangs()
endfunction
function SDFile$)
if file exist(File$) then delete file File$
open to write 1, File$
write word 1, index
for i = 0 to index
write string 1,fbi(i).GangName
write string 1,fbi(i).Leader
` Save a string version of the integer Age
write string 1,fbi(i).Terrortories
write string 1,fbi(i).Years
write string 1,fbi(i).Colors
write string 1,fbi(i).Operations
write string 1,fbi(i).Graffiti
write string 1,fbi(i).Allies
write string 1,fbi(i).Enemies
write string 1,""
next i
close file 1
endfunction
function LD(File$)
open to read 1, File$
read word 1, index
for i = 0 to index
read string 1,fbi(i).GangName
read string 1,fbi(i).Leader
read string 1,fbi(i).Terrortories
` Make age the value of a$
read string 1,fbi(i).Years
read string 1,fbi(i).Colors
read string 1,fbi(i).Operations
read string 1,fbi(i).Graffiti
read string 1,fbi(i).Allies
read string 1,fbi(i).Enemies
read string 1,""
next i
close file 1
ShowGangs()
endfunction
I'm fairly new to the coding thing. Sorry again for the questions.
Rise from the fallen ashes.