Search:
Type: Posts; User: rdee
Search:
Search took 0.02 seconds.
-
I think this class might help you.
-
Hi passel,
In the cMultibits class there is a CustomValue property pair (Get/Let) that allows inserting/withdrawing ranges of bits (up to long/32bit size). The property will retrieve or insert the...
-
Try this class. It can turn any variable into a Hex string, and restore it to whatever type variable it was.
-
Here is a class for bit manipulation that also has a ReverseBytes routine. The procedure will handle any data type. Or you can extract the code.
rdee
-
I got this book relatively cheap from here. You can get it with the CD or without, but it will probably cost a little more with.
It covers from the basics and up.
rdee
-
I'm still getting the code-for-the-day emails from PSC. But I can't pull the site up.
rdee
-
Ben,
Much of what you've learned about byref arrays in variant parameters I have implemented in this bit manipulation class here. Making the class was quite a learning experience for me also.
...
-
You could also accomplish this using this class.
Assuming the class has been instantiated as "Bits"
And the data is B1 (where you need all 8 bits) and B2 where you need just the 3 most...
-
BubbleSort makes sense if you are adding items to an already sorted list. In this particular circumstance bubblesort is arguably the most efficient algorithm to use.
Rdee
-
Arnoutdv:
It works fine (as long as the parameters are in ascending order). Sorry for the misunderstanding.
rdee
-
Hey Arnoutdv. Thanks for the reply. With that info I'll go back to testing.
rdee
-
Arnoutdv:
I've been playing with this code (in your post above) a little. It does look appealingly simple. But I am having problems getting it to work consistently. Try running some of these...
-
I should have mentioned that the variant version of the routines in the class will also handle date and currency data types, besides the floating point types.
rdee
-
Added Variant versions of the main functions to the class so that floating point number ranges can now be compared (IsOverlappedV & RangePositionV).
The Variant routines check to make sure all...
-
I've taken the extended code I posted in my last post and put it into a little class. It includes a couple of small improvements.
Here is an example of using the Description property:
Dim...
-
I had to rethink my 'extended' code from my last post. There were some very subtle holes in the logic. I believe I fixed them now. Also, the RangePosition function is now independent of the...
-
reexre & Arnoutdv thank you for your additions!
rdee
-
The code below is a somewhat whimsical extension of the IsOverlapped code in my first post above. If you use the code in my first post, this code can replace it without any changes to your calling...
-
This submission is a class that handles bit manipulation in the following VB data types: Byte, Integer, Long, Single, Double, Currency, Date and One dimensional Long Arrays. (These are VarTypes 2...
-
Thank you Elroy. You are a (VB) scholar and a gentleman!
rdee
-
The code below will report True if 2 ranges (x1-x2 & y1-y2) overlap. You can put the two range parameters in either ascending or descending order. The function will rearrange them to ascending order...
-
Before this thread fades into the past I wanted to include a function that reports whether two ranges (x1-x2 and y1-y2) are overlapped in any way. I've tested them both (the two "IsOverlapped = ..."...
-
Try this:
Have two text boxes (Text1 and Text2). Type "1" in Text1 and "2" in Text2.
Now try this: MsgBox Cstr(Val(Text1) + Val(Text2))
Actually, you might not even need the Cstr(...) part....
-
Alex, hold the presses! I see a logical flaw in the RangeInRange function.
Suppose you have a range of 1920-1930 and you want to see if it overlaps 1925-1927. As is, the RangeInRange function...
-
Hey Alex,
Here is the basic "InRange" function. It would be most useful if it was placed in a .Bas module in your project where it could be called by any other module or form in your project.
...
-
Alex, Arnoutdv has it right in connection with my post. If you just want to see if the years just overlap at some point then use:
If InRange(Low1, Low2, High2) Or InRange(High1, Low2, High2)...
-
If you already know the high and low values that are being checked against, and are sure that low and high cannot be reversed, this would work:
' InRange returns True if LngVal is within the...
-
Kunical:
Here is a class that does that for many different types of variables. And it includes two different ways of accomplishing it. You could just use the class or take the code from it. The...
-
Olaf, thanks for your addition to the thread.
One of the things that mystified me was the fact that if an empty variant was sent to a sub with a ByRef variant procedure, the parameter stays empty,...
-
Sorry Elroy,
I just checked my code again and there was a mistake. I'm getting the same results as you are now. I've been up too long.
I'm going to give it a rest for the night. Thank you for...
-
Tanner_H:
Thank you for your thoughts. The link you provided is very interesting, but way over my head. My knowledge of C/C++ is less than miniscule (although, I did actually convert a C++ routine...
-
Wow, thank you Elroy!
I had no idea how that worked. That makes a lot of sense now.
Would there be any way to get access to that address (i.e. the empty variant that calls the...
-
Okay, so I did a bit of testing:
Here are my results from testing:
Integers: When I send an integer to the sub, the sub puts the ByRef/Long indicator (&H4003) into the 1st 2 bytes of Vnt...
-
Thank you passel, Elroy and DEXWERX for both your insights and the (DEX) the code to play with.
As DEX pointed out, my main interest is in ByRef Variant parameters, although, I more than glad to...
-
A little more testing:
After running my little VarType change trick on a Single, Vb is still treating the calling Single as a Single, not a Long. So far it appears that changing the VarType on a...
-
Just got a chance to test out what I was theorizing in my previous post:
When I called it with a Single (with a value of 0) I got this result:
00000000 00000000 00000000 00100000
...
-
Elroy (or anyone else for that matter),
When a Variant is used as a ByRef parameter in a procedure, is there anything else Or-ed with the VarType to indicate that the data in the variant is a...
-
Elroy, thank you for your responses and the link (and for the LongLong threads - most interesting!).
My interest in the question was in connection with some bit manipulation code I have posted on...
-
Elroy's recent LongLong thread got me to wondering about something:
Suppose you had a procedure that had a ByRef Variant as a parameter . . .
Would this work? Would it work if the parameter...
-
Hey Naren
Here is a thread that has a little more of the API calls you need. But I haven't tested it (yet).
Hope this has something helpful for you.
rdee
|
Click Here to Expand Forum to Full Width
|