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: 110
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: 2202
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: 110
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: 110
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: 2202
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: 110
Joined: Tue Dec 13, 2016 9:39 am
Location: Poland


Return to Newbie questions

Who is online

Users browsing this forum: No registered users and 2 guests