What's wrong here? 
Author Message
 What's wrong here?

For some reason that I can't understand or see these two snippets of code
(below) don't produce the same results! Snippet #2 works while #1 seems to be
off in la-la land dancing with the pixies!

I'd like to use something like what's in snippet #1 as it's shorter code, less
work, and should be faster but....

Any insight?

TIA,

  ____    _    ____      ____  _____
 |  _ \  / \  / ___) __ | ___)(_   _)
 | |_)  / _ \ \____\/  \|  _)   | |
 |____//_/ \_\(____/\__/|_|     |_|

     www.basicguru.com/schullian

'------------------------------------
'---------- CODE 1
'------------------------------------
  DIM  B_ptr AS STRING PTR * 255
  DIM  Block?(254)

  B_ptr = VARPTR32( Block?(0) )

  ReadCode:
    TheCode% = 0
    FOR I% = 0 TO CodeSize% - 1
      IF BlockIdx% = BlockLen% THEN
        GET  #FileNo%,   , B?

        BlockLen% = ( B? * 8 )
        BlockIdx% = 0
      END IF
      IF BIT(Block?(0),BlockIdx%) THEN BIT SET TheCode%,I%
      INCR BlockIdx%
    NEXT
  RETURN
'------------------------------------
'---------- CODE 2
'------------------------------------
  DIM  B_ptr  AS BYTE PTR
  DIM  Block  AS STRING * 255

  B_ptr = VARPTR32( Block$ )

  ReadCode:
    TheCode% = 0
    FOR I% = 0 TO CodeSize% - 1
      INCR BitsIn%
      IF BitsIn% > 7 THEN
        BitsIn% = 0
        IF BlockIdx% = BlockLen? THEN
          GET  #FileNo%,          , BlockLen?
          GET$ #FileNo%, BlockLen?, Block$
          BlockIdx% = 0
        END IF

        INCR BlockIdx%
      END IF
      IF BIT(B?,BitsIn%) THEN BIT SET TheCode%,I%
    NEXT
  RETURN



Sat, 09 Dec 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. What's Wrong With MS' Site

2. What's wrong with this code?

3. What's wrong with this line?

4. What's wrong with this statement?

5. What's wrong with this code??

6. What's wrong with this OpenDatabase code?

7. Help - What's wrong with this ?

8. What's wrong with this code?

9. What's wrong with this code

10. What's wrong with this code?

11. Total newbie - What's wrong with this?

 

 
Powered by phpBB® Forum Software