Posted: Tue Nov 15, 2005 3:28 am
WHY IS PEOPLE GETTING SO OFFTOPIC LATELY? IS IT ALL MY FAULT? TELL ME, YOU TELL ME!
http://www.purebasic.com
https://www.purebasic.fr/english/
Tssshh... They are deeply bored waiting for 4.0dagcrack wrote:WHY IS PEOPLE GETTING SO OFFTOPIC LATELY? IS IT ALL MY FAULT? TELL ME, YOU TELL ME!
Code: Select all
; build some classes...
Class MyClass1
attribute1.l ;properties should always be private, access only inside the class
Method setAttribute1(value.l)
*this\attribute1 = value ; \ for accessing properties, like normal structures
EndMethod
Method.l getAttribute1()
MethodReturn *this\attribute1
EndMethod
EndClass
Class MyClass2 Extends MyClass1
attribute2.l
Method setAttribute2(value.l)
*this\attribute2 = value
EndMethod
Method.l getAttribute2()
MethodReturn *this\attribute2
EndMethod
EndClass
; here starts the main code...
NewObject *obj.MyClass2
*obj->setAttribute1(1) ; -> for accessing methods
*obj->setAttribute2(2)
Debug Str(*obj->getAttribute1()) + " / " + Str(*obj->getAttribute2())
*obj->destruct() ; actually the destructor could be called automatically when app ends
End
Code: Select all
var.b ; 8 bits int
var.w ; 16 bits int
var.l ; 32 bits int
var.q ; 64 bits int
var.ub ; 8 bits unsigned int
var.uw ; 16 bits unsigned int
var.ul ; 32 bits unsigned int
var.uq ; 64 bits unsigned int
var.f ; 32 bits float
var.d ; 64 bits float
var.ld ; 80 bit float (long double) <--- for the huge scientific applications ;)
var.s ; ansi string / character (maybe var.c !?)
var.u ; unicode string / character
Code: Select all
; build some classes...
Structure MyClass1
attribute1.l ;properties should always be private, access only inside the class
Procedure setAttribute1(value.l)
*this\attribute1 = value ; \ for accessing properties, like normal structures
EndProcedure
Procedure.l getAttribute1()
ProcedureReturn *this\attribute1
EndProcedure
EndStructure
Structure MyClass2 Extends MyClass1
attribute2.l
Procedure setAttribute2(value.l)
*this\attribute2 = value
EndProcedure
Procedure.l getAttribute2()
ProcedureReturn *this\attribute2
EndProcedure
EndStructure
; here starts the main code...
obj.MyClass2
obj\setAttribute1(1) ; -> for accessing methods
obj\setAttribute2(2)
Debug Str(obj\getAttribute1()) + " / " + Str(obj\getAttribute2())
End
This was already promised to be in version 4.0, via recent interview. Look at the interview thread found @ viewtopic.php?t=17324&highlight=interview and my reply. There is to be crossplatform compiling in 4.0. As stated in the interview, it's already there ... but unfortunately, it's not enabled for us users yet.DarkDragon wrote:Crosscompiling: Compiling Linux executables on Windows(so I just need to run my emulator when I wanna try it out).
Code: Select all
Procedure MyListener(ConnectionId.l)
Protected End.l
Repeat
Select Dataavailable(ConnectionID.l)
Case 2
;Receive it
Case 0
delay(1)
Case 4
End.l=1
;Kill this Thread
Endselect
Until End.l=1
Endprocedure
InitNetwork()
Id.l=StartServer(#PB_Any,Port.l)
NetEvent.l=NetworkServerEvent(Id.l) ; We want to be able to use more than one server a time
Select NetEvent.l
Case 0
Delay(1)
Case 1
Creathread(MyListener(),NetworkclientID()
EndSelect
akee wrote:Code: Select all
var.b ; 8 bits int var.w ; 16 bits int var.l ; 32 bits int var.q ; 64 bits int var.ub ; 8 bits unsigned int var.uw ; 16 bits unsigned int var.ul ; 32 bits unsigned int var.uq ; 64 bits unsigned int var.f ; 32 bits float var.d ; 64 bits float var.ld ; 80 bit float (long double) <--- for the huge scientific applications ;) var.s ; ansi string / character (maybe var.c !?) var.u ; unicode string / character
Code: Select all
OpenScreen(lWidth, lHeight, lDepth, cTitle$, [#Flags])
Possible Flags:
#PB_DoubleBuffering
#PB_TribleBuffering
#PB_AlphaBlending
#PB_CopyBuffer
#PB_AntiAliasing
#PB_AntiAliasing2
#PB_AntiAliasing3
#PB_AntiAliasing4
#PB_Software
Code: Select all
SpriteColorFilter(#Sprite,RGBA($00,$00,$FF,$FF)) ; for example... This would be very very helpfull for a lot of cheating stuff...