Page 1 of 1

sizeOf (Struct, Variable, Interface)

Posted: Wed Jun 15, 2005 3:43 pm
by benny
In the german forum we discussed the following problem:

Code: Select all

Structure TestStruc
  a.l
  b.w
  c.b
EndStructure

test.TestStruc
Debug SizeOf(TestStruc)
Debug SizeOf(test)

TestStruc.POINT
Debug SizeOf(TestStruc)
As you can see, the last sizeOf command returns the size of the
structure TestStruc and not of the Variable TestStruc.POINT.

In C for example, you use something like these to distinguish between the
name of a structure and the name of a variable:

sizeOf (struct TestStruc) ; returns the size of the structure
sizeOf (TestStruc) ; returns the size of the variable TestStruc (.point)

So, it would be cool if there would be a syntax like the following suggested
by MVXA:
sizeof(TestStruc)
sizeof(TestStruc, #PB_Variable)
sizeof(TestStruc, #PB_Structure)
sizeof(TestStruc, #PB_Interface)
Allowing sizeOf with no parameter guarantees compatibility to
old code.

Posted: Wed Jun 15, 2005 7:03 pm
by Psychophanta
Look:
viewtopic.php?t=8262
There karbon had the idea, i repeated it, and Fred said it was good.
What happened with that, Fred :?:

Posted: Wed Jun 15, 2005 7:33 pm
by benny
@Psychophanta:

Thanks for the link and sorry for the double posting.



@Fred:

Take your time. This isn't very urgent IMHO. But maybe you could think about
adding this on your to-do-list ;-)

sizeOf (Struct, Variable, Interface)

Posted: Wed Jun 15, 2005 11:17 pm
by fsw
benny wrote:@Psychophanta:
Thanks for the link and sorry for the double posting.
You don't have to be sorry for the double posting - the link is from 2003 :shock:
benny wrote: @Fred:
Take your time. This isn't very urgent IMHO.
But maybe you could think about adding this on your to-do-list ;-)
What about that?

Code: Select all

ToDoList = (NewFunctions + BugFixes) - SizeOf(TakeYourTimeFred)
:lol:

Re: sizeOf (Struct, Variable, Interface)

Posted: Thu Jun 16, 2005 12:18 pm
by benny
fsw wrote: What about that?

Code: Select all

ToDoList = (NewFunctions + BugFixes) - SizeOf(TakeYourTimeFred)
:lol:
:lol: I just wanted to do a reverse psychological trick. Everyone demands
bugfixed and new functions as soon as possible from Fred. I tried it the other
way around by saying "Take your time, Fred".

Well ... it was just a try - will see if it works ;-)