Differentiating Classic from OS9

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Differentiating Classic from OS9

Revolution


The systemversion returns 9.2.2 in both Classic (on OSX) and on a real OS9 box. I
need to differentiate between them.

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Differentiating Classic from OS9

masmit
This does not cover the case where you have a dual-boot G4 which has  
booted from system 9, but otherwise might work:

function system9IsClassic
   if there is a folder "/System" then
     return true
   else
     return false
   end if
end system9IsClassic

Best,

Mark


On 3 May 2006, at 13:04, <[hidden email]>  
<[hidden email]> wrote:

>
>
> The systemversion returns 9.2.2 in both Classic (on OSX) and on a  
> real OS9 box. I
> need to differentiate between them.
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Differentiating Classic from OS9

Jim Ault
You could try using the BinaryDecode reading a preferences file or other
part of the System folder.  This may get you a unique string for the test.

open file [pathh/filename]
read from file [pathh/filename] at 0 for 2000
put BinaryDecode(h4h4h4h4h4h4h4,it,p1,p2,p3,p4,p5,p6,p7)
--now test variables p1 to p7 and see if they are the same in both versions

The docs may give you a better decode than h in your case.  Just a guess.

Jim Ault
Las Vegas


On 5/3/06 5:14 AM, "Mark Smith" <[hidden email]> wrote:

> This does not cover the case where you have a dual-boot G4 which has
> booted from system 9, but otherwise might work:
>
> function system9IsClassic
>    if there is a folder "/System" then
>      return true
>    else
>      return false
>    end if
> end system9IsClassic
>
> Best,
>
> Mark
>
>
> On 3 May 2006, at 13:04, <[hidden email]>
> <[hidden email]> wrote:
>
>>
>>
>> The systemversion returns 9.2.2 in both Classic (on OSX) and on a
>> real OS9 box. I
>> need to differentiate between them.
>>


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Differentiating Classic from OS9

Jim Ault
The exact syntax for the decode is
 put BinaryDecode("h4h4h4h4h4h4h4",it,p1,p2,p3,p4,p5,p6,p7)

Jim Ault
Las Vegas

On 5/3/06 6:58 AM, "Jim Ault" <[hidden email]> wrote:

> You could try using the BinaryDecode reading a preferences file or other
> part of the System folder.  This may get you a unique string for the test.
>
> open file [pathh/filename]
> read from file [pathh/filename] at 0 for 2000
> put BinaryDecode(h4h4h4h4h4h4h4,it,p1,p2,p3,p4,p5,p6,p7)
> --now test variables p1 to p7 and see if they are the same in both versions
>
> The docs may give you a better decode than h in your case.  Just a guess.
>
> Jim Ault
> Las Vegas
>
>
> On 5/3/06 5:14 AM, "Mark Smith" <[hidden email]> wrote:
>
>> This does not cover the case where you have a dual-boot G4 which has
>> booted from system 9, but otherwise might work:
>>
>> function system9IsClassic
>>    if there is a folder "/System" then
>>      return true
>>    else
>>      return false
>>    end if
>> end system9IsClassic
>>
>> Best,
>>
>> Mark
>>
>>
>> On 3 May 2006, at 13:04, <[hidden email]>
>> <[hidden email]> wrote:
>>
>>>
>>>
>>> The systemversion returns 9.2.2 in both Classic (on OSX) and on a
>>> real OS9 box. I
>>> need to differentiate between them.
>>>
>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Differentiating Classic from OS9

Ken Ray
In reply to this post by Revolution
On 5/3/06 7:04 AM, "[hidden email]"
<[hidden email]> wrote:

>
>
>
>
> The systemversion returns 9.2.2 in both Classic (on OSX) and on a real OS9
> box. I
>
> need to differentiate between them.

Here's how to tell if Classic mode is running on the computer:

function stsIsClassicModeRunning
  put format("tell app \"Finder\"\nget the processes\nend tell") into tAS
  do tAS as "AppleScript"
  put format("application process \"Classic Support\"") into
tClassicProcName
  return (the result contains tClassicProcName)
end stsIsClassicModeRunning


And here's how to tell if your stack is actually running in an app under
Classic mode, or whether it is running in an app in OS X (watch for line
wraps):

function stsInClassicMode
  -- First, check to see if we're running on OS X
  if the fileName of this stack contains "Contents/MacOS/" then return
"false"
 
  -- Second, check to see if the process "Classic Support" is in
  -- the current process list. This will be true when running in OS X
  -- Classic mode, but will be false if running in OS 9.
  -- If true, then the app is a PPC app and Classic Mode is running, so it
  -- must be running in Classic Mode.
  -- If false, then the app is a PPC app and Classic Mode is *not* running,
  -- which would mean that the app is running in OS 9 and not in
  -- Classic Mode.
  return stsIsClassicModeRunning()
end stsInClassicMode

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Differentiating Classic from OS9

xtalkprogrammer
Hi Ken,

This line

> if the fileName of this stack contains "Contents/MacOS/" then return
> "false"

will not work of the application is running as a commawnd line  
utility or as a faceless application.

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Salery is the easiest way to get your own web store on-line: http://
www.salery.biz/salery.html



Op 3-mei-2006, om 17:39 heeft Ken Ray het volgende geschreven:

> On 5/3/06 7:04 AM, "[hidden email]"
> <[hidden email]> wrote:
>
>>
>>
>>
>>
>> The systemversion returns 9.2.2 in both Classic (on OSX) and on a  
>> real OS9
>> box. I
>>
>> need to differentiate between them.
>
> Here's how to tell if Classic mode is running on the computer:
>
<snip>



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553
Reply | Threaded
Open this post in threaded view
|

Re: Differentiating Classic from OS9

xtalkprogrammer
In reply to this post by Ken Ray
Hi,

I was too quick. Even though that particular line doesn't always  
work, it doesn't harm either, if the standalone is running as a  
faceless app or launched from the command line.

Best,

Mark

> Hi Ken,
>
> This line
>
>> if the fileName of this stack contains "Contents/MacOS/" then return
>> "false"
>
> will not work of the application is running as a commawnd line  
> utility or as a faceless application.
>
> Best,
>
> Mark
>
> --
>
> Economy-x-Talk
> Consultancy and Software Engineering
> http://economy-x-talk.com
> http://www.salery.biz
>
> Salery is the easiest way to get your own web store on-line: http://
> www.salery.biz/salery.html
>
>
>
> Op 3-mei-2006, om 17:39 heeft Ken Ray het volgende geschreven:
>
>> On 5/3/06 7:04 AM, "[hidden email]"
>> <[hidden email]> wrote:
>>
>>>
>>>
>>>
>>>
>>> The systemversion returns 9.2.2 in both Classic (on OSX) and on a  
>>> real OS9
>>> box. I
>>>
>>> need to differentiate between them.
>>
>> Here's how to tell if Classic mode is running on the computer:
>>
> <snip>
>
>
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553