리얼베이직

위키백과, 우리 모두의 백과사전.
이동: 둘러보기, 찾기

리얼베이직(Realbasic, RB)은 프로그랠밍 환경의 일종인 리얼 스튜디오에서 사용되는 객체 지향 베이직 프로그래밍 언어이다. 미국 텍사스 주 오스틴리얼 소프트웨어가 개발하여 사용화하였으며, OS X, 마이크로소프트 윈도, 32비트 x86 리눅스[1], 용으로 개발되었다.[2][3]

예제 코드 [편집]

아래의 예제는 새로운 텍스트 파일을 만드는 것이다:

Dim t as TextOutputStream
Dim f as FolderItem
f=GetSaveFolderItem(FileTypes1.Text,"Create Example.txt")
If f <> Nil then
 t=TextOutputStream.Create(f)
 t.WriteLine(TextField1.text)
 t.Close
End if

아래의 예제는 캔버스 컨트롤 안에 삼각형을 하나 그리는 것이다. 변수 g는 그래픽스로서 이 이벤트로 통과된다.

Dim Points() as Integer
Points=Array(10,10,100,50,10,200,10,10)
g.ForeColor=RGB(100,200,255)
g.FillPolygon Points

아래의 코드는 내부 데이터베이스를 만들고 SQLExecute를 사용하여 테이블을 만든다:

Dim db as REALSQLdatabase
Dim f as FolderItem
Dim result as Boolean
f=New FolderItem("mydb")
db=New REALSQLdatabase
db.databaseFile=f
result=db.CreateDatabaseFile
If db.Connect() then
 db.SQLExecute("create table invoices(id integer,Cust_ID integer,Amount double, Date date)")
 db.Commit
else
 MsgBox "Database not created"
end if

참조 [편집]

  1. Barr, Joe (August 4, 2005). Review: RealBasic 2005 for Linux. Linux.com. 2006년 4월 11일에 확인.
  2. Smith, Tony (September 13, 2005). RealBasic 2005 for Mac, Windows and Linux. The Register. 2006년 4월 11일에 확인.
  3. Ohlhorst, Frank (June 2011). 3 Tools to Accelerate Web Development. IDG. 2011년 6월 17일에 확인.

바깥 고리 [편집]