Page 1 of 1

Use Flags for Variable Results

Posted: Wed Aug 23, 2006 10:31 pm
by Paul
How about flags for Val, Str, Peek, Poke, GetDatabase, Read, Write, ReadPreferences, WritePreferences...

example:
Result=Val(String$,#PB_Long)
Result=Peek(*Memory,#PB_Double)

This way you could also change the results through code by simply changing the flag value. Very flexable :)

Other commands use flags to specify various results so why not be consistant?

Makes more sense than PeekB, PeekC, PeekD, PeekF, PeekL, PeekQ, PeekS, PeekW, etc...

Posted: Thu Aug 24, 2006 12:12 am
by Rescator
I agree, it's getting kinda messy with all these variants!
And Fred could even use his own Macro system to change

PeekQ() to Peek(x,#PB_Quad) at compile time, thus avoiding source compatibility issues.

EDIT: Or even the other way around, whatever is most efficient code/speedwise!

Posted: Thu Aug 24, 2006 4:18 am
by fsw
Rescator wrote:I agree, it's getting kinda messy with all these variants!
And Fred could even use his own Macro system to change
This is a good idea, but don't use PB's macro system, it's buggy when used heavely :shock:

Posted: Thu Aug 24, 2006 7:58 am
by Trond
This willl make the functions slower, so I doubt this will be implemented.