PB 5.10/5.11 Variable Types

Just starting out? Need help? Post your questions and find answers here.
User avatar
niijel
User
User
Posts: 24
Joined: Sun Oct 30, 2005 7:55 pm

PB 5.10/5.11 Variable Types

Post 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:
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: PB 5.10/5.11 Variable Types

Post 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
User avatar
niijel
User
User
Posts: 24
Joined: Sun Oct 30, 2005 7:55 pm

Re: PB 5.10/5.11 Variable Types

Post by niijel »

I agree but that thread is currently locked.
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: PB 5.10/5.11 Variable Types

Post 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.
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: PB 5.10/5.11 Variable Types

Post 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.
Post Reply