Page 6 of 15

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

Posted: Wed Feb 10, 2010 11:12 pm
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... :)

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

Posted: Wed Feb 10, 2010 11:14 pm
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!

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

Posted: Wed Feb 10, 2010 11:28 pm
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.

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

Posted: Wed Feb 10, 2010 11:39 pm
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....

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

Posted: Thu Feb 11, 2010 12:40 am
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

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

Posted: Sun Feb 14, 2010 4:39 pm
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.

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

Posted: Sun Feb 14, 2010 4:45 pm
by Fred
It's added.

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

Posted: Sun Feb 14, 2010 4:57 pm
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

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

Posted: Mon Feb 15, 2010 8:59 pm
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" ?

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

Posted: Tue Feb 23, 2010 11:12 am
by Rings
Intellisent for CreateCamera Command is wrong,
its 'percent' instead of french 'pourcents'

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

Posted: Sat Feb 27, 2010 4:33 pm
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()

Posted: Wed Mar 03, 2010 5:39 pm
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.

OpenScreen()

Posted: Sat Mar 13, 2010 11:43 am
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...

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

Posted: Thu Mar 18, 2010 8:52 pm
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

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

Posted: Sun Mar 21, 2010 6:30 pm
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.