[Gambas-user] Type of Variables possible?
Kadaitcha Man
nospam.nospam.nospam at ...626...
Tue Dec 29 11:23:21 CET 2009
2009/12/29 Dr. Diesel <dr.diesel at ...626...>:
> On Mon, Dec 28, 2009 at 6:14 AM, Fabien Bodard <gambas.fr at ...626...> wrote:
>
>> use a class ;
>> TDBInfo
>> 'Gambas Class
>>
>> PUBLIC DatabasePath As String
>> PUBLIC DatabaseName As String
>> PUBLIC TableName As String
>> PUBLIC PurgeSQL As String
>> PUBLIC PurgeSQL2 As String
>>
>>
>> then :
>>
>> Public DatabaseInfo As DBinfo[NUM_MAX_DB]
>>
>>
> Thank you! I can get this to work, just there seems no way to make it
> global and accessable across different modules/classes.
So pass the object around. That's what instantiated objects are for, hey.
Dim oSomeObject as New cSomeClass
Dim sR as String
oSomeObject.ObscureProperty = 10
oSomeObject.AnotherObscureProperty = "Some Value"
sR = mSomeObscureModule.SomeObscureMethod(oSomeObject)
If sR = WhatIexpected then
ThrowParty
Else
Sulk
EndIf
>> Looking to do something like this from VB6
Gambas is nothing like VB. I struggled with gambas for two months,
caught between it and many years of MS experience, from VB2 to .NET
2007. Perseverance and determination will pay off with great rewards,
but be prepared for heartache.
That, btw, is not any criticism of Gambas. It is more a reflection of
the truism that one's learning ability reduces with age :)
See...?
Class cLogRecord:
' Gambas class file
Public LogDate As Float
Public Subject As String
Public Post As String
Public Status As String
Public LogFrom As String
Public LogTo As String
------------------------------------------------------
Class cProxy:
' Gambas class file
' ***************************************************************************
' * cProxy
' * Manages the data between the client and the server
' ***************************************************************************
Private oLog As cLogRecord ' A log record
[...]
Private Sub SomeMethod()
oLog.Status = Buffer
mSystemDataManager.AddLog(oLog)
End
More information about the User
mailing list