Re: Translate small Perl to equivalent VB6?
From: Bob O`Bob (filterbob_at_yahoogroups.com)
Date: 09/27/04
- Next message: M.i.r.a.g.e.: "Listbox SetFocus Question"
- Previous message: Bob Cummings: "Re: newbie help"
- In reply to: Larry Serflaten: "Re: Translate small Perl to equivalent VB6?"
- Next in thread: Larry Serflaten: "Re: Translate small Perl to equivalent VB6?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 27 Sep 2004 12:49:51 -0700
Larry Serflaten wrote:
> When I went to see what you meant, that's when I saw that some ranges simply
> were not working correctly. To get that algorithm to work with VB there would
> be three possible routes to take;
>
> 1. Factor out the special cases where the sign bit is a problem and handle them
> individually
>
> 2. Use a different data type that does not have a sign bit (like Currency)
>
> 3. Convert to using strings to represent the binary values and twiddle those
> strings as if they were bits.
>
> Unfortunately, #2 and #3 are not compatable with VB's logical operators (And,
> and Or), so #1 is left as the more logical choice, although I think I'd go for #2
> because the conversion to and from the X.X.X.X format would be fairly easy and
> a person can make their own bitwise And and Or functions for Currency values.
I definitely favor #1 ... as evidenced by posted code.
One routine (RangeToBlocks1, about 40 lines of code) pretty much JUST
handles the sign bit, then in turn calls the other main routine
(RangeToBlocks2, also about 40 lines of code) to do the rest of the job.
Bob
- Next message: M.i.r.a.g.e.: "Listbox SetFocus Question"
- Previous message: Bob Cummings: "Re: newbie help"
- In reply to: Larry Serflaten: "Re: Translate small Perl to equivalent VB6?"
- Next in thread: Larry Serflaten: "Re: Translate small Perl to equivalent VB6?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|