Page 1 of 1

PB 5.10/5.11 Variable Types

Posted: Sat Mar 23, 2013 10:20 am
by niijel
Here are my suggestions of additions to the help files for PB 5.11. :idea:
Please don't flame me for this: I am trying to help those new
to PB who are confused by this omission in the help.
(I know its all revealed in the structure browser but that's
not where a new user would look for help...)

Please add the following section to Variables topic in help.
--------------------------------------------------------------------

Predefined structures relating To variable types.

For example:

axx.l=3
byy.long\l=3

Debug axx
Debug byy\l

There is a built in definition of the structure:-

Structure Long
l.l
EndStructure


cxx.i=5
dyy.integer\i=5

Debug cxx
Debug dyy\i

There is a built in definition of the structure:-

Structure Integer
i.i
EndStructure

Other similar definitions are:-

.Ascii
.Byte
.Character
.Double
.Float
.Quad
.String
.Unicode
.Word

The above are useful when wishing to use pointers to simple variables
because pointers hold the addresses of STRUCTURES, not the address of variables!

Please Add the below to the pointers topic in help.
------------------------------------------------------------------------------------------------------------

Native variables and pointers.

For example:

kk.i=7
*cc.i = @kk

The above will give an error 'native types cant be used with pointers'
because *cc is a pointer and holds an address (32 bit Or 64 bit as appropriate)
of a structure, it DOES NOT have a type and cannot point at a native variable.


dd.i= 7
*jj.integer = @dd
Debug *jj\i

The above is error free as *jj.integer is a pointer to the predefined structure .Integer

NOTE: Some include files may need updating to function with 5.10/5.11 because of the above.
:idea:

Re: PB 5.10/5.11 Variable Types

Posted: Sat Mar 23, 2013 12:10 pm
by Little John
Suggestions for improvement of the documentation are fine, but this subforum ("Coding questions") is not a good place for them. Better post them in the appropriate thread:
PureBasic Docs - Errors & needed improvements to the man

Re: PB 5.10/5.11 Variable Types

Posted: Mon Mar 25, 2013 10:03 am
by niijel
I agree but that thread is currently locked.

Re: PB 5.10/5.11 Variable Types

Posted: Mon Mar 25, 2013 10:38 am
by Demivec
niijel wrote:I agree but that thread is currently locked.
That is because a whole sub-forum for bugs in the documentation was created. If you are reporting bugs or corrections to the documentation you post a message in that forum.

Re: PB 5.10/5.11 Variable Types

Posted: Mon Mar 25, 2013 3:02 pm
by Little John
niijel wrote:I agree but that thread is currently locked.
Ooops. Sorry, I didn't see that.
Demivec wrote:That is because a whole sub-forum for bugs in the documentation was created. If you are reporting bugs or corrections to the documentation you post a message in that forum.
I didn't suggest that because I took the title of the subforum "Bugs - Documentation" literally, and so I thought that suggestions for improvement still should be posted to that old thread.