end of line code fix

Kee Nethery kee at kagi.com
Fri Aug 30 14:56:04 EDT 2002

There was a typo in the code I submitted earlier, sorry.

My newly created function calls to make sure I do the right thing 
with the data I get from a database are:

function adjustLineEndOS thetext
   replace (numtochar(13) & numtochar(10)) with numtochar(13) in thetext
   replace numtochar(10) with numtochar(13) in thetext
   -- ooops, this next line had a typo (now corrected)
   replace numtochar(13) with getLineEnd() in thetext
   return thetext
end adjustLineEndOS

function getLineEnd
   switch platform()
   case "Win32"
     put numtochar(13) & numtochar(10) into lineEnd
   case "MacOS"
     put the systemVersion into ver
     put char 1 to (offset(".",ver)-1) of ver into ver
     if ver > 9 then
       put numtochar(10) into lineEnd
       put numtochar(13) into lineEnd
     end if
     put numtochar(10) into lineEnd
   end switch
   return lineEnd
end getLineEnd

More information about the Use-livecode mailing list