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 *************************************************************************** sdata0
AS STRING * 64 ' data path for customer discription files sdata1
AS STRING * 64 ' data path for inventory discription files sdata2
AS STRING * 64 ' data path for pos discription files sdbpath
AS STRING * 64 ' data path for database filesREM ***************************************************************************
REM *************************************************************************** REM **** point of sale
type *************************************************** REM *************************************************************************** REM *************************************************************************** linventorylen
= LEN(sinventoryrec
)lcustreclen
= LEN(scustinforec
)lsystemreclen
= LEN(systemrec
)REM ***************************************************************************
REM *************************************************************************** REM **** metadata commands
**************************************************** REM *************************************************************************** '$VERSIONINFO:
REM ***************************************************************************
'scv = _OS$
'IF isysflag = 0 THEN GOTO sys0
REM ***************************************************************************
REM *************************************************************************** REM **** main menu
loop ******************************************************* REM *************************************************************************** menuloop:
sunit = "Customer Information Maintenance"
sunit = "Inventory Information Maintenance"
sunit = "System Information Maintenance"
REM ***************************************************************************
REM *************************************************************************** REM **** fix computer svc
to show no
[] in
print ****************************** REM *************************************************************************** svcfix:
svc = stemp
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)
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 **** set custinforrec variables
to zero
or null
*************************** REM *************************************************************************** scustinforec_null:
scustinforec.id = null
scustinforec.sfirst_name = null
scustinforec.slast_name = null
scustinforec.saddress = null
scustinforec.scity = null
scustinforec.sstate = null
scustinforec.szip = null
scustinforec.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.scost = null
sinventory.fretail = null
sinventory.ssize = null
sinventory.ssold = null
REM *************************************************************************** REM **** set systemrec variagles
to zero
or null
******************************* REM *************************************************************************** systemdat_null:
systemdat.sspath = null
systemdat.sdata1 = null
systemdat.sdata2 = null
systemdat.sdata3 = null
REM ***************************************************************************
REM *************************************************************************** REM **** opens
random files *************************************************** REM *************************************************************************** randomfiles:
sdbpath = shomedir + "\data\db\"
zsystemrecnum
= LOF(4) / lsystemreclen
REM ***************************************************************************
REM *************************************************************************** REM **** inserts record into
random file
************************************** REM *************************************************************************** insertrec:
PUT #1, zcustrecnum
, scustinforec
PUT #3, zinventorynum
, sinventoryrec
REM ***************************************************************************
REM *************************************************************************** REM **** get last file index
for indexing
************************************* REM ***************************************************************************
autoindex:
zinventorynum = 0
zcustrecnum
= LOF(1) / lcustreclen
zcustrecnum = zcustrecnum + 1
scustinforec.id = sindex
zinventorynum
= LOF(3) / linventorylen
zinventorynum = zinventorynum + 1
sinventoryrec.id = sindex
REM ***************************************************************************
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
REM *************************************************************************** mainloop:
sdata = shomedir + "\data\custdesc\"
ifilenum = 1
sdata = shomedir + "\data\posdesc\"
'IF sr = "2" THEN
'ifilenum = 2
'GOSUB inventoryrec_null
'GOSUB inv1
'GOTO mainloop
'END IF
sdata = shomedir + "\data\invdesc\"
ifilenum = 3
sinventoryrec.scost = "0.00"
sinventoryrec.sretail = "0.00"
'sdb = shomedir + "\data\custdesc"
'ifilenum = 4
' GOSUB systemdat_null
' GOSUB sys1
' GOTO mainloop
REM ***************************************************************************
REM *************************************************************************** REM **** check
for statup directories
***************************************** REM *************************************************************************** dircheck:
PRINT "Home Director Does not Exists" LOCATE 13, 23:
PRINT "Please Create Jbridal in Your Home dir"
dirchk1:
REM *************************************************************************** REM *************************************************************************** REM **** system utilities
data entry
****************************************** REM *************************************************************************** sys0:
REM *************************************************************************** sys1:
saction = "Customer Disc File Path "
ib = 64
ilow = 1
ihigh = 1
iflag1 = 0
systemdat.sdata0 = sr
REM ***************************************************************************
sys2:
saction = "Inventory Disc File Path "
ib = 64
ilow = 1
ihigh = 1
iflag1 = 0
systemdat.sdata1 = sr
REM *************************************************************************** sys3:
saction = "POS Disc File Path "
ib = 64
ilow = 1
ihigh = 1
iflag1 = 0
systemdat.sdata2 = sr
REM *************************************************************************** sys4:
saction = "Enter Database File Path "
ib = 64
ilow = 1
ihigh = 1
iflag1 = 0
systemdat.sdbpath = sr
REM ***************************************************************************
REM *************************************************************************** REM *************************************************************************** REM **** inventory
input modual
*********************************************** REM *************************************************************************** inv0:
PRINT MID$(sinventoryrec.sdate_bought
, 3, 2) + "/";
PRINT MID$(sinventoryrec.sdate_sold
, 3, 2) + "/";
REM *************************************************************************** inv1:
REM *************************************************************************** inv2:
saction = "Enter D for Default, Type Name, X to Exit - To Backup "
ib = 8
ilow = 1
ihigh = 999999999
iflag1 = 0
'CASE CHR$(45): GOTO inv2 '-
sinventoryrec.sdesc = sinventoryrec.id
sdesc = sinventoryrec.id
CASE CHR$(68):
'D for using the sinventoryrec.id as the file name 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 = 8
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.sdate_sold = sr
REM *************************************************************************** inv5:
saction = "Enter Cost X to Exit - To Backup "
ib = 15
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.scost = sr
REM *************************************************************************** inv6:
saction = "Enter Retail Price X to Exit - To Backup "
ib = 15
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.sretail = 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 = "Did Dress Sale Y/N X to Exit - To Backup "
ib = 1
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.ssold = sr
REM *************************************************************************** inv9:
saction = "Enter Quanity of Inventory X to Exit - To Backup "
ib = 4
ilow = 1
ihigh = 999999999
iflag1 = 0
sinventoryrec.squanity = sr
REM *************************************************************************** REM *************************************************************************** REM *************************************************************************** REM **** customer
input modual
************************************************ REM *************************************************************************** s0:
PRINT "(" + LEFT$(scustinforec.sphone
, 3) + ")-";
MID$(scustinforec.sphone
, 4, 3) + "-";
RIGHT$(scustinforec.sphone
, 4) REM ***************************************************************************
s1:
scustinforec.sdesc = scustinforec.id
REM ***************************************************************************
s2:
saction = "Enter First Name X to Exit - To Backup "
ib = 25
ilow = 99
ihigh = 99
iflag1 = 0
scustinforec.sfirst_name = sr
REM *************************************************************************** s3:
saction = "Enter Last Name X to Exit - To Back up "
ib = 25
ilow = 99
ihigh = 99
iflag1 = 0
scustinforec.slast_name = sr
REM ***************************************************************************
s4:
saction = "Enter Address X to Exit - To Back up "
ib = 30
ilow = 99
ihigh = 99
iflag1 = 0
scustinforec.saddress = sr
REM ***************************************************************************
s5:
saction = "Enter City Name X to Exit - To Back up "
ib = 25
ilow = 99
ihigh = 99
iflag1 = 0
scustinforec.scity = sr
REM *************************************************************************** s6:
saction = "Enter State X to Exit - To Back up "
ib = 2
ilow = 99
ihigh = 99
iflag1 = 0
scustinforec.sstate = sr
REM ***************************************************************************
s7:
saction = "Enter Zip Code Name X to Exit - To Back up "
ib = 5
ilow = 99
ihigh = 99
iflag1 = 0
scustinforec.szip = sr
REM *************************************************************************** s8:
saction = "Enter Phone Number X to Exit - To Back up "
ib = 10
ilow = 99
ihigh = 99
iflag1 = 0
scustinforec.sphone = sr
REM *************************************************************************** REM *************************************************************************** s9:
saction = "Enter Description File Name D or Enter - To Back up "
ib = 10
ilow = 99
ihigh = 99
iflag1 = 0
scustinforec.sdesc = scustinforec.id
sdesc = scustinforec.id
CASE CHR$(68):
'D for using the sinventoryrec.id as the file name scustinforec.sdesc = scustinforec.id
sdesc = scustinforec.id
scustinforec.sdesc = sr
sdesc = sr
REM *************************************************************************** REM *************************************************************************** puttorecord:
saction = "Commit Data to File Y/N"
ib = 1
ilow = 99
ihigh = 99
iflag1 = 0
REM ***************************************************************************
REM *************************************************************************** REM **** delay
loop *********************************************************** REM ***************************************************************************