FreeBASIC
FreeBASIC estas komputila programlingvo de altnivela sintakso la plej proksima al QuickBASIC, kaj kompililo por tiu (FreeBASIC Compiler). Origine kompililo kreita kiel libera alternativo Microsoft QuickBasic, sed rapide kovritis per novaj karakterizaĵoj kaj fariĝis potenca ilo por la disvolviĝo de programaro. La unua versio de la tradukilo estis skribitaj en Visual Basic, sed nun li povas kompili mem (skribita en FreeBASIC).
Kompililo
Kompilas QBasic kaj FreeBASIC Kodo por 32-bite plenumebla Win32, DU (en modo protektita) kaj Linukso x86 moduloj. Koncentrante kaj aranĝo fariĝas per la GNU Binary Utilities.
Kompililo distribuita sub la GNU GPL, normo biblioteko - la GNU LGPL.
Ekzistas pluraj komunikiloj evoluo, kiel la erarserĉilo povas uzi la GNU sencimigilo.
Programlingvo
Malgraŭ la fakto ke la kompililo estas kongrua kun QuickBASIC, FreeBASIC lingva aldoniĝis multaj plibonigoj kaj karakterizaĵoj renkonti modernaj postuloj, normoj kaj kongruo kun bibliotekoj kaj API skribita en C / C ++. Komencante kun la versio 0.17, la uzanto povas selekti tri modojn de kompilaĵo (nedeviga -lang): kongruo modon QuickBASIC (qb), malnovaj versioj FreeBASIC (evitinda), kaj norma modo, kio inkluzivas ĉiujn lastaj disvolviĝoj kaj karakterizaĵoj.
Novaj karakterizaĵoj kaj plibonigoj[1]
- Subteno por Unikodo.
- Multaj korpigita tipoj variabloj (Byte, UByte, Short, UShort, Integer, UInteger, LongInt, ULongInt, Single, Double, String, ZString, WString).
- Uzanto-difinita datumtipoj (malfinia nestumado, Sindikato, kampo tipo (tabelo, funkcio, iom kampoj)).
- Nomspacoj.
- Numeritaj tipo (Enum).
- Novaj ŝancoj kiam laborante kun tabeloj (ĝis 2 GB en grandeco, Redim Konservu).
- Pointers (punteros al ajna tipo de datumoj, senlima nerekta parolante).
- Superŝarĝas de funkcioj kaj operatoroj.
- Laŭvola argumentoj funkcioj.
- Konstruita-en ensamblador (ensamblador instrukciojn en fontkodon programo).
- Antaŭtraktiloj.
- Diseñadores kaj destructors klasoj.
- Plibonigita grafika biblioteko.
Ekzemplaj programoj
Saluton, mondo!
Uzante la enkonstruita en biblioteko FreeBASIC:
Print("Saluton, mondo!")
Uzante la norma biblioteko C:
#Include "crt.bi"
puts (!"Saluton, mondo!\n")
Uzante la Windows API:
#Include "windows.bi"
MessageBox (null, "Saluton, mondo!", "Message",
MB_OK)
Objekteman programadon
'Klaso vektoro
Type Vector
W As Integer
H As Integer
Declare Constructor(ByVal nW As Integer, ByVal nH As Integer)
End Type
Constructor Vector(ByVal nW As Integer, ByVal nH As Integer)
W = nW
H = nH
End Constructor
Type AObject
Private:
X As Integer
Y As Integer
Movement As Vector Pointer
Public:
'Ekstere videbla metodoj, inkludante la constructor kaj destrojero
Declare Constructor(ByVal nX As Integer, ByVal nY As Integer)
Declare Destructor()
Declare Sub SetMotion(ByVal Motion As Vector Pointer)
Declare Sub Move()
Declare Property GetX As Integer
End Type
'Ŝanĝu al Defaŭlta
Constructor AObject(ByVal nX as Integer, ByVal nY as Integer)
X = nX
Y = nY
End Constructor
'memoro pureco
Destructor AObject()
delete Movement
End Destructor
'Instalado vektoro
Sub AObject.SetMotion(ByVal Motion As Vector Pointer)
Movement = Motion
End Sub
'Movas la objekto kune la vektoro
Sub AObject.Move()
X += Movement->W
Y += Movement->H
End Sub
'Redonas X, nealirebla de ekstere
Property AObject.GetX As Integer
Return X
End Property
Dim Player As AObject = Type<AObject>(100, 100)
Player.SetMotion(New Vector(-10, 5))
Player.Move()
Print(Player.GetX)
Sleep
Referencoj
- ↑ Plej gravaj karakterizaĵoj. Arkivita el la originalo je 2011-07-18. Alirita 2014-09-19 .
Eksteraj ligiloj
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.