Friday, June 05, 2009

ooBasic Silliness

1. Use of User Defined type

Type a
x as String
End Type

Dim aList() as New a

Sub func1()
Fill up aList()
End Sub

Sub func2(idx%)
Get aList(idx)
End Sub

Call func1() then func2() [I call from another module]
aList is mysteriously emptied.

The above only work when aList is dim without specifying the type.

2. Control object
Populate the textbox, listbox, formattedfield and datetimefield control with value from database.
Switch to another sheet.
Switch back to the control sheet. Somehow the value in formattedfield and datetimefield disappeared, but not the textbox and listbox.
If the value (text) in formattedfield is entered by user, then it will not disappear...

3. Formatting
http://docs.sun.com/app/docs/doc/819-0439/6n2s7rhvm?l=en&a=view#indexterm-112
http://user.services.openoffice.org/en/forum/viewtopic.php?f=20&t=3069
http://docs.sun.com/app/docs/doc/819-0439/faalo?l=en&a=view

No comments: