Page 1 of 1
Posted: Tue Aug 27, 2002 6:50 am
by BackupUser
Restored from previous forum. Originally posted by PB.
Is it possible for strings to contain Chr(0) characters?
At the moment the following returns 0 instead of 10... but
I need a string to contain Chr(0).
Code: Select all
For r=1 To 10
a$=a$+Chr(0)
Next
Debug Len(a$)
PB - Registered PureBasic Coder
Posted: Tue Aug 27, 2002 8:04 am
by BackupUser
Restored from previous forum. Originally posted by Pupil.
I don't think it's possible for strings to contain null characters as these are reserved to terminate a string, you probably have to use a memorybuffer to get what you want...
Posted: Tue Aug 27, 2002 8:18 am
by BackupUser
Restored from previous forum. Originally posted by PB.
> I don't think it's possible for strings to contain null characters
> as these are reserved to terminate a string, you probably have to
> use a memorybuffer to get what you want...
Ah, okay. I was trying to use a string simply because I want to
use ReplaceString to change some data in a string... is there an
easy way to do a search/replace in a memory block? Or is this a
good request for a future command?
PB - Registered PureBasic Coder
Posted: Tue Aug 27, 2002 9:29 am
by BackupUser
Restored from previous forum. Originally posted by Pupil.
Originally posted by PB
Ah, okay. I was trying to use a string simply because I want to
use ReplaceString to change some data in a string... is there an
easy way to do a search/replace in a memory block? Or is this a
good request for a future command?
I did a small procedure a while ago that search and replace data in a memoryblock, you can find it on the resource site under the snippet section, it's called "findandreplacemem". With some modifications you can customize it to your needs...
Posted: Tue Aug 27, 2002 10:34 am
by BackupUser
Restored from previous forum. Originally posted by PB.
> I did a small procedure a while ago that search and replace data in
> a memoryblock, you can find it on the resource site under the
> snippet section, it's called "findandreplacemem".
Thanks, I worked it out but I'll take a look at your version.
PB - Registered PureBasic Coder