Page 2 of 2

Posted: Thu Apr 13, 2006 2:51 pm
by SFSxOI
Very nice :)

How and when would you use the CHAR structure? I've seen the CHAR used in C++ code, is this the same thing?

Posted: Thu Apr 13, 2006 3:00 pm
by helpy
Hi technicorn,
technicorn wrote:

Code: Select all

Structure ADDRARRAY
  a.l[0]  ; We might get quad memory addresses with PB5 ?! ;)
EndStructure
If I change this code to:

Code: Select all

Structure ADDRARRAY
  *a[0]
EndStructure
... wouldn't a pointer be dependent on the compiler version? So if there will be a 64bit version of the compiler this would be "automatically" in the appropriate size.

Posted: Mon Aug 21, 2006 3:51 pm
by fsw
Right after the Ubound macro was published I put it to good use into a RES file.

Last weekend I searched for a bug in LCP that only occured on translating a lot of class definitions in one project.
After changing the Ubound value with a fixed integer the bug disappeared.

Don't know if it's the macro itself or how the PureBasic compiler acts after the extensive use of a macro.

Is this the reason why there is no official UBound in the PureBasic language :?:

:evil:

Re: Some usefull? Macros

Posted: Mon Aug 21, 2006 3:54 pm
by fsw
fsw wrote:
technicorn wrote:

Code: Select all

Macro Ubound(array)
  (PeekL(@array - 8) - 1)
EndMacro
Can somebody from the PB dev team tell me if this is the right approach and will it always work?
And if this command will be native in the future.
Never got a straight answer.
Now would be a good time.

Posted: Mon Aug 21, 2006 4:06 pm
by Dr. Dri
same kind of topic on the french forum
http://purebasic.hmt-forum.com/viewtopic.php?t=4667

Dri