how to check what system my script is running on

Find quick help here to get you started with Hollywood

how to check what system my script is running on

Postby peceha » Tue Mar 14, 2017 12:36 am

Hi
is there some straightforward way of checking if script is running on, let's say, classic amiga or windows?

At the moment I'm using something like:
Code: Select all
sysInfo=GetSystemInfo()
If Not HaveItem(sysInfo,"username")
 ; I assume it is amiga in that case
endif

Is there more elegant way of doing this?
I'm asking this question since whenever I run my program on classic amiga I have to uncomment ExitOnError(False) and set slightly different values for some variables (for speed reason).
peceha
 
Posts: 111
Joined: Tue Dec 13, 2016 9:39 am
Location: Poland

Re: how to check what system my script is running on

Postby airsoftsoftwair » Wed Mar 15, 2017 1:25 am

GetVersion() is your friend.
User avatar
airsoftsoftwair
 
Posts: 2293
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: how to check what system my script is running on

Postby peceha » Wed Mar 15, 2017 11:15 am

Thanks, I somehow overlooked that one.
peceha
 
Posts: 111
Joined: Tue Dec 13, 2016 9:39 am
Location: Poland

Re: how to check what system my script is running on

Postby peceha » Thu May 25, 2017 9:23 pm

Code: Select all
gv=GetVersion()
If gv.platform="AmigaOS3"
   TextOut(#CENTER,#CENTER,gv.platform)
   @DISPLAY 1,{
      width=320,
      height=256,
      mode="fullScreen",
      fixed=True,
      HidePointer=True
   }
Else
   @DISPLAY 1,{
      width=464,
      height=256,
      mode="FullScreenScale",
      fixed=True,
      HidePointer=True
   }
EndIf

When I run this on real Amiga the text AmigaOS3 gets displayed and... DISPLAY 1 gets all the data AFTER "else" ie: 464x256 and fullScreenScale
When I comment out "Else" part (with all the DISPLAY data) then it runs correctly.

Could anybody check this on Amiga if it is behaving same way as mine ?
peceha
 
Posts: 111
Joined: Tue Dec 13, 2016 9:39 am
Location: Poland

Re: how to check what system my script is running on

Postby airsoftsoftwair » Thu May 25, 2017 11:22 pm

You are mixing up two things here: Preprocessor commands are evaluated before the script is started so your code cannot work properly. Read this.
User avatar
airsoftsoftwair
 
Posts: 2293
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: how to check what system my script is running on

Postby peceha » Fri May 26, 2017 12:15 pm

Thank You.
peceha
 
Posts: 111
Joined: Tue Dec 13, 2016 9:39 am
Location: Poland

Re: how to check what system my script is running on

Postby zylesea » Tue Dec 12, 2017 12:50 am

airsoftsoftwair wrote:GetVersion() is your friend.


I would like a small change in the was getversion works: Currently it seems to extract the OS from the embedded Hollywood player target, I'd like if it would get the information from the OS itself somehow. It's affecting Amiga et al.: if you run a 68k compiled Hollywood program on MorphOS (I think on OS4 it's the same) getversion returns AmigaOS3, but not MorphOS - which the actual host is.
zylesea
 
Posts: 160
Joined: Tue Feb 16, 2010 1:50 am
Location: Westfalen/Germany

Re: how to check what system my script is running on

Postby airsoftsoftwair » Sat Dec 16, 2017 12:05 am

I think this can easily be implemented in script code. Just check for SYS:System/GrimReaper for OS4, SYS:MorphOS/Ambient for MorphOS etc. and you have it :-)
User avatar
airsoftsoftwair
 
Posts: 2293
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: how to check what system my script is running on

Postby zylesea » Mon Dec 18, 2017 9:27 pm

airsoftsoftwair wrote:I think this can easily be implemented in script code. Just check for SYS:System/GrimReaper for OS4, SYS:MorphOS/Ambient for MorphOS etc. and you have it :-)


That's an easy and good solution. Good hint.
zylesea
 
Posts: 160
Joined: Tue Feb 16, 2010 1:50 am
Location: Westfalen/Germany


Return to Newbie questions

Who is online

Users browsing this forum: No registered users and 1 guest