platform() = MacOS (9 with ascii(13) or X with ascii(10))?

Richard Gaskin ambassador at fourthworld.com
Fri Aug 30 12:25:01 CDT 2002


Kee Nethery wrote:

> Regardless whether CR is platform specific, I know that Mac OS 9 uses
> a ascii(13) to delimit lines and I assume revolution honors that on
> Mac OS 9. It appears that revolution in Mac OS X uses ascii(10) to
> delimit lines.
> 
> Since platform() is supposed to return "MacOS" for both versions of
> the MacOS and because the two platforms appear to use different line
> endings in Revolution ... how do I tell whether I need to convert
> line endings from ascii(13) to ascii(10) or leave them as ascii(13)?
> 
> How do I know which MacOS I am on given that Revolution appears to
> treat them differently?



function IsOSX
  if the platform is not "MacOS" then return false
  get the systemversion
  set the itemdel to "."
  if item 1 of it >= 10 then return true
  return false
end IsOSX


But if you read in text mode you won't have to worry about converting line
endings, as it will be done for you by the engine.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Custom Software and Web Development for All Major Platforms
 Developer of WebMerge 2.0: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list