PureBasic Docs - Errors & needed improvements to the man

Found an issue in the documentation ? Please report it here !

Moderator: Documentation Editors

User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: PureBasic Docs - Errors & needed improvements to the man

Post by Andre »

Psychophanta wrote:In the Hex() for example manual wrote:
'Type' can be:
#PB_Byte : The value is a byte number, ranging from 0 to 255
#PB_Ascii : The value is a ascii character, ranging from 0 to 255
#PB_Word : The value is a word number, ranging from 0 to 65536
#PB_Unicode: The value is a unicode character, ranging from 0 to 65536
#PB_Long : The value is a long number, ranging from 0 to 4294967296
#PB_Quad : The value is a quad number, ranging from 0 to 18446744073709551615
and should be:
'Type' can be:
#PB_Byte : The value is a byte number, ranging from 0 to 255
#PB_Ascii : The value is a ascii character, ranging from 0 to 255
#PB_Word : The value is a word number, ranging from 0 to 65535
#PB_Unicode: The value is a unicode character, ranging from 0 to 65535
#PB_Long : The value is a long number, ranging from 0 to 4294967295
#PB_Quad : The value is a quad number, ranging from 0 to 18446744073709551615
or still better imo:
'Type' can be:
#PB_Byte : The value is a byte number, ranging from 0 to $FF
#PB_Ascii : The value is a ascii character, ranging from 0 to $FF
#PB_Word : The value is a word number, ranging from 0 to $FFFF
#PB_Unicode: The value is a unicode character, ranging from 0 to $FFFF
#PB_Long : The value is a long number, ranging from 0 to $FFFFFFFF
#PB_Quad : The value is a quad number, ranging from 0 to $FFFFFFFFFFFFFFFF
I tried today following code:

Code: Select all

Debug $FF                 ; will give 255
Debug $FFFF               ; will give 65535
Debug $FFFFFFFF           ; will give 4294967295
Debug $FFFFFFFFFFFFFFFF   ; will give -1
Is the last one right?
Can anyone also proof the other decimal values?

When all this things are clear, I will add the (corrected!?) decimal values + additional the hexadecimal values to the help... :)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: PureBasic Docs - Errors & needed improvements to the man

Post by Andre »

Captn. Jinguji wrote:Hi Andre.
It is only a minor thing, you decide whether it is worthwhile adding a hint to the docs:
Plz view this thread Compiler options and Create Executable
blueznl wrote:The Survival Guide contains some stuff on type casting and expression evaluation and migth be converted to a more official document, however the rules once sanctioned seem to be still a little broken, or I simply do not understand the new rules... Yet, it may provide a starting point, and the PB team is free to use them.
Comtois wrote:About LoadTexture() i can read this in the doc :
Texture format can be in PNG, TGA or JPG.
In Ogre.log i can read this
Supported formats: bmp,ico,jpg,jif,jpeg,jpe,koa,iff,lbm,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,dds,gif,g3,sgi,j2k,j2c,jp2
I tested different formats (bmp, gif, png, jpg, ico), they work very well, but does that all the formats mentioned above also work with PureBasic ?

The doc should be updated according to the formats supported.

All suggestions added to the 'ToDo' list in first post, so Fred / Timo can check and correct the manual if needed.

Have revised the 'ToDo' list today - see first post in this thread!
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: PureBasic Docs - Errors & needed improvements to the man

Post by Andre »

Kaeru Gaman wrote:suggested improvement:
a little example to ResizeGadget() could show how a Gadget is moved, then it could be found with searching the Help for "move gadget"...
parallel to "windows.pb" that shows ResizeWindow and can be found via "move window".
Added a example line of code + additional comment about moving the gadget... :D
Kaeru Gaman wrote: Help \ WindowedScreen \ Example 2
http://www.purebasic.com/documentation/ ... creen.html

Code: Select all

; we don't need exact screen width/height, because it will be automatically stretched...
this is wrong!
it's about a dozen times know I answer this question to beginners, I wrote about a dozen times in the forums that the example is wrong.

....

in the german Help for 4.40 the coordinates are corrected to 320x200, but the misleading comment is still in it.
Misleading comment removed.
luis wrote:http://www.purebasic.com/documentation/ ... chive.html
(e.g. texture, mesh, sky, @link""RenderWorld" "world")
tag link malformed
Fixed.
luis wrote:In the GOTO help

"To exit a loop savely" should be "safely" I presume.


maybe it would be nice to write in the help it's not safe to exit a select case using a GOTO.
...
this is suggesting to me the select-case is using the stack, so a jump out of it would leave the stack unbalanced.
...
In that case better to resort to if-elseif-endif if one really want to use a goto for some reason.
Fixed the spelling error.
The other suggestion about the needed 'Note' I've set on ToDo list, so Fred / Timo can check.
luis wrote:OnErrorGoto
http://www.purebasic.com/documentation/ ... rgoto.html
It is also not save to continue
save -> safe
Fixed.
luis wrote:ArraySize()
@arraysizereturns -1, if the array couldn't be declared (out of memory...).
Should be "ArraySize() returns -1, ..."
Fixed.
GG wrote:Sorry if this error is already mentioned, but for DatabaseUpdate() in chm help file (databaseupdate.html) , the example doesn't mention 2 param, only one (the db handler is ommitted).
.... corrected as :
DatabaseUpdate(#database,"UPDATE employee SET checked=1 WHERE id="+GetDatabaseString(#Database, 0))
This error shouldn't be existing anymore, at least with PB4.41 docs. Could you check?
Little John wrote:In PB 4.41 RC 1, in the help for WaitWindowEvent(), it reads in the example:

Code: Select all

    Case 3 : Debug "Button 3 clicked!"
Removed this misleading line from example code.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: PureBasic Docs - Errors & needed improvements to the man

Post by Kaeru Gaman »

Andre wrote:Is the last one right?
yes it is, because PB only knows signed variables.
since there is no bigger container (yet), PB can only debug Quads.
any smaller value can be displayed seemingly unsigned, because it displays the Quad-Container.
Andre wrote:Added a example line of code + additional comment about moving the gadget... :D
glad I was able to help. :D
Andre wrote:Misleading comment removed.
thanx. sorry I wasn't ready to provide other examples yet....
oh... and have a nice day.
User avatar
Demivec
Addict
Addict
Posts: 4086
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: PureBasic Docs - Errors & needed improvements to the man

Post by Demivec »

Kaeru Gaman wrote:
Andre wrote:Is the last one right?
yes it is, because PB only knows signed variables.
since there is no bigger container (yet), PB can only debug Quads.
any smaller value can be displayed seemingly unsigned, because it displays the Quad-Container.
Another way to verify value range for Hex numbers:

Code: Select all

Debug StrU($FFFFFFFFFFFFFFFF) ; =18446744073709551615
User avatar
Demivec
Addict
Addict
Posts: 4086
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: PureBasic Docs - Errors & needed improvements to the man

Post by Demivec »

In the manual under the topic of "Variables, Types and Operators" it lists the operator priorities.

Missing from this list is the priority of the sign operator "-". An old bug report refers to it here.
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PureBasic Docs - Errors & needed improvements to the man

Post by Fred »

It's added.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PureBasic Docs - Errors & needed improvements to the man

Post by skywalk »

Hi,
Please add OS specific functions...
Some undocumented Windows Only examples:
EventwParam()
EventlParam()
If they are to be deprecated, then say that in the manual!
Example code is for teaching, and some forum code contains these functions.
Are there more?

Thanks,
Steve
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: PureBasic Docs - Errors & needed improvements to the man

Post by luis »

AddMapElement()
Note: This function isn't mandatory when dealing with maps, as elements are automatically added when affecting a value to them
Affecting ? Maybe should be "assigning" ? Or "storing a value into them" ?


Maps - Overview
You can add as many elements as you want (or as many as will fit into the memory of your computer), and accessing it back using a key.
Maybe "access them back" ?
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Rings
Moderator
Moderator
Posts: 1427
Joined: Sat Apr 26, 2003 1:11 am

Re: PureBasic Docs - Errors & needed improvements to the man

Post by Rings »

Intellisent for CreateCamera Command is wrong,
its 'percent' instead of french 'pourcents'
SPAMINATOR NR.1
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PureBasic Docs - Errors & needed improvements to the man

Post by eddy »

Point
Note : this command will return a 32bit RGBA value only if the one of following drawing modes is enabled :
#PB_2DDrawing_AlphaClip
#PB_2DDrawing_AlphaChannel
#PB_2DDrawing_AlphaBlend

Code: Select all

If CreateImage(0, 200, 200, 32)
   StartDrawing(ImageOutput(0))
      DrawingMode(#PB_2DDrawing_AlphaChannel)
      Box(0, 0, 200, 200, 0)
      DrawingMode(#PB_2DDrawing_AlphaBlend)
      Box(0, 0, 200, 200, RGBA($FF, $EE, $DD, $20))
   StopDrawing()
EndIf

StartDrawing(ImageOutput(0))
   ;return 24 bits value
   Debug Hex(Point(1, 1))
   
   ;return 32 bits value
   DrawingMode(#PB_2DDrawing_AlphaBlend)
   Debug Hex(Point(1, 1))
StopDrawing()
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

ATAN - Context
Statusbar-Help wrote:ATan(Angle) Returns the Arc-Tangent of the specified angle, in radian.
this is wrong. not the Parameter is an Angle, but the Result is.
ATan() Help Doc wrote:Returns the arc-tangent of the specified value. Value.f can be any value, the result will be in radians.
better, since not wrong, yet not perfect.

the Arcus-Tangens returns the Angle to a given Tangens.
It's the inverse function of tangens.

the tangens is the quotient of cathetus and anticathetus (opposite leg).
the arcustangens is the angle of this corner.
oh... and have a nice day.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

OpenScreen()

Post by Kaeru Gaman »

OpenScreen()
http://www.purebasic.com/documentation/ ... creen.html
Width and Height should be standard combinations: 640*480, 800*600, 1024*768...
not quite correct. maybe better:
Width and Height have to make up a supported resolution. The combination of Width, Height, Depth and RefreshRate is called a ScreenMode.
The ScreenModes the Hardware supports can be found out using ->ExamineScreenModes().
... or something like that. English is not my native language...
oh... and have a nice day.
User avatar
einander
Enthusiast
Enthusiast
Posts: 744
Joined: Thu Jun 26, 2003 2:09 am
Location: Spain (Galicia)

Re: PureBasic Docs - Errors & needed improvements to the man

Post by einander »

Hi Andre:
Sprite3D
http://www.purebasic.com/documentation/ ... 3D.pb.html
the line

Code: Select all

  LoadSprite(0, "Data/Geebee2.bmp", #PB_Sprite_Texture)
should be replaced for

Code: Select all

   LoadSprite(0, #PB_Compiler_Home+"\Examples\Sources\Data\GeeBee2.bmp", #PB_Sprite_Texture)
Cheers
rudz
User
User
Posts: 35
Joined: Sun Mar 21, 2010 6:59 am
Location: Denmark
Contact:

Re: PureBasic Docs - Errors & needed improvements to the man

Post by rudz »

Pressing F1 over UseFLACSoundDecoder() in PB IDE gives (in both x86 & x64):
This program cannot display the webpage
However, the help entry can be manualy selected in the help file.
AMD FX-8350 @ ~4.8GHz | 8GB Corsair DDR3-SDRAM @ 1800Mhz | 7even Ult & Manjaro 0.8.7.1 | PB 5.3
Web: rudz.dk
Locked