PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

How to do bit manipulation in VBA?

 
 
curiousgeorge408@hotmail.com
Guest
Posts: n/a
 
      24th Nov 2007
I want to pass a floating-point number to a VBA function and access
the binary representation. In C, I might declare a union of double
and 8-element unsigned char array, assign the function parameter to
the double, then access the bits of the unsigned char array.
Alternatively, I might use memcpy() to copy the floating-point
parameter into an 8-element unsigned char array.

How can I accomplish that (either one) in VBA?
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      24th Nov 2007
Hi George:

http://groups.google.com/group/micro...roup%3A*excel#
--
Gary''s Student - gsnu2007a


"(E-Mail Removed)" wrote:

> I want to pass a floating-point number to a VBA function and access
> the binary representation. In C, I might declare a union of double
> and 8-element unsigned char array, assign the function parameter to
> the double, then access the bits of the unsigned char array.
> Alternatively, I might use memcpy() to copy the floating-point
> parameter into an 8-element unsigned char array.
>
> How can I accomplish that (either one) in VBA?
>

 
Reply With Quote
 
curiousgeorge408@hotmail.com
Guest
Posts: n/a
 
      25th Nov 2007
On Nov 24, 12:09 pm, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> http://groups.google.com/group/micro...rogramming/bro...


Thanks for the pointer. (Sigh, Google Groups seems to be truncating
the URL in this response.)

I did see this thread when I searched GG before posting my inquiry.
But I was unable to look at threads from early 2005 and earlier,
including this one. I ass-u-me-d that GG kept the NG index, but not
the articles. (I thought that was odd, but I imagined a dubious
benefit.) But after I clicked on your link, I discovered that all the
links in the search result now work. I'm sure it has nothing to do
with clicking on your link. The earlier failure must've been a hiccup
in the GG intranet. Klunk! I'll try to be more patient in the
future.

Anyway, this is a great(!) pointer. It sparks some follow-up
questions, which are non-technical. I hope someone will be kind
enough to offer some insight.

First, where can I learn (more) about the user-callable entry points
in the Kernel32 lib -- and any other system libs that might be
accessible to VBA programs?

I don't 'spose there are "man pages" <wink>.

(My VBA book does mention some useful entry points and how to use
them. But it is not complete, by a long shot.)

Second, where can I learn (more) about the VBA language?

I'm looking for the "K&R" of VBA <wink>.

My VBA book, which is one of the most recommended in these NGs, does
not mention LSET, for example. At least, not that I recall. The
book's index is terrible. So it is possible that LSET is mentioned in
context somewhere, and I simply can no longer find it (like almost
everything else), having no idea in what context the author chooses to
introduce what <sigh>.
 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      25th Nov 2007
Hi George:

For API info you might checkout Ivan Moala's site:

http://www.xcelfiles.com/Index.html

or

http://www.answers.com/library/Win+APIs

or

http://www.andreavb.com/API_USER32.html

Have fun with this !

--
Gary''s Student - gsnu2007b


"(E-Mail Removed)" wrote:

> On Nov 24, 12:09 pm, Gary''s Student
> <GarysStud...@discussions.microsoft.com> wrote:
> > http://groups.google.com/group/micro...rogramming/bro...

>
> Thanks for the pointer. (Sigh, Google Groups seems to be truncating
> the URL in this response.)
>
> I did see this thread when I searched GG before posting my inquiry.
> But I was unable to look at threads from early 2005 and earlier,
> including this one. I ass-u-me-d that GG kept the NG index, but not
> the articles. (I thought that was odd, but I imagined a dubious
> benefit.) But after I clicked on your link, I discovered that all the
> links in the search result now work. I'm sure it has nothing to do
> with clicking on your link. The earlier failure must've been a hiccup
> in the GG intranet. Klunk! I'll try to be more patient in the
> future.
>
> Anyway, this is a great(!) pointer. It sparks some follow-up
> questions, which are non-technical. I hope someone will be kind
> enough to offer some insight.
>
> First, where can I learn (more) about the user-callable entry points
> in the Kernel32 lib -- and any other system libs that might be
> accessible to VBA programs?
>
> I don't 'spose there are "man pages" <wink>.
>
> (My VBA book does mention some useful entry points and how to use
> them. But it is not complete, by a long shot.)
>
> Second, where can I learn (more) about the VBA language?
>
> I'm looking for the "K&R" of VBA <wink>.
>
> My VBA book, which is one of the most recommended in these NGs, does
> not mention LSET, for example. At least, not that I recall. The
> book's index is terrible. So it is possible that LSET is mentioned in
> context somewhere, and I simply can no longer find it (like almost
> everything else), having no idea in what context the author chooses to
> introduce what <sigh>.
>

 
Reply With Quote
 
curiousgeorge408@hotmail.com
Guest
Posts: n/a
 
      26th Nov 2007
On Nov 25, 5:21 am, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> http://www.answers.com/library/Win+APIs


Thanks for the pointers.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bit manipulation jfbaro Microsoft C# .NET 3 18th Dec 2006 01:28 PM
For better Performance in VBA for Excel - Strings manipulation OR Objects manipulation vmegha Microsoft Excel Programming 2 19th Dec 2005 12:14 AM
RTF manipulation sb Luis Microsoft C# .NET 1 15th Dec 2005 02:29 PM
csv manipulation with vb.net Keith A. Lees Microsoft VB .NET 1 27th Apr 2004 01:26 PM
bit manipulation Juan Gabriel Del Cid Microsoft C# .NET 5 11th Oct 2003 03:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:09 AM.