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 :

Bermain Bintang Turbo Basic

Code Source :

CLS
FOR C=1 TO 5
FOR D= 1 TO C
LOCATE C,1+D
PRINT "*"
NEXT D
NEXT C


Hasilnya adalah :


*
**
***
****
*****



Code Source :

CLS
FOR C=1 TO 5
FOR D= 5 TO C step -1
LOCATE C,1+D
PRINT "*"
NEXT D
NEXT C


Hasilnya adalah :


*****
****
***
**
*



Code Source :

CLS
FOR C=1 to 5
FOR D= 1 TO 6-c
LOCATE C,D
PRINT "*"
NEXT D
NEXT C


Hasilnya adalah :


*****
****
***
**
*


Code Source :

CLS
FOR C=1 to 5
FOR D= 5 TO 6-c step -1
LOCATE C,D
PRINT "*"
delay 0.09
NEXT D
NEXT C


Hasilnya adalah :


*
**
***
****
*****