Edit Module Source code Visual Foxpro training.
FILE NAME : EditFriend.Prg
**OM SAI RAM
SET CLOCK on
SET CLOCK TO 07,80
CLOSE ALL
CLEAR
@ 05,01 To 22,100 doub
@ 07,05 say "DATE : "+DMY(DATE())
@ 07,35 say "FRIEND SYSTEM" FONT "arial",14
@ 07,70 say "TIME : "
@ 09,02 TO 09,99
MFriendName = SPACE(100)
MPhoneNo = SPACE(20)
MCity = SPACE(20)
MButtonChoice = 0
USE friends
DO ListFriends
@ 12,02 say "Friend Name"
@ 12,35 Get MFriendName Picture "@K!" valid !EMPTY(MFriendName) size 1,30,1
@ 14,02 say "Phone Number"
@ 14,35 Get MPhoneNo Pict "@K9999999999"
@ 16,02 Say "City"
@ 16,35 Get MCity Pict "@K!"
@ 18,15 Get MButtonChoice Function "*HT \<Save;\<Cancel" size 2,15,2
READ cycle
IF LASTKEY() = 27
RETURN .T.
ENDIF
IF LASTKEY() <> 27
IF MButtonChoice = 1
SELECT Friends
replace friendname WITH MFriendName
replace PhoneNo WITH MPhoneNo
replace city WITH Mcity
WAIT WINDOW "Friend Successfully Updated"
RETURN .t.
ENDIF
IF MButtonChoice = 2
WAIT WINDOW "You selected Cancel button."
Endif
ENDIF
PROCEDURE ListFriends
SELECT Friends
MSelectVal = SPACE(10)
DEFINE WINDOW FriendList AT 00,00 SIZE 20,120 TITLE "[Type and Shoot] Select Friend" ;
SYSTEM color W++/N FONT 'FixedSys',10
MOVE WINDOW FriendList CENTER
ACTIVATE WINDOW FriendList
DEFINE POPUP FriendLst PROMPT FIELD FriendName+SPACE(2)+PhoneNo SCROLL Margin
@ 00,00 Get MSelectVal Popup FriendLst size 20,120
READ
MFriendName = Friends.FriendName
MPhoneNo = Friends.PhoneNo
MCity = Friends.City
DEACTIVATE WINDOW FriendList
RELEASE WINDOWS FriendList
DEACTIVATE POPUP FriendLst
RELEASE POPUP FriendLst
No comments:
Post a Comment