Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

Ignore:
Timestamp:
06/06/08 12:41:29 (4 years ago)
Author:
alex
Message:

fixed convert line breaks bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib1/svn_Utilities.ls

    r173 r178  
    472472on mExportAllScriptsToDiskWithFolder me, skipIcons, selectionOnly, convertLineBreaksToUnix, theFolder, chooseNewPath 
    473473   
     474   
    474475  theFolder = string(theFolder) 
    475476  if length(theFolder) < 1 then 
     
    528529   
    529530   
    530    
    531    
    532531  isMac = (the platform contains "mac") -- we need the differentiation because of the dreaded 31 char limit 
    533532   
     
    572571         
    573572        memtype = memref.type 
     573         
     574         
     575        convertLineBreaksToUnixT = 0 
    574576         
    575577        -- if [#script].getPos(memtype) > 0 then 
     
    592594              ext = ".html" 
    593595              scrText = memref.html 
    594               convertLineBreaksToUnix = 0 
     596              convertLineBreaksToUnixT = 0 
    595597              scrtype = #text 
    596598              ----------------------- 
     
    684686           
    685687          if convertLineBreaksToUnix = 1 then 
    686              
    687             if mCheckForXtra(me, "Pregex") = 1 then 
    688                
    689               scrTextLi = [scrText] 
    690               pregex_replace(scrTextLi, "\x0D\x0A?", "g", "\x0A") 
    691               scrText = scrTextLi[1] 
    692                
    693             else 
    694                
    695               fndStr = numToChar(13) & numToChar(10) 
    696               offs = offset(fndStr, scrText) 
    697               repeat while offs > 0 
    698                 delete char offs of scrText 
     688            if convertLineBreaksToUnixT <> 1 then 
     689              if mCheckForXtra(me, "Pregex") = 1 then 
     690                 
     691                scrTextLi = [scrText] 
     692                pregex_replace(scrTextLi, "\x0D\x0A?", "g", "\x0A") 
     693                scrText = scrTextLi[1] 
     694                 
     695              else 
     696                 
     697                fndStr = numToChar(13) & numToChar(10) 
    699698                offs = offset(fndStr, scrText) 
    700               end repeat 
    701                
    702               fndStr = numToChar(13) 
    703               offs = offset(fndStr, scrText) 
    704               repeat while offs > 0 
    705                 put numToChar(10) into char offs of scrText 
     699                repeat while offs > 0 
     700                  delete char offs of scrText 
     701                  offs = offset(fndStr, scrText) 
     702                end repeat 
     703                 
     704                fndStr = numToChar(13) 
    706705                offs = offset(fndStr, scrText) 
    707               end repeat 
    708                
     706                repeat while offs > 0 
     707                  put numToChar(10) into char offs of scrText 
     708                  offs = offset(fndStr, scrText) 
     709                end repeat 
     710              end if  
    709711            end if 
    710712          end if 
    711713          ----------------------------------------- 
    712            
    713714           
    714715          if theDefaultName <> origname then 
     
    727728            noChanges = (mRemoveWhiteSpaces(me, scrText&"") = mRemoveWhiteSpaces(me, alterText&"")) 
    728729             
     730             
    729731            if noChanges = 0 then 
    730732               
    731                
    732733              mSaveToTextFile me, scrText, thisFolder & theDefaultName & ext 
    733                
    734734               
    735735              bmexp = 0 
Note: See TracChangeset for help on using the changeset viewer.