PureBasic Docs - Errors & needed improvements to the man

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

Moderator: Documentation Editors

Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post by Little John »

nco2k wrote:btw, why isnt there a default (.i like) type for floats? .f on 32bit and .d on 64bit.
Probably because there is only one default type at all. And that's .i, as you wrote.
And what has this got to do with the docs?

Regards, Little John
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

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

Post by nco2k »

but .i aint no float aight? :roll:

wouldnt it be easier to write:

Code: Select all

Var.z
instead of:

Code: Select all

CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
  Var.d
CompilerElse
  Var.f
CompilerEndIf
and yes, its off-topic, thats why i will stop here.

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

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

Post by freak »

> btw, why isnt there a default (.i like) type for floats? .f on 32bit and .d on 64bit. isnt .d 'faster' on 64bit?

No. Both x86 and x64 have the same floating point unit, so it makes no difference.
quidquid Latine dictum sit altum videtur
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

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

Post by nco2k »

ah thanks.. so it was just a rumor then. :)

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post by Little John »

nco2k wrote:wouldnt it be easier to write:

Code: Select all

Var.z
instead of:

Code: Select all

CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
  Var.d
CompilerElse
  Var.f
CompilerEndIf
Now I see what you mean. It was a misunderstanding.

Regards, Little John
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 »

Update entry 'Data' to correct examples and text describing the storing of memory addresses so that they use the Integer (.i) type instead of Long (.l). This will keep things accurate for both 32-bit and 64-bit environments.

Here is some of the sample text demonstrating what needs to be changed:
For advanced programmers: it's also possible to put a procedure address or a label address inside Data when its type is set to long (.l). This can be used to build easy virtual function tables for example.
User avatar
USCode
Addict
Addict
Posts: 912
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle, USA

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

Post by USCode »

Hi Andre,
Great work on the docs, I like the concise style in which they are done.

Friendly reminder:
I noticed in the latest beta 6 for 4.40 that there is still no mention in the help file of the new gradient drawing functions:
LinearGradient(), BoxedGradient(), CircularGradient(), EllipsicalGradient(), ConicalGradient()
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post by Little John »

Log()
Docs of PB 4.40 Beta 6 wrote:Syntax
Result.f = Log(Number.f)

Description
Returns the Log of the Number.
A function cannot return "the Log", but only a logarithm for a particular base.

Since Log() calculates the logarithm for base e, it should read:
Returns the natural logarithm of the given number.

Regards, Little John
Last edited by Little John on Tue Nov 10, 2009 7:36 am, edited 1 time in total.
Marco2007
Enthusiast
Enthusiast
Posts: 638
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

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

Post by Marco2007 »

@LJ: Amazing, how many things you find, but much more important: I´m soooo happy you have never been a teacher of mine at school :mrgreen:
PureBasic for Windows
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post by Little John »

:D
Ramihyn_
Enthusiast
Enthusiast
Posts: 314
Joined: Fri Feb 24, 2006 9:40 am

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

Post by Ramihyn_ »

The manpage of OSVersion() is missing "#PB_OS_Windows_7"

On a sidenote - the "About" requester of PB 4.4B6 still says "2008" at one place.
Marlin
Enthusiast
Enthusiast
Posts: 406
Joined: Sun Sep 17, 2006 1:24 pm
Location: Germany

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

Post by Marlin »

EventDropAction()
help wrote:#PB_Drag_Move: The data should be moved (The drag source is responsible for removing the original data)
Shouldn't it be the drag target, that is responsible for removing the original data :?:

Otherwise, how would you signal the drag source to remove the original data or not :?:
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

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

Post by freak »

Marlin wrote:EventDropAction()
help wrote:#PB_Drag_Move: The data should be moved (The drag source is responsible for removing the original data)
Shouldn't it be the drag target, that is responsible for removing the original data :?:

Otherwise, how would you signal the drag source to remove the original data or not :?:
This is correct. How should the drag target be able to remove data from another program ?

The DragXXX() functions indicate to the source wether the drag succeeded or not so it can take the appropriate action.
quidquid Latine dictum sit altum videtur
Marlin
Enthusiast
Enthusiast
Posts: 406
Joined: Sun Sep 17, 2006 1:24 pm
Location: Germany

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

Post by Marlin »

I'd like to use an example to get this straight:

I'm using an application with a window with a StringGadget (txtBaseDir).

Here I want an easy way to get a path to a file or folder.
Therefore I use:

Code: Select all

EnableGadgetDrop(txtBaseDir, #PB_Drop_Files, #PB_Drag_Move)
Now I drag some folder from Konqueror onto the StringGadget.

As Konqueror is where I got the folder from, I consider it to be the source, right?

The target then would be my StringGadget.
(As it is the place I drag the folder to)

In the eventloop I evaluate a #PB_Event_GadgetDrop to my StringGadget
and execute some procedure.

In this case I do not want the folder to be deleted.
(It does not get deleted.)

But if I wanted the source file to be deleted, I would need to code the act of deletition like

Code: Select all

DeleteFile()
somewhere in my target procedure.
As here is also the only place, where I know when I don't need the source anymore.
I just thought of something that can probable make my point clear:
I'm using another PB application that contains file paths in a ListIconGadget.
I can drag them from there (my app being source) to the trash.
The trash now considered target.

Nowhere in this source app have I coded any deletion or such!
But files dragged from here to the trash, do get moved to the trash.

This is fact.

Unless you come up with an alternative way to define source and target,
the help text is wrong.
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

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

Post by freak »

Files are different because you do not drag the actual file but only the file name. So whatever is to be done to the file itself has to be done by the target (the DragFiles() help page mentions this). For all other types of content, the source is responsible for the deletion.
quidquid Latine dictum sit altum videtur
Locked