Easter egg or just beeing helpful on our behalf?

Everything else that doesn't fall into one of the other PB categories.
User avatar
oakvalley
User
User
Posts: 77
Joined: Sun Aug 08, 2004 6:34 pm
Location: Norway
Contact:

Easter egg or just beeing helpful on our behalf?

Post by oakvalley »

Try:

CreateImage(500000,320,256)
with the debugger on, and read the error.

Yes, suppose I WANT to do that, and I AM sure?

But, Purebasic really means in other words...are you INSANE?!

hehe
Regards Stone Oakvalley
Currently @ PB 5.70
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

By doing CreateImage(500000,320,256) you allocate space for 499999 other images too.

So yes, that is insane :P
quidquid Latine dictum sit altum videtur
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Post by SoulReaper »

wow :shock:

thats half a million images LOL I dont think there is any APP or Game that would even need that....

Still nice to see the limits of Pure Basic being tested :wink:
whertz
Enthusiast
Enthusiast
Posts: 124
Joined: Sat Jun 25, 2005 2:16 pm
Location: United Kingdom

Post by whertz »

If I use CreateImage(10,.. or LoadImage(10,...etc as the first image in my program does that mean ten other images are allocated too?
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It means than a room to handle 10 images is allocated, the images aren't really created. For example, each images need 20 bytes to be handled by PB, so 220 bytes will be used in your case.
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Yes. In the case of 10 or 100 or even 1000, that is not a really a problem, as the memory that is allocated but not used is small,
but with the number of 500000, there are 9.5 Mb allocated that are not needed.
quidquid Latine dictum sit altum videtur
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

BTW, using #PB_Any allows to have any number of images (only memory limited).
User avatar
oakvalley
User
User
Posts: 77
Joined: Sun Aug 08, 2004 6:34 pm
Location: Norway
Contact:

Post by oakvalley »

Well, I did not actually have to assign so many images, but I found
the respond message kinda "out of place".

Think it's the first time purebasic has gotten personal in it's messages,
and referring to me directly with "are you sure of that ?"

No other errors I've seen did that on a personal level. Maybe purebasic
is getting "aware" and start self-improve without Fred's help. Now, that
would be nice....self learning software computerprogrammingsoftware software.

:)
Regards Stone Oakvalley
Currently @ PB 5.70
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I find that the "are you sure of that?" message is returned in many situations where the parameters supplied by the programmer are fairly far out of the usual bounds the compiler is expecting for the given operation. I might add that in the seven or eight different cases where I've encountered the message, there wasn't a single time where I was using the language correctly and should have been "sure of that". So when I see it now I start from the assumption that I'm off base and Fred is trying to rescue me from the murky depths of my noobishness. (-the nooby murks of my depthishness?)
Huh? Are you sure of that?____________________________________________| :)

Actually, I think any compiler message which doesn't feature the word 'Moron' is polite and helpful. But that's just me.
BERESHEIT
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

netmaestro wrote:Actually, I think any compiler message which doesn't feature the word 'Moron' is polite and helpful. But that's just me.
:lol:
Good programmers don't comment their code. It was hard to write, should be hard to read.
Post Reply