Path: csiph.com!news.mixmin.net!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: "R.Wieser"
Newsgroups: microsoft.public.scripting.vbscript
Subject: Re: Access the 3rd and rest elements of a Byte() (byte array)?
Date: Wed, 9 Mar 2022 10:39:06 +0100
Organization: Aioe.org NNTP Server
Lines: 33
Message-ID:
References: <7ikpiwc1wlb3.1jl0fbkule7nk$.dlg@40tude.net> <16hdz1wr1j330.sbmmjvqqgesy$.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="26091"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-Notice: Filtered by postfilter v. 0.9.2
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MSMail-Priority: Normal
Xref: csiph.com microsoft.public.scripting.vbscript:12431
JJ,
> Hold on there, I didn't know that VB can convert Byte() to a string.
As far as I can tell, it stil doesn't. But for some reason wscript.echo
accepts a Byte-array too.
> But since MID() only accept a string,
I'm not sure I understood you right, as you posted three lines you said
work, but than follow it with the above ...
Yes, a quick test shows that MID() indeed does work, but - unexpectedly -
grabs two bytes at a time.
> Instead, we use RIGHT(), which unexpectedly, works.
:-) Currently the only unexpected thing with MID() and RIGHT() is that, and
/how/ they work on a Byte() array. Ofcourse, it didn't help that you need
an ASCW() (instead of just an ASC() ) to see the actual bytes.
> So, thank you for mentioning MID().
You're welcome. I'm just glad that my fumbling lead to something usefull.
But forgive me if I say that I probably won't ever try to use that
"adodb.stream" object in VBScript for anything. The above juggeling brings
back memories of how to do string stuff in DOS Batch files. :-|
Regards,
Rudy Wieser