Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

PB example for BlobMid() , BlobEdit() (Urgent)

13 posts in Powerscript Last posting was on 2010-01-05 14:42:50.0Z
Jenny Posted on 2009-12-01 12:50:40.0Z
Sender: 4515.4b14f6bc.1804289383@sybase.com
From: Jenny
Newsgroups: sybase.public.powerbuilder.powerscript
Subject: PB example for BlobMid() , BlobEdit() (Urgent)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b151120.490b.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 1 Dec 2009 04:50:40 -0800
X-Trace: forums-1-dub 1259671840 10.22.241.41 (1 Dec 2009 04:50:40 -0800)
X-Original-Trace: 1 Dec 2009 04:50:40 -0800, 10.22.241.41
Lines: 12
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27187
Article PK: 761754

Hi All,

I am new to PowerBuilder.
I am using PB 11, can anyone give me very small PB example
which demonstrate BlobMid() , BlobEdit() ( not event) of
PowerBuilder.




Thanks
Jenny


Ivaylo Ivanov Posted on 2009-12-01 14:21:33.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.powerscript
References: <4b151120.490b.1681692777@sybase.com>
Subject: Re: PB example for BlobMid() , BlobEdit() (Urgent)
Lines: 60
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b15266d@forums-1-dub>
Date: 1 Dec 2009 06:21:33 -0800
X-Trace: forums-1-dub 1259677293 10.22.241.152 (1 Dec 2009 06:21:33 -0800)
X-Original-Trace: 1 Dec 2009 06:21:33 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27188
Article PK: 793607

function f_hex_to_blob(string as_input) returns blob
==================================
// Purpose: converts a hex string to a blob of the corresponding bytes
// Arguments: string as_input - the string to be converted (with HEX
digits!)
// Returns: blob - the byte contents

blob lblb_result
string ls_hex = "0123456789ABCDEF", ls_temp
long ll_index
byte lbt_temp

if mod(len(as_input), 2) = 1 then
as_input = "0" + as_input
end if

// The working blob is created with 1 additional byte,
// because when BlobEdit function is called for the last byte
// of the blob, it returns NULL (position at which the next data
// can be copied - not enough space) and doesn't perform
// the operation for the last byte of the blob!

lblb_result = Blob(space(len(as_input) / 2 + 1), EncodingANSI!)

for ll_index = 1 to len(as_input) step 2
// Get next byte from the string
ls_temp = Upper(mid(as_input, ll_index, 2))
lbt_temp = 16 * (pos(ls_hex, mid(ls_temp, 1, 1)) - 1) + pos(ls_hex,
mid(ls_temp, 2, 1)) - 1

// Put the byte into the blob
BlobEdit(lblb_result, (ll_index + 1)/ 2, lbt_temp)
next

lblb_result = BlobMid(lblb_result, 1, len(lblb_result) - 1)

return lblb_result


Is this enough? If not, have you looked at the examples in the help for
these functions?

Regards,
Ivaylo

<Jenny> wrote in message news:4b151120.490b.1681692777@sybase.com...
> Hi All,
>
> I am new to PowerBuilder.
> I am using PB 11, can anyone give me very small PB example
> which demonstrate BlobMid() , BlobEdit() ( not event) of
> PowerBuilder.
>
>
>
>
> Thanks
> Jenny