LenB(string.s) -> Size in bytes of a string.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

LenB(string.s) -> Size in bytes of a string.

Post by Flype »

Maybe one day - not very important :

Code: Select all

Macro LenB(string)
  ( Len(string) * SizeOf(Character) )
EndMacro
Macro MemoryStringLengthB(hString)
  ( MemoryStringLength(hString) * SizeOf(Character) )
EndMacro

a$ = Space(128)

Debug Len(a$)
Debug LenB(a$)
Debug MemoryStringLength(@a$)
Debug MemoryStringLengthB(@a$)
Last edited by Flype on Wed Apr 26, 2006 6:51 pm, edited 1 time in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Try StringByteLength() ;)
quidquid Latine dictum sit altum videtur
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

oups, didn't seen this one :D thank you freak.

but for do have another magic function for MemoryStringLengthB() ?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Post Reply