Search:

Type: Posts; User: rdee

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Re: Compacting bitflags into a signed or unsigned Sqlite table column

    I think this class might help you.
  2. Replies
    34
    Views
    8,487

    Re: Double value to Hex string

    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...
  3. Replies
    34
    Views
    8,487

    Re: Double value to Hex string

    Try this class. It can turn any variable into a Hex string, and restore it to whatever type variable it was.
  4. Thread: Endianess

    by rdee
    Replies
    3
    Views
    640

    Re: Endianess

    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
  5. Thread: OOP in VB6 [help]

    by rdee
    Replies
    10
    Views
    2,268

    Re: OOP in VB6 [help]

    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
  6. Replies
    45
    Views
    19,063

    Re: vbAccelerator site gone?

    I'm still getting the code-for-the-day emails from PSC. But I can't pull the site up.

    rdee
  7. Re: Some things I've learned about variants and arrays

    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.
    ...
  8. Replies
    12
    Views
    3,044

    Re: Bit operations, two bits to one

    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...
  9. Re: The Logic Behind Bubble Sort | How does it work?

    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
  10. Re: [RESOLVED] code calculation/formula ca't get it right

    Arnoutdv:

    It works fine (as long as the parameters are in ascending order). Sorry for the misunderstanding.

    rdee
  11. Re: [RESOLVED] code calculation/formula ca't get it right

    Hey Arnoutdv. Thanks for the reply. With that info I'll go back to testing.

    rdee
  12. Re: [RESOLVED] code calculation/formula ca't get it right

    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...
  13. Replies
    10
    Views
    5,510

    Re: Determining when two numeric ranges overlap

    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
  14. Replies
    10
    Views
    5,510

    Re: Determining when two numeric ranges overlap

    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...
  15. Replies
    10
    Views
    5,510

    Re: Determining when two numeric ranges overlap

    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...
  16. Replies
    10
    Views
    5,510

    Re: Determining when two numeric ranges overlap

    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...
  17. Replies
    10
    Views
    5,510

    Re: Determining when two numeric ranges overlap

    reexre & Arnoutdv thank you for your additions!

    rdee
  18. Replies
    10
    Views
    5,510

    Re: Determining when two numeric ranges overlap

    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...
  19. Replies
    0
    Views
    2,201

    Multi Bit Manipulation Class

    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...
  20. Replies
    10
    Views
    5,510

    Re: Determining when two numeric ranges overlap

    Thank you Elroy. You are a (VB) scholar and a gentleman!
    rdee
  21. Replies
    10
    Views
    5,510

    Determining when two numeric ranges overlap

    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...
  22. Re: [RESOLVED] code calculation/formula ca't get it right

    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 = ..."...
  23. Replies
    12
    Views
    1,073

    Re: Text boxes and integers

    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....
  24. Re: code calculation/formula ca't get it right

    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...
  25. Re: code calculation/formula ca't get it right

    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.

    ...
  26. Re: code calculation/formula ca't get it right

    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)...
  27. Re: code calculation/formula ca't get it right

    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...
  28. Re: [RESOLVED] VB6 Hex values always have FFFF on higher bits

    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...
  29. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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,...
  30. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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...
  31. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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...
  32. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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...
  33. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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...
  34. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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...
  35. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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...
  36. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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
    ...
  37. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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...
  38. Replies
    36
    Views
    7,392

    Re: VB6 Variant VarType Question

    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...
  39. Replies
    36
    Views
    7,392

    [RESOLVED] VB6 Variant VarType Question

    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...
  40. Thread: Caret Position

    by rdee
    Replies
    4
    Views
    1,849

    Re: Caret Position

    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
Results 1 to 40 of 43
Page 1 of 2 1 2



Click Here to Expand Forum to Full Width