Tuesday, December 01, 2009

input data dengan simple database turbo basic


OPEN "R",#1,"MHS.DAT",59
FIELD #1,9 AS NIM$,20 AS NAMA$,30 AS ALAMAT$
CLS
LOCATE 4,25:PRINT "DATA MAHASISWA "
LOCATE 5,25:PRINT "_______________"
LOCATE 6,25:PRINT "NIM : "
LOCATE 7,25:PRINT "NAMA : "
LOCATE 8,25:PRINT "ALAMAT : "
LOCATE 9,25:PRINT "_______________"
LOCATE 6,40:INPUT,INIM$
IF INIM$ <> " " THEN
JDATA =LOF(1)/59
FOR X=1 TO JDATA
GET #1,X
IF NIM$=INIM$ THEN EXIT FOR
NEXT X
END IF
IF INIM$=NIM$ THEN
LOCATE 7,40:PRINT NAMA$
LOCATE 8,40:PRINT ALAMAT$
LOCATE 9,40:PRINT "DATA ADA"
ELSE
LOCATE 7,40:INPUT,INAMA$
LOCATE 8,40:INPUT,IALAMAT$
LSET NIM$=INIM$
LSET NAMA$=INAMA$
LSET ALAMAT$=IALAMAT$
JDATA=LOF(1)/59
PUT #1,JDATA+1
LOCATE 12,35:PRINT "DATA SUDAH DISIMPAN"
END IF


Layoutnya seperti ini :