Results 1 to 4 of 4

Thread: Performance Question

  1. #1

    Thread Starter
    Addicted Member Tiovital's Avatar
    Join Date
    Apr 2000
    Posts
    249

    Thumbs up

    HI,

    I need to translste a file from one chr to another chr, What is the best way - good performance - to achive that task?
    0) read the file
    1) call a function with 200 case in that function to translate chr after chr ?
    2) used Instr command ?
    3) any other way???

    Regards

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    What exactly do you want to do? Could you please explain your intentions a little better.
    Iain, thats with an i by the way!

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Open the file in binary, input all chr's in a byte array, use your algoritm (since you didn't tell us i guess you know) to convert each chr to the correct one

    Code:
    dim buffer() as byte
    ff=freefile
    Open yourfile for binary as ff
    get ff,,buffer
    close ff
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    Addicted Member Tiovital's Avatar
    Join Date
    Apr 2000
    Posts
    249
    Sorry folx,

    What i have to do is a convert a file (all chars) from 1 chr to another chr - say chr(210) to chr(89). i like to know in a Performence point of view!! what is the best way to it? this is not for encryption!!!.

    1) Call function Convert(byte)

    select byte
    case ..
    case ..
    ..
    ..
    - up to 255 times select
    2) Using instr instraction ?
    3) any other way?



    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width