|
program RecordStor; var Choice:integer; ///////////////////////////////////////////////////////////////////// //*****************************************************************// //*****************************************************************// ///////////////////////////////////////////////////////////////////// function Prog():integer; //tabe-e aslie barname //in tabe zamani khateme miyabad ke az menu namayesh dade shode //gozineye Quit entekhab shavad var Add, Edit , Delete , Search , Quit : integer; cmdOk, clicked : command; begin showForm; ShowMenu('Choice one :', CH_IMPLICIT); Add := MenuAppendString('Add'); //add new record Edit := MenuAppendString('Edit'); //edit a record Delete := MenuAppendString('Delete'); //delete a record Quit := MenuAppendString('Quit'); //Quit from Program Search := MenuAppendString('Search'); //search for record
cmdOK := CreateCommand('OK', CM_SCREEN, 1); AddCommand(cmdOK); repeat delay(100); clicked := GetClickedCommand; until clicked = cmdOK; if MenuGetSelectedIndex = Add then Prog:=0; if MenuGetSelectedIndex = Edit then Prog:=1; if MenuGetSelectedIndex = Delete then Prog:=2; if MenuGetSelectedIndex = Search then Prog:=3; if MenuGetSelectedIndex = Quit then Prog:=4; RemoveCommand(cmdOK); end; ///////////////////////////////////////////////////////////////////// //*****************************************************************// //*****************************************************************// ///////////////////////////////////////////////////////////////////// procedure AddRecord(); var txtNameId,txtFamilyID,txtPhoneID:integer; cmdOK,cmdCancel,cmdTemp:command; begin showform; cmdOK:=createcommand('Save',CM_OK,1); addcommand(cmdOK); cmdCancel:=createcommand('Cancel',CM_CANCEL,2); AddCommand(cmdCancel); txtNameID:=FormAddtextField ('Name:','',20,TF_ANY); txtFamilyID:=FormAddtextField('Family:','',20,TF_ANY); txtPhoneID:=FormAddtextField ('Phone:','',20,TF_PHONENUMBER); repeat cmdTemp:=GetClickedCommand; until (cmdTemp=cmdOK) or (cmdTemp=cmdCancel); RemoveCommand(cmdOK); RemoveCommand(cmdCancel); FormRemove(txtPhoneID); FormRemove(txtFamilyID); FormRemove(txtNameID); end; ///////////////////////////////////////////////////////////////////// //*****************************************************************// //*****************************************************************// ///////////////////////////////////////////////////////////////////// procedure EditRecord(); var a :integer; begin showform; a:=formaddtextfield('aaaa','a',20,tf_any); delay(1000); formremove(a); end; ///////////////////////////////////////////////////////////////////// //*****************************************************************// //*****************************************************************// ///////////////////////////////////////////////////////////////////// procedure DeleteRecord(); begin end; ///////////////////////////////////////////////////////////////////// //*****************************************************************// //*****************************************************************// ///////////////////////////////////////////////////////////////////// procedure Search(); begin end; ///////////////////////////////////////////////////////////////////// //*****************************************************************// //*****************************************************************// ///////////////////////////////////////////////////////////////////// begin repeat choice:=Prog; if choice=0 then AddRecord; if choice=1 then EditRecord; if choice=2 then DeleteRecord; if choice=3 then search; until choice=4; end. ///////////////////////////////////////////////////////////////////// //*****************************************************************// //*****************************************************************// ///////////////////////////////////////////////////////////////////// |