Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
ControlXtra
Creating Records - Valentina
Video Mask
Custom Check and Radio Buttons
Rollover Trigger-Alphamania
Rotate Forever-Alphamania
simComportIOCP Xtra
cXtraDialogs
Tempo Lingo
LiveCD
MediaMacros Xtras Mall
 

 

 

Behavior Replace tabs with spaces

Added on 7/1/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: ColeTierney

Handler function that replaces TABs with spaces and lines up columbs (intended for use with mono spaced fonts). From Cole Tierney"s Code Corner http://homepages.together.net/%7Etierney/cole/code/

--Side effect is a RETURN is added to text.
on deTab thisText, theTabSize  
  if NOT stringP( thisText ) then return ""  
  if integerP( theTabSize ) then set tabSize = theTabSize
  else set tabSize = 8    -- default tab size  
  set tabStr = ""
  repeat with i = 1 to tabSize
    put " " after tabStr
  end repeat  
  set newString = ""  
  set lineCount = the number of lines in thisText  
  repeat with i = 1 to lineCount    
    set thisLine = line i of thisText    
    if thisLine = "" then
      set newLine = " "
    else  -- LOOK FOR TAB CHARS      
      set newLine = ""
      set numOchars = the number of chars in thisLine    
      set tabCount = 0
      set charCount = 0
      repeat with j = 1 to numOchars      
        set aChar = char j of thisLine        
        if aChar <> TAB and aChar <> numToChar( 10 ) then
          put aChar after newLine
          set charCount = charCount + 1
        else          
          if aChar = TAB then            
            set padStr = char 1 to ( tabSize - charCount mod tabSize ) of tabStr            
            put padStr after newLine
            set charCount = charCount + length( padStr)          
            set tabCount = tabCount + 1            
          end if          
        end if        
      end repeat      
    end if    
    put newLine & RETURN after newString    
  end repeat  
  return newString  
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail