Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Blob and Char(0)

162 views
Skip to first unread message

Manfred Brandstetter

unread,
Feb 23, 2000, 3:00:00 AM2/23/00
to
Hi!

Is it not possible to store Char(0) in Blob-Variables?

int li
string ls
char lc[5]
blob{5} lbl

lc[1] = Char(2)
lc[2] = Char(66)
lc[3] = Char(0)
lc[4] = '#'
lc[5] = 'X'
lc[5] = Char(65)

lbl = Blob(lc)
lc = 'ABCDEF'
FOR li = 1 TO 5
lc[li] = Char(BlobMid(lbl, li, 1))
NEXT

--
<Manfred.Br...@gmx.at>
Wanek electronic design

Manfred Brandstetter

unread,
Feb 23, 2000, 3:00:00 AM2/23/00
to
Hi!

Sorry, my Fingers are faster then I'm thinking.
Is it not possible to store Char(0) in Blob-Variables? In the following
Script, I cannot get the Characters after the Char(0).
Who can me explain the difference between String and Blob??

Thank's,
Mandy

Brad Mettee

unread,
Feb 23, 2000, 3:00:00 AM2/23/00
to
You need to use the BlobEdit function to modify a character location in the blob
itself. When PB copies the string into the blob, it assumes that the first Char(0)
it finds represents the end of the string. Additionally, after you re-load the string
from the blob, you'll never be able to get past the Char(0) marker anyway (in the
string), again, it's the same reason (char(0) is the end of string marker).

Hope this helps,


In article <YvH2p4ff$GA....@forums.sybase.com>,
Manfred.Br...@gmx.at says...
>
>Hi!


>
>Is it not possible to store Char(0) in Blob-Variables?
>

>int li
>string ls
>char lc[5]
>blob{5} lbl
>
>lc[1] = Char(2)
>lc[2] = Char(66)
>lc[3] = Char(0)
>lc[4] = '#'
>lc[5] = 'X'
>lc[5] = Char(65)
>
>lbl = Blob(lc)
>lc = 'ABCDEF'
>FOR li = 1 TO 5
> lc[li] = Char(BlobMid(lbl, li, 1))
>NEXT

--
Brad Mettee
PC HotShots, Inc.
Baltimore, MD

--> Let us bring out the *Power* of your PCs <--
* finger bme...@clark.net for PGP Key *


Víctor Maidana

unread,
Feb 23, 2000, 3:00:00 AM2/23/00
to
Hi Manfred.

The problem is in

lc[3] = Char(0)

PB strings are null-terminated strings. Then you are inserting a
'terminator' there. :)

HTH
Víctor Maidana.

Manfred Brandstetter <Manfred.Br...@gmx.at> escribió en el mensaje de
noticias JCERq8ff$GA....@forums.sybase.com...


> Hi!
>
> Sorry, my Fingers are faster then I'm thinking.
> Is it not possible to store Char(0) in Blob-Variables? In the following
> Script, I cannot get the Characters after the Char(0).
> Who can me explain the difference between String and Blob??
>
> Thank's,
> Mandy
>

Roy Kiesler [TeamSybase]

unread,
Feb 23, 2000, 3:00:00 AM2/23/00
to
Use BlobMid and BlobEdit to insert a char(0) to a blob. Create the blob as
empty, then use the Space() function to allocate enough memory to hold the
size of the char array. Next, use the blob functions to insert the
characters.

--
pbm_hopethishelps,
Roy Kiesler [TeamSybase]
Sybase Developers Network (SDN) - http:///www.sybase.com/sdn

"Víctor Maidana" <vgu...@highway.com.py> wrote in message
news:Lj6fa0gf$GA....@forums.sybase.com...

Manfred Brandstetter

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to

Roy Kiesler [TeamSybase] <SPAM_FREE...@noblestar.com> schrieb in im
Newsbeitrag: 8IOIGChf$GA....@forums.sybase.com...

> Use BlobMid and BlobEdit to insert a char(0) to a blob. Create the blob as
> empty, then use the Space() function to allocate enough memory to hold the
> size of the char array. Next, use the blob functions to insert the
> characters.

Thank's, but why does PB this not for me? Converts PB the Character-Array to
a string before it makes a copy in the blob?

0 new messages