Page 1 of 1
Documentation of obsolete or considerably modified functions
Posted: Sat May 11, 2013 3:55 pm
by Little John
Hi all,
there is already a
feature request for proper
documentation of functions that do not exist anymore in the current PB version or that changed enough to break backwards compatibility.
Fortunately, the documentation of some (all?) obsolete functions is still available on the internet. However, the respective entries and links in the table of contents of the
PureBasic Reference Manual have been removed. So I thought we can collect information about obsolete functions in this thread (until it will become part of the official documentation).
Here's a start:
Library: Packer
PackMemory()
Introduced in PB version:
?
Last PB version that supported this function:
5.00
PackerCallback()
Introduced in PB version:
?
Last PB version that supported this function:
5.00
UnpackMemory()
Introduced in PB version:
?
Last PB version that supported this function:
5.00
See also
the tool "UnpackMemory".
Re: Documentation of obsolete functions
Posted: Sat May 11, 2013 4:31 pm
by davido
Thanks.
Looks good.
Re: Documentation of obsolete functions
Posted: Sun May 12, 2013 9:23 am
by Zebuddi123
Packer Library Example. PB 5.00 and Older.
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Compressor example file
;
; (c) 2001 - Fantaisie Software
;
; ------------------------------------------------------------
;
If ReadFile(0, OpenFileRequester("Choose a file to compress", "", "*.*", 0))
FileLength = Lof(0)
; Allocate the 2 memory buffers needed for compression..
;
*Source = AllocateMemory(FileLength)
*Target = AllocateMemory(FileLength+8)
If FileLength And *Source And *Target
ReadData(0, *Source, FileLength) ; Read the whole file in the memory buffer
; Compress our file, which is in memory (and use a timer to see the time spend by compression..)
;
CompressedLength = PackMemory(*Source, *Target, FileLength)
If CompressedLength
DecompressedLength = UnpackMemory(*Target, *Source)
If DecompressedLength = FileLength
MessageRequester("Info", "De/Compression succeded:"+#LF$+#LF$+"Old size: "+Str(FileLength)+#LF$+"New size: "+Str(CompressedLength))
EndIf
Else
MessageRequester("Error", "Can't compress the file")
EndIf
FreeMemory(*Source)
FreeMemory(*Target)
EndIf
CloseFile(0)
EndIf
End
Zebuddi.

Re: Documentation of obsolete functions
Posted: Sun May 12, 2013 1:26 pm
by IdeasVacuum
Well, this idea needs the formal support of Fred, otherwise the links are vulnerable.
Re: Documentation of obsolete functions
Posted: Sun May 12, 2013 4:02 pm
by Little John
Library: Network
SendNetworkFile()
Introduced in PB version:
2.00
Last PB version that supported this function:
5.00
ReceiveNetworkFile()
Introduced in PB version:
2.00
Last PB version that supported this function:
5.00
The functions have been removed in order to avoid possible security problems.
Now we have to write code for sending/receiving files on a network ourselves, using the basic built-in network functions,
see
How send file using ReceiveNetworkData/SendNetworkData ?
Re: Documentation of obsolete functions
Posted: Sun May 12, 2013 6:00 pm
by davido
SendNetworkFile() & ReceiveNetworkFile()
Presumably they were introduced in this version:
12 November 2000
PureBasic V2.00 PR2 (Windows)
- Added: Library Sprite
- Added: Library Joystick
- Added: Library Keyboard
- Added: Library Sound
- Added: Library Network
- Added: Library Palette
- Added: An early version of Waponez II (Shoot-em-up) to test the game functions- Fixed: Tons of bugs. Thanks to all bug reporters

Re: Documentation of obsolete functions
Posted: Sun May 12, 2013 6:25 pm
by Little John
Thank you, davido!
I've changed the above post accordingly.
Re: Documentation of obsolete or considerably modified funct
Posted: Sat Jun 08, 2013 11:43 am
by Little John
Library: 2D Drawing
Line()
Considerably modified in PB version:
4.40
Width of 0 not allowed anymore. You might want to use LineXY() instead.
see
http://www.purebasic.fr/english/viewtop ... 03#p413703
Re: Documentation of obsolete or considerably modified funct
Posted: Sat Jun 08, 2013 1:49 pm
by moogle
Little John wrote:Hi all,
there is already a
feature request for proper
documentation of functions that do not exist anymore in the current PB version or that changed enough to break backwards compatibility.
Fortunately, the documentation of some (all?) obsolete functions is still available on the internet. However, the respective entries and links in the table of contents of the
PureBasic Reference Manual have been removed. So I thought we can collect information about obsolete functions in this thread (until it will become part of the official documentation).
I suggested something like that 2 years earlier
here, but as usual stuff that would help PB's image and beginners using old forum code gets ignored. Then people wonder why purebasic doesn't gain a larger following
The help file should keep those (removed) entries that way when the compiler tells you the function no longer exists the user can see the description of the arguments and find out how to convert it to use the replacement one.
Re: Documentation of obsolete or considerably modified funct
Posted: Sat Jun 08, 2013 2:53 pm
by rsts
Not that there aren't a lot of good ideas, but with such a small team, there's only so much you can do.
cheers
Re: Documentation of obsolete or considerably modified funct
Posted: Sat Jun 08, 2013 3:07 pm
by Little John
Hi,
the purpose of this thread is the documentation of functions that do not exist anymore in the current PB version or that changed enough to break backwards compatibility.
I would highly appreciate it, if there would be as few discussion here as possible. Too much discussion would make it harder to read the documentation collected in this thread. Thank you.
Re: Documentation of obsolete or considerably modified funct
Posted: Sat Jun 08, 2013 5:03 pm
by davido
Hi Little John,
Might I suggest that the request be made that users delete their posts after their point has been made. Leaving only the one post for each function.
I will remove this post in the next day or so. Also the two previous posts I made have now become become 'clutter' and I will remove those if you so wish.
Re: Documentation of obsolete or considerably modified funct
Posted: Mon Jul 08, 2013 8:29 pm
by Little John
Library: Gadgets
ClearGadgetItemList()
Introduced in PB version:
2.30
Last PB version that supported this function:
4.20
The function has been renamed
ClearGadgetItems().
Re: Documentation of obsolete or considerably modified funct
Posted: Sat Sep 13, 2014 11:01 pm
by Little John
Category: Keywords
(X)IncludeFile, IncludeBinary
Considerably modified in PB version:
5.30
On principle, (X)IncludeFile (and IncludeBinary) can be used in 2 different ways:
1) XIncludeFile <absolute Path> e.g.
Code: Select all
XIncludeFile "C:\Users\Me\Desktop\hello.pbi"
XIncludeFile #PB_Compiler_Home + "..\libs\foo.pbi"
XIncludeFile #PB_Compiler_FilePath + "bar.pbi"
2) XIncludeFile <relative Path> e.g.
Code: Select all
XIncludeFile "this.pbi"
XIncludeFile "..\that.pbi"
The change in PB 5.30 affects (X)IncludeFile (and IncludeBinary), when used with a
relative path:
In PB 5.2x LTS and earlier versions, a relative path after (X)IncludeFile is relative to the location of the main source code file.
In PB 5.30 and subsequent versions, a relative path after (X)IncludeFile is relative to the location of the file it is used in.
see
http://www.purebasic.fr/english/viewtop ... =7&t=58746
Workaround
In order to make your "old" code compatible with PB 5.30+, add something like this at the beginning of any file that is used as
main source code:
Code: Select all
CompilerIf #PB_Compiler_IsMainFile
#Main_FilePath = #PB_Compiler_FilePath
CompilerEndIf
And change all
(X)IncludeFile statements with a
relative path to an
absolute path, based on
#Main_FilePath.
In other words, in all your source files
replace
with
After applying these changes, (X)IncludeFile will work as before in PB 5.2x LTS and previous versions, and will work the same way in PB 5.30+.
//edit:
I think this simpler workaround will work as well:
Just add
Code: Select all
CompilerIf #PB_Compiler_IsMainFile
IncludePath #PB_Compiler_FilePath
CompilerEndIf
at the beginning of any file that is used as
main source code
(no other changes required).