Page 2 of 2

Posted: Mon Jul 26, 2004 7:07 pm
by blueznl
helpy:

viewtopic.php?t=10835&highlight=typeof
viewtopic.php?t=9691&highlight=typeof

i needed it for some 'structure' stuff where my routine would have to deduct what type a field of a structure was, somewhat superfluous but sometimes handy...

however, when using dynamic parameters (or variants or overloading or what the heck) in procedure calls it's an essential...

Posted: Mon Jul 26, 2004 7:10 pm
by helpy
Dare2 wrote:Imagine if we could pass unknown (to the function) arithmetic types as arguments, have the function do a typeOf() and then take appropriate action.

Then we could have doSomething(v) instead of multiple functions like doSomethingLong(v.l), doSomethingFloat(v.f), etc.
This means, that the passing of arguments hast to be changed! Otherwise a typeof() would not make any sense.

At this time in PureBasic each variable has a fixed datatype! ... and it is not possible to change the type of a variable during runtime.

So it makes only sense to "wisch a typeof()" if at the same time you wish the "change of passing function arguments" or "a new datatype like VARIANT".

I am not sure, if I would be happy with VARIANT data type, because it needs much overhead managing the memory and data type conflicts. This would be the source of many ... many ... many new bugs in PureBasic.

cu, helpy