How to replace just the first found space with tab for all lines in a variable?

Jim Ault jimaultwins at yahoo.com
Thu May 26 01:19:28 EDT 2011


Just to satisfy your curiosity....
how long would it take to do a million lines?

--------------  working code

on trythisForSpeed

    put 100100 into weaponOfMassConstruction

    repeat weaponOfMassConstruction times
       get the seconds
       put IT && IT && IT & cr after massiveList
    end repeat

    put the ticks into startt
    repeat for each line tLine in massiveList
       put word 1 of tLine&  tab&  word 2 to -1 of tLine&  return  
after tResultTable
    end repeat
    filter tResultTable without empty

    put the ticks - startt into elapsedTks
    if elapsedTks = 0 then
       put "Too fast to measure 'cause it took less than 1 tick"
    else
       put "elapsed =" && elapsedTks && "ticks thus" \
              && elapsedTks/60 && "seconds" & cr \
              && "or" && weaponOfMassConstruction/elapsedTks \
              && "address lines per tick" & cr \
              && "or approx" \
              && 60*(weaponOfMassConstruction/elapsedTks) \
              && "per second"

    end if

end trythisForSpeed
--------------  end working code

Jim Ault
Las Vegas






More information about the use-livecode mailing list