memory command changes since last version..

Everything else that doesn't fall into one of the other PB categories.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

memory command changes since last version..

Post by dagcrack »

i've seen that some memory functions doesnt work fine (wont compile, gives errors) I wondered if anyone could show me the old and new lines, how they should look like. as I cant get it working and I crashed my pc twice already, trying to sort out this crap.

examples:

Code: Select all

ChunkSize = Val(ChunkSizeText)
If AllocateMemory(0, ChunkSize) = 0

Code: Select all

ReadData(MemoryID(), DataSize)

Code: Select all

WriteData(MemoryID(), DataSize)
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

RTFM

The memory-commands have changed.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

8O
I will
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Hi-Toro
Enthusiast
Enthusiast
Posts: 269
Joined: Sat Apr 26, 2003 3:23 pm

Post by Hi-Toro »

What a friendly reply!
James Boyd
http://www.hi-toro.com/
Death to the Pixies!
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

dagcrack,

In the past you had to code :

AllocateMemory(0, Length, 0)
...
ReadData(UseMemory(0), Length)
ReadData(MemoryID(), Length)

Now it is more simple :

*MemoryID = AllocateMemory(Length)
...
ReadData(*MemoryID, Length)

That's it ...
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Hi-Toro wrote:What a friendly reply!
It stand in the Histroy-Log, it stand in the manual and it exist more than one Thread about this.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

GPI wrote:
Hi-Toro wrote:What a friendly reply!
It stand in the Histroy-Log, it stand in the manual and it exist more than one Thread about this.
yeah. but still a non-friendly reply :)
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

thefool wrote:yeah. but still a non-friendly reply :)
Maybe, but it give a solution (look at the manual).
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

yes, its right that it was very clearly in the list of changes. Easy to find in the manual, and also easy to find posts about it in this forum.
It was a mistake to create this thread, but why answer unfriendly just because he made a mistake?

i hope you see the point. But yes, you answered his question.
batcherx
New User
New User
Posts: 9
Joined: Mon May 24, 2004 5:34 am

Post by batcherx »

Why wasn't the new simplified AllocateMemory command called AllocateMemoryx ?
How many old script got broken or had to be changed, or do people throw away their scripts after compilation?
For new PB users like me it's no problem. Howerver, for seasoned PBer it must have been unwelcomed.
As a newbie do the PB powers-that-be often introduce such radical changes?
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Hi batcherx.

I don't think this is an ongoing thing.

As I understand it, in order to get PB capable of some new tricks, this and the next few sub-releases might cause some big changes. Sort of like MS breaking away from VB for VB.NET.

I also understand it that with PB, things will be stable after the (needed) rewrites.

Adding duplication, eg, AllocateMemory and AllocateMemoryX can lead to less efficiencies, hence the clean break.

You can run more than one PB version. So old code can still be compiled using an older version. Freak explains this somewhere, I just couldn't find the post for you.

The changes are welcome, IMO, as they will open new doors for PB users and the old can still be maintained and etc using older versions.

All of the above is not official, just how I understand this particular series of releases
Post Reply