Documentation of obsolete or considerably modified functions
-
- Addict
- Posts: 4774
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Documentation of obsolete or considerably modified functions
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".
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".
Last edited by Little John on Wed May 29, 2013 4:13 pm, edited 1 time in total.
- Zebuddi123
- Enthusiast
- Posts: 796
- Joined: Wed Feb 01, 2012 3:30 pm
- Location: Nottinghamshire UK
- Contact:
Re: Documentation of obsolete functions
Packer Library Example. PB 5.00 and Older.
Zebuddi. 
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

malleo, caput, bang. Ego, comprehendunt in tempore
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Documentation of obsolete functions
Well, this idea needs the formal support of Fred, otherwise the links are vulnerable.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Addict
- Posts: 4774
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Documentation of obsolete functions
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 ?
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 ?
Last edited by Little John on Sun May 12, 2013 6:23 pm, edited 1 time in total.
Re: Documentation of obsolete functions
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
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

DE AA EB
-
- Addict
- Posts: 4774
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Documentation of obsolete functions
Thank you, davido!
I've changed the above post accordingly.
I've changed the above post accordingly.
-
- Addict
- Posts: 4774
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Documentation of obsolete or considerably modified funct
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
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
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 followingLittle 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).

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
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
cheers
-
- Addict
- Posts: 4774
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Documentation of obsolete or considerably modified funct
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.
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
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.
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.
DE AA EB
-
- Addict
- Posts: 4774
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Documentation of obsolete or considerably modified funct
Library: Gadgets
ClearGadgetItemList()
Introduced in PB version: 2.30
Last PB version that supported this function: 4.20
The function has been renamed ClearGadgetItems().
ClearGadgetItemList()
Introduced in PB version: 2.30
Last PB version that supported this function: 4.20
The function has been renamed ClearGadgetItems().
-
- Addict
- Posts: 4774
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Documentation of obsolete or considerably modified funct
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.
2) XIncludeFile <relative Path> e.g.
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:
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
replacewith
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
at the beginning of any file that is used as main source code
(no other changes required).
(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"
Code: Select all
XIncludeFile "this.pbi"
XIncludeFile "..\that.pbi"
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
In other words, in all your source files
replace
Code: Select all
XIncludeFile
Code: Select all
XIncludeFile #Main_FilePath +
//edit:
I think this simpler workaround will work as well:
Just add
Code: Select all
CompilerIf #PB_Compiler_IsMainFile
IncludePath #PB_Compiler_FilePath
CompilerEndIf
(no other changes required).