[Gambas-user] Issue 176 in gambas: problems with SizeOf()

tommyline at ...2340... tommyline at ...2340...
Thu Dec 29 19:00:45 CET 2011



----- Original Message -----
From: "tobias" <tobiasboe1 at ...20...>
To: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
Sent: Thursday, 29 December, 2011 5:52:36 PM
Subject: Re: [Gambas-user] Issue 176 in gambas: problems with SizeOf()

On 29.12.2011 18:41, tommyline at ...2340... wrote:
>
> ----- Original Message -----
> From: gambas at ...2524...
> To: gambas-user at lists.sourceforge.net
> Sent: Thursday, 29 December, 2011 5:32:14 PM
> Subject: Re: [Gambas-user] Issue 176 in gambas: problems with SizeOf()
>
>
> Comment #1 on issue 176 by benoit.m... at ...626...: problems with SizeOf()
> http://code.google.com/p/gambas/issues/detail?id=176
>
> Have you read the documentation of SizeOf?
>
> Yes, it says that
>
> "Size = SizeOf ( Datatype ) - Returns the memory used for storing a specific datatype." and "Datatype can be any of the listed. So I assume that I can do with a as integer ->  a=SizeOf(f as float) or a=SizeOf(s as string), and "a" should return the length of the datatype in bytes. Or am I wrong?
>
> Regards
> Tomek.
>

yes, you are. there are integer constants for those datatypes...
so SizeOf(gb.Float) will return the desired value.
the list lines up there?


Thanks, I got it now, but in that case is there a way to check the size of the object or structure? I have to compare the size of two different objects that are function arguments.

Tomek.







More information about the User mailing list