REM *************************************************************************** REM **** Program Bridal Store
************************************************* REM *************************************************************************** REM *************************************************************************** REM **** Author Philip King
************************************************** REM *************************************************************************** REM *************************************************************************** REM *************************************************************************** REM **** Includes go here
***************************************************** REM ***************************************************************************
REM *************************************************************************** REM *************************************************************************** REM **** Sreen statements here
************************************************ REM *************************************************************************** REM ***************************************************************************
REM *************************************************************************** REM **** defines
for quick use
data types
************************************* REM *************************************************************************** REM ***************************************************************************
REM *************************************************************************** REM **** Listing of subs
and funtions
***************************************** REM ***************************************************************************
REM ***************************************************************************
REM *************************************************************************** REM **** arrays decleared here
************************************************ REM *************************************************************************** imenu = 4
REM ***************************************************************************
REM *************************************************************************** REM **** arrays set
to data here
********************************************** REM *************************************************************************** smenu(1) = "1) Edit Customer Info": smenu(2) = "3) Edit Inventory Data "
smenu(3) = "2) Edit Sales ": smenu(4) = "4) System Maintenance "
REM ***************************************************************************
REM *************************************************************************** REM **** variables declares go here
******************************************* REM *************************************************************************** REM ***************************************************************************
REM *************************************************************************** REM **** customer info record
type ******************************************** REM *************************************************************************** REM ***************************************************************************
REM *************************************************************************** REM **** inventory record
type ************************************************ REM *************************************************************************** REM ***************************************************************************
REM *************************************************************************** REM **** system data file record
********************************************** REM *************************************************************************** REM ***************************************************************************
REM *************************************************************************** REM **** point of sale
type *************************************************** REM *************************************************************************** REM *************************************************************************** linventorylen
= LEN(sinventoryrec
)lcustreclen
= LEN(custinforec
)lsystemreclen
= LEN(systemrec
)'PRINT lsystemreclen
'PRINT lcustreclen
'PRINT linventorylen
'END
REM ***************************************************************************
REM *************************************************************************** REM **** main menu
loop ******************************************************* REM *************************************************************************** menuloop:
REM ***************************************************************************
REM *************************************************************************** REM **** Sytem Header
********************************************************* REM *************************************************************************** systemheader:
REM ***************************************************************************
REM *************************************************************************** REM **** printes in
system erros
********************************************** REM *************************************************************************** sprintserrors:
IF se
= "" THEN se
= "INVALID RESPONSE" itemp1 = 40 - (itemp / 2)
'COLOR Yellow, Blue
idelay = 1.5
iflag2 = 1
REM ***************************************************************************
REM ***************************************************************************** REM **** numeric
input sub ****************************************************** REM ***************************************************************************** snumeric:
se = "INPUT OUT OF BOUNDS"
REM ***************************************************************************
REM *************************************************************************** REM **** alpha
input sub ****************************************************** REM *************************************************************************** salphainput:
iflag2 = 0
ilength2
= LEN(saction
) + 2LOCATE 23, ilength2
' set prompt one space after action menu print COLOR Yellow
, Black:
PRINT SPC(ib
);
' changes color and prints ib spaces to screen for input lenght LOCATE 23, ilength2
' sets curser at the begining of input space from previouse line LINE INPUT sr: sr
= UCASE$(sr
) ' inputs data from user changes it to upper case se = "INVALID INPUT LENGTH"
sr = ""
iflag2 = 1
REM ***************************************************************************
REM *************************************************************************** REM **** main menu
to the
screen ********************************************** REM *************************************************************************** printmain:
REM ***************************************************************************
REM *************************************************************************** REM **** menu prompts start here
********************************************** REM *************************************************************************** mainmenuchoice:
ib = 1
ihigh = 99
ilow = 1
saction = "Choose Menu Option or X to Quit "
REM ***************************************************************************
REM *************************************************************************** REM **** clean up the prompt area
********************************************* REM *************************************************************************** clearprompt:
REM ***************************************************************************
REM *************************************************************************** REM **** inventory
input modual
*********************************************** REM *************************************************************************** inv0:
REM ************************************************************************** inv1:
saction = "Enter Enventory Number X to Exit "
ib = 10
ilow = 1
ihigh = 999999999
iflag1 = 0
sdesc = sr
sinventoryrec.id = sr
'sinventoryrec.id = sr: GOSUB inv0: GOTO inv2
REM *************************************************************************** inv2:
saction = "Enter D for Default, Type Name, X to Exit - To Backup "
ib = 10
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.sdesc = sinventoryrec.id
sdesc = sinventoryrec.id
sinventoryrec.sdesc = sr
sdesc = sr
REM *************************************************************************** inv3:
saction = "Enter Date Bought X to Exit - To Backup "
ib = 8
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.sdate_bought = sr
REM *************************************************************************** inv4:
saction = "Enter Date Sold X to Exit - To Backup "
ib = 10
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.sdate_sold = sr
REM *************************************************************************** inv5:
saction = "Enter Cost X to Exit - To Backup "
ib = 10
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.fcost = sr
REM *************************************************************************** inv6:
saction = "Enter Retail Price X to Exit - To Backup "
ib = 15
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.fretail = sr
REM *************************************************************************** inv7:
saction = "Enter Dress Size X to Exit - To Backup "
ib = 2
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.ssize = sr
REM *************************************************************************** inv8:
saction = "Date Sold X to Exit - To Backup "
ib = 8
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.ssold = sr
REM *************************************************************************** inv9:
saction = "Enter Take Out of Eventory Y/N X to Exit - To Backup "
ib = 1
ilow = 1
ihigh = 999999999
iflag1 = 0
'CASE CHR$(28): GOTO inv7 ' enter key or ""
sinventoryrec.ssold = sr
REM *************************************************************************** REM *************************************************************************** REM **** customer
input modual
************************************************ REM *************************************************************************** s0:
PRINT LEFT$(custinforec.sphone
, 3) + "/";
MID$(custinforec.sphone
, 4, 3) + "/";
RIGHT$(custinforec.sphone
, 4) REM ********************************************************************
s1:
saction = "Enter Customer ID X to Exit "
ib = 10
ilow = 1
ihigh = 999999999
iflag1 = 0
'IF iflag2 = 1 THEN
' GOSUB clearprompt
'GOSUB salphainput
'ELSE
' GOSUB clearprompt
'GOSUB salphainput
'END IF
'IF sr = "X" THEN RETURN
'IF sr = "" OR sr = CHR$(13) GOTO s2
searchid = sr
'IF iflag3 = 1 THEN
'GOSUB custinforec_null
'iflag3 = 0
'GOTO s1
'END IF
'custinforec.id = sr: GOSUB s0: GOTO s2
custinforec.id = sr
REM ********************************************************************
s2:
saction = "Enter First Name X to Exit - To Backup "
ib = 25
ilow = 99
ihigh = 99
iflag1 = 0
custinforec.sfirst_name
= sr:
GOSUB s0
REM ***************************************************************************
s3:
saction = "Enter Last Name X to Exit - To Back up "
ib = 25
ilow = 99
ihigh = 99
iflag1 = 0
custinforec.slast_name
= sr:
GOSUB s0
REM ***************************************************************************
s4:
saction = "Enter Address X to Exit - To Back up "
ib = 30
ilow = 99
ihigh = 99
iflag1 = 0
custinforec.saddress
= sr:
GOSUB s0
REM ***************************************************************************
s5:
saction = "Enter City Name X to Exit - To Back up "
ib = 25
ilow = 99
ihigh = 99
iflag1 = 0
custinforec.scity
= sr:
GOSUB s0
REM ***************************************************************************
s6:
saction = "Enter State X to Exit - To Back up "
ib = 2
ilow = 99
ihigh = 99
iflag1 = 0
custinforec.sstate
= sr:
GOSUB s0
REM ***************************************************************************
s7:
saction = "Enter Zip Code Name X to Exit - To Back up "
ib = 5
ilow = 99
ihigh = 99
iflag1 = 0
custinforec.szip
= sr:
GOSUB s0
REM ***************************************************************************
s8:
saction = "Enter Phone Number X to Exit - To Back up "
ib = 10
ilow = 99
ihigh = 99
iflag1 = 0
custinforec.sphone
= sr:
GOSUB s0
REM ***************************************************************************
REM *************************************************************************** REM *************************************************************************** puttorecord:
saction = "Commit Data to File Y/N"
ib = 1
ilow = 99
ihigh = 99
iflag1 = 0
REM ***************************************************************************
REM *************************************************************************** REM **** set custinforrec variables
to zero
or null
*************************** REM *************************************************************************** custinforec_null:
custinforec.id = null
custinforec.sfirst_name = null
custinforec.slast_name = null
custinforec.saddress = null
custinforec.scity = null
custinforec.sstate = null
custinforec.szip = null
custinforec.sphone = null
REM ***************************************************************************
REM *************************************************************************** REM **** set inventoryrec variables
to zero
or null
*************************** REM *************************************************************************** inventoryrec_null:
sinventory.id = null
sinventory.sdesc = null
sinventory.sdate_bought = null
sinventory.sdate_sold = null
sinventory.fcost = null
sinventory.fretail = null
sinventory.ssize = null
sinventory.ssold = null
REM ***************************************************************************
REM *************************************************************************** REM **** opens
random files *************************************************** REM *************************************************************************** randomfiles:
zcustrecnum
= LOF(1) / lcustreclen
zenventorynum
= LOF(2) / lenventorylen
zsystemrecnum
= LOF(5) / lsystemreclen
REM ***************************************************************************
REM *************************************************************************** REM **** inserts record into
random file
************************************** REM *************************************************************************** insertrec:
zcustrecnum = zcustrecnum + 1
PUT #1, zcustrecnum
, custinforec
zenventorynum = zenventorynum + 1
PUT #3, zenventorynum
, sinventoryrec
REM ***************************************************************************
REM *************************************************************************** REM **** custinforec duplicate id search
************************************** REM *************************************************************************** dupidsearch:
zx = 1
iflag3 = 0
zx = zx + 1
iflag3 = 1
GET #1, zx
, senventoryrec
zx = zx + 1
iflag3 = 1
REM ************************************************************************** REM ************************************************************************** descinput:
PRINT #6, "Type in your stuff. Save the file and exit." REM **************************************************************************
REM *************************************************************************** REM **** main modual
********************************************************** REM *************************************************************************** main:
COLOR LightCyan
, MidnightBlue
iflag2 = 0
iflag3 = 0
'SCREEN 12
mainloop:
ifilenum = 1
'IF sr = "2" THEN
'ifilenum = 2
'GOSUB inventoryrec_null
'GOSUB inv1
'GOTO mainloop
'END IF
ifilenum = 2
'IF sr = "4" THEN
' ifilenum = 2
'GOSUB inventoryrec_null
'GOSUB inv1
'GOTO mainloop
'END IF
REM **************************************************************************
REM ************************************************************************** REM **** delay
loop ********************************************************** REM **************************************************************************