[Gambas-user] Exposing Properties of a class..

sbungay sbungay at ...981...
Sun Jul 30 15:20:05 CEST 2006


   Hello ROn!
     Here is the actual code. The error message I am getting @ compile 
time is;

"A property function can not be public at line 56 in class 
"ClassUnixDateFunctions.class".

   It appears that everything is correct.. a few hundred more eyes 
looking it over is always helpful. :)


PROPERTY UnixTimeStamp AS Integer
PROPERTY READ MonthNumber AS Integer
PROPERTY READ MonthName AS String
PROPERTY READ DayOfMonth AS Integer
PROPERTY READ Year AS Integer
PROPERTY READ JulianDate AS Integer

PRIVATE mUnixTimeStamp AS Integer
PRIVATE mMonthNumber AS Integer
PRIVATE mMonthName AS String
PRIVATE mDayOfMOnth AS Integer
PRIVATE mYear AS Integer
PRIVATE mJulianDate AS Integer

CONST cSecondsInADay AS Integer = 86400
CONST cDaysInAYear AS Float = 365.25

CONST cJan AS Integer = 1
CONST cFeb AS Integer = 2
CONST cMar AS Integer = 3
CONST cApr AS Integer = 4
CONST cMay AS Integer = 5
CONST cJun AS Integer = 6
CONST cJul AS Integer = 7
CONST cAug AS Integer = 8
CONST cSep AS Integer = 9
CONST cOct AS Integer = 10
CONST cNov AS Integer = 11
CONST cDecember AS Integer = 12

CONST cJanDays AS Integer = 31
CONST cFebDays AS Integer = 28
CONST cMarDays AS Integer = 31
CONST cAprDays AS Integer = 30
CONST cMayDays AS Integer = 31
CONST cJunDays AS Integer = 30
CONST cJulDays AS Integer = 31
CONST cAugDays AS Integer = 31
CONST cSepDays AS Integer = 30
CONST cOctDays AS Integer = 31
CONST cNovDays AS Integer = 30
CONST cDecDays AS Integer = 31

' Only need one property to be set to set things in action.
PUBLIC SUB UnixTimeStamp_Write(Value AS Integer)
   mUnixTimeStamp = Value
   mYear = TimeStampToYear(Value)
   mJulianDate = TimeStampToJulianDay(Value)
   mDayOfMOnth = JulianDateTOMonthDay(mJulianDate)
   mMonthNumber = JulianDateToMonthNumber(mJulianDate)
   mMonthName = MonthNumberToMonthName(mMonthNumber)
END

PUBLIC FUNCTION UnixTimeStamp_Read() AS Integer
   RETURN (mUnixTimeStamp)
END

PUBLIC FUNCTION Year_Read() AS Integer
   RETURN (mYear)
END

PUBLIC FUNCTION JulianDate_Read() AS Integer
   RETURN (mJulianDate)
END

PUBLIC FUNCTION DayOfMonth_Read() AS Integer
   RETURN (mDayOfMonth)
END

PUBLIC FUNCTION MonthNumber_Read() AS Integer
   RETURN (mMonthNumber)
END

PUBLIC FUNCTION MonthName_Read() AS String
   RETURN (mMonthName)
END

------------- SNIP --------------------

Ron Onstenk wrote:
> On Sunday 30 July 2006 07:37, sbungay wrote:
> 
> 
>>PROPERTY ExposedProperty AS INTEGER ' need Let & Get
>>PROPERTY READ Result AS INTEGER ' need only Get
>>
>>PRIVATE mValue as INTEGER.
>>PRIVATE mResult as INTEGER
> 
> 
>   PUBLIC Function ExposedProperty_Read() AS INTEGER ' the VB get
>     return mValue
>   end
> 
>>PUBLIC SUB ExposedProperty_Write(Value AS INTEGER) ' the VB Let
>>    mValue = Value
>>    mResult = Process(mValue)
>>END
>>
>>PUBLIC Function Result_Read() AS Integer
>>    RETURN (mResult)
>>END
>>
>>PRIVATE FUNCTION Process(Value AS INTEGER) AS INTEGER
>>   RETURN (Value * 2)
>>END
> 
> 
> Ron
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 




More information about the User mailing list