PureBasic Docs - Errors & needed improvements to the man

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

Moderator: Documentation Editors

User avatar
Demivec
Addict
Addict
Posts: 4082
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

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

Post by Demivec »

The entry for procedures and their return values should document that if a procedure doesn't include a 'ProcedureReturn' the return value defaults to zero.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

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

Post by IdeasVacuum »

The ScrollBarGadget() code example does not scroll anything, which is rather unhelpful
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Demivec
Addict
Addict
Posts: 4082
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

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

Post by Demivec »

The CopyMemoryString() should be updated to describe the need to allow space for the #Null at the end of a string to written to the buffer also, even though the pointer that will be updated by CopyMemoryString() will correct the pointer to overwrite that #Null on subsequent use (thus leaving only the #Null from the most immediate use). This will mean that the pointer points to the ending #Null after each use.


The current CopyMemoryString() documentation states nothing about copying the #Null. Neither does it demonstrate this with the example provided in the manual.

Here's the example for reference:

Code: Select all

*Buffer = AllocateMemory(1000)
*Pointer = *Buffer
CopyMemoryString("Hello", @*Pointer)
CopyMemoryString(" World")  ; This one will be put just after "Hello"
*Pointer-2                  ; Come back from 2 characters (on the 'l' of 'World')
CopyMemoryString("LD")      ; Finally the last letter will be uppercase
Debug PeekS(*Buffer)
CopyMemoryString() must 'apparently' be copying the #Null at the end of the string and then adjusting the value of the pointer by 1 so that the next string copied will be placed over the #Null that was previously copied. This behavior of the CopyMemoryString() should be documented so that the special case of a precisely sized buffer can be properly dealt with.
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

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

Post by moogle »

I don't know if this has been said before (I see some functions but not all) but for deprecated functions could they be left in the helpfile but have the same red writing saying it's deprecated with a hyperlink to the replacement function.

It would speed up searching for help on editing code from older PB versions.
Image
rudd68
User
User
Posts: 29
Joined: Wed Jun 09, 2010 2:55 pm

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

Post by rudd68 »

This code works fine for the increment of a large number as string:

Code: Select all

Structure char
   c.c[0]
EndStructure

Procedure.s Inkrementieren(Zahl.s)
   Protected *char.char = @Zahl
   Protected Pos.i = Len(Zahl) - 1
   While Pos >= 0
      If *char\c[Pos] = '9'
         *char\c[Pos] = '0'
      Else
         *char\c[Pos] + 1
         ProcedureReturn Zahl
      EndIf
      Pos - 1
   Wend
   ProcedureReturn "1" + Zahl
EndProcedure

Define Zahl.s
Define i.i

For i = 1 To 20
   Zahl = Inkrementieren(Zahl)
   Debug Zahl   
Next 
Please insert in the documentation the static array dimensioning with zero [0] and give the note that there is no index overflow.

The apostrophes are only written in the "Strings - Asc" section. But the apostrophes converts a constant char to the ascii value, its appearance resembles an operator more than a function. Apostrophes should also be mentioned in the "Operators" section.

Apostrophes are a valid notation. They should also be mentioned in the "Syntax" section.

Thank you.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

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

Post by gnozal »

Ordering topic in Purebasic.chm :

"... you get the three versions of PureBasic (Amiga, Linux and Windows) for the same price..."

should be replaced with

"... you get the four versions of PureBasic (Amiga, Linux Windows and MacOS X) for the same price..."
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

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

Post by c4s »

@gnozal
No it should be:
[...] you get the three versions of PureBasic (Linux, Windows and MacOS X) for the same price.
...because the Amiga version is Open Source and discontinued!
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
rudd68
User
User
Posts: 29
Joined: Wed Jun 09, 2010 2:55 pm

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

Post by rudd68 »

User avatar
skywalk
Addict
Addict
Posts: 3960
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post by skywalk »

Code: Select all

; FROM:
    LoadSprite(0, "Data/PureBasicLogo.bmp")
; TO:
    LoadSprite(0, #PB_Compiler_Home+"Examples\Sources\Data\PureBasicLogo.bmp")
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Demivec
Addict
Addict
Posts: 4082
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

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

Post by Demivec »

I hope I'm not jumping the gun on this. These changes may have been planned but not yet implemented.

Some updating of the docs is needed relating to the Gadget library and regarding the new CanvasGadget in v4.60RC1, in case it was overlooked. :wink:

Links needed to be added linking to the CanvasGadget entry from the entries for GetGadgetAttribute(), SetGadgetAttribute(), and GadgetToolTip().
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2050
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 »

nco2k wrote:http://www.purebasic.com/documentation/ ... depth.html

Code: Select all

PB_Image_InternalDepth -> #PB_Image_InternalDepth
PB_Image_OriginalDepth -> #PB_Image_OriginalDepth
Fixed. :)

Other topics I will add to my first post, which need to be reviewed by Fred & freak :twisted:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2050
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 »

Trond wrote:Linux 4.51:
On the page for FrontColor() there is a link to the color table, but nothing happen when you click it.
It's linked the same way, than other commands (BackColor()....) and all is working on Windows/MacOS (my used systems).

Could you please check again?
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2050
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 »

Demivec wrote:....cipher library the function AESEncoder() and AESDecoder() ...

The return type is incorrectly shown as being a string but it is actually the length in bytes of the string placed in the output buffer. The documentation for each of the two functions does not specify anything about what this return value actually contains or how to interpret it.

Also the return value for AESEncoder() equals zero if the input string was unable to be encoded (due to its length being less than 16 bytes).
The officially and reworked documentation of PB4.60 just says, that the return value is non-zero on success, and zero else.
Nothing more could be relied on, I think.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2050
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 »

While many library descriptions are re-done for PB4.60 documention, there are still a lot suggestions / bug-reports valid and need to be checked / integrated in the docs by Fred & freak.

That's why I have revised the first post in this thread, to have an overview, which can be marked as "Done", when it's done... :mrgreen:
(more postings in this thread need to be revised and integrated in the ToDo list in first posting...)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2050
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 »

"ToDo" list in the first post was updated/extended :-)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Locked