[Gambas-user] Unsigned int

Jose J. Rodriguez joe1962 at ...626...
Sat Jul 22 10:07:38 CEST 2006


On 7/20/06, Ron Onstenk <ronstk at ...239...> wrote:
>
> The intention of Benoit is that UDT (User Data Types) should be declared
> as a class file.
>

Type structures are simple to understand for me, but then I still hate
classes and OO, lol.

>
> Pro: I think it is more flexible and better usable as object versus VB

I'll take your word for this.... ;).

> Again: If there are more UDT's will be used with external library calls
> you can get a mass of small (relative useless) files.

Yes, I'm already getting this problem, since I was very used to type
structures in VB6.

>
> To make a visual compact program with less files I support the request
> to have a something like TYPE in gambas too.
>
> I'm dreaming
> this way a hiearchie of the UDT is possible instead of
> spread the files between all the other in alfa sorted way.
>
>
> UDT.class
> public TYPE montype
>   mystring as string[32]
>   mySTaticarray[12] as integer
> end type
>
> public TYPE tutype
>   mystring as string[32]
>   mySTaticarray[12] as integer
> end type
>
> public TYPE multitutype
>   mymulti as tutype[32]
>   mynonmulti as integer
> end type
>
> public sub _new()
>   'the initialize of the data type(s) if need
> end
>
>
> usage:
> dim myUDT as UDT
>   myUDT.montype.mystring="hello world"
>   myUDT.tutype.mystring="Good morning all"
>
>   myUDT.multitutype.mymulti[0]=myUDT.tutype
>   myUDT.multitutype.mynonmulti=1234
>

Yes, this could be one way to  handle it. Another way could be to have
a special class type for type structures that goes inside a parent
class (call this root class UDT if you like) in the project tree. This
has interesting connotations, like having one type class as child of
another because it defines one of the members of the type structure in
the parent class!

Regards,
Joe1962




More information about the User mailing list