FoxPro? (urgent help needed... pls? anyone?) - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

FoxPro? (urgent help needed... pls? anyone?)

abie24abie24 Posts: 6Member
my teacher gave me an assignment that is about FoxPro. the problem that he gave me is to create a program for a video rental shop. this will include the "add-edit-delete record" commands. i have worked on some syntaxes but still am not able to make it work. and i also have to make a window that will generate another window and so on. i will attach what i have started on so far... help from anyone would be appreciated... by the way, im using a version 6.0 of visual foxpro. thanks so much...

SET TALK OFF
SET ECHO OFF
SET CONFIRM OFF
SET SAFETY OFF

USE VIDLIST *---[DATABASE]
INDEX ON LASTNAME TO VIDLIST
INDEX ON LASTNAME+FIRSTNAME TO VIDLIST

Clear

wait window "add/edit/delete record?" to nreply

Do case
case nreply $ "Aa"
do addrec
case nreply $ "Ee"
do editrec
case nreply $ "Dd"
do _delerec
case nreply $ "Pp"
do _printrec
end case
PROCEDURE ADDRC
Clear
vlastnme=space(15)
vfirstnme=(10)
vaddress=space(15)
vage=0
vgender=space(1)

@1.1 say "enter lastname : " get vlatname vfirstname
@2.1 say "enter firstname : " get vfirstname
@3.1 say "enter address : "get vaddress

read
wait window "do you want to save (y/n)? "to nans
if nans $ "Yy"
append blank
replace lastname with vlastname, firstname with vfirstname, age with vage,: address with vaddress
else
wait window "record not save"
return
*-----{procedure for editing record}

------------------------------------------------------------------------------------------------------------
procedure editingrec
set index to enrolist2
vlastname=space(15)
vfirstname=space(15)
@1.1 say "enter lastname to edit : "get vlastname"
@2.1 say "enter vfirstname to edit : "get vfirstname"
read
*locate for lastname=vlastname
seek for lastname for vfirstname
if found ()
wait window "record is active"......."
vlastname=lastname
vfirstname=firstname
vage=age
vaddress=address

@1.1 say "enter lastname : " get vlatname vfirstname
@2.1 say "enter firstname : " get vfirstname
@3.1 say "enter address : "get vaddress

read
wait window "do you want to save (y/n)? "to nans
if nans $ "Yy"
replace lastname with vlastname, firstname with vfirstname, address with vaddress
else
wait window "record not save"
and if
else
wait window "record is not found!......."
and if
return

*---------------procedure for deleting record--------------------------------------------------*

procedure _deleterec
set index to enrolist2
vlastname=space(15)
vfirstname=space(15)
@1.1 say "enter lastname to edit : "get vlastname"
@2.1 say "enter vfirstname to edit : "get vfirstname"
read
*locate for lastname=vlastname
seek for lastname for vfirstname
if found ()
nans=" "
delete
wait window "record is deleted!............"
and if
else
wait window "totally remove the deleted record(y/n)? ""to nans
if nans $ "Yy"
pack
wait window "record is deleted!............"
else
wait window "record is mark only for deletion......."
and if
else
wait window "record is not found!......."
and if
return
Sign In or Register to comment.