Page 1 of 1

how to check what system my script is running on

Posted: Mon Mar 13, 2017 11:36 pm
by peceha
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).

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

Posted: Wed Mar 15, 2017 12:25 am
by airsoftsoftwair
GetVersion() is your friend.

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

Posted: Wed Mar 15, 2017 10:15 am
by peceha
Thanks, I somehow overlooked that one.

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

Posted: Thu May 25, 2017 9:23 pm
by peceha

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 ?

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

Posted: Thu May 25, 2017 11:22 pm
by airsoftsoftwair
You are mixing up two things here: Preprocessor commands are evaluated before the script is started so your code cannot work properly. Read this.

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

Posted: Fri May 26, 2017 12:15 pm
by peceha
Thank You.

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

Posted: Mon Dec 11, 2017 11:50 pm
by zylesea
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.

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

Posted: Fri Dec 15, 2017 11:05 pm
by airsoftsoftwair
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 :-)

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

Posted: Mon Dec 18, 2017 8:27 pm
by zylesea
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.