English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

 
 
Thread Tools
Old 03 June 2020, 02:40   #1
quantum8
Registered User

 
Join Date: Jun 2019
Location: BNE AU
Posts: 164
AmigaDOS version check script

I'm writing a script and have run into issues when running it on 3.1 and 3.9, but it works great on 3.1.4 as it depends on a rather long script generated from the results of the LIST command.


Without spending much more time on rewriting the thing I'm thinking of putting in an OS version check in the script but I'm having issues with that too.


It seems the method below can tell me if I'm trying with 3.1, but it can't distinguish between 3.9 (45.127) and 3.1.4 (45.194) due to the major release version being the same. Adding the minor version seems to cause it to fail completely. Are there better ways of performing this check?




VERSION >nil: workbench.library 45
IF WARN
echo "This script will only function on AmigaOS 3.1.4 or later."
QUIT 20
ENDIF

quantum8 is offline  
Old 03 June 2020, 06:15   #2
Minuous
Coder/webmaster/gamer
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,112
If the major versions are the same, call Version again but this time with the REVISION keyword, and it will use the minor version instead. Eg. something like this:

VERSION >nil: workbench.library 45
IF WARN
echo "This script will only function on AmigaOS 3.1.4 or later."
QUIT
ENDIF
VERSION >nil: workbench.library 46
IF WARN
VERSION >NIL: workbench.library REVISION 194
IF WARN
echo "This script will only function on AmigaOS 3.1.4 or later."
QUIT
ENDIF
ENDIF

Last edited by Minuous; 03 June 2020 at 06:24.
Minuous is offline  
Old 03 June 2020, 17:49   #3
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,035
Quote:
Originally Posted by quantum8 View Post
it can't distinguish between 3.9 (45.127) and 3.1.4 (45.194)

Which function do you need which is in workbench.library 45.194 which is not in 45.127? I can't think of any.

If you need a certain component of AmigaOS at a specific level, then you should check that component and not a completely unrelated one.

Most components of 3.1.4 are at version 46, workbench.library is one of the exceptions.
thomas is offline  
Old 03 June 2020, 18:11   #4
Minuous
Coder/webmaster/gamer
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,112
Yes, you should be checking the version of the List command instead of workbench.library, as Thomas points out.
Minuous is offline  
Old 04 June 2020, 01:12   #5
quantum8
Registered User

 
Join Date: Jun 2019
Location: BNE AU
Posts: 164
I was so deep in it that I forgot the obvious! Thanks for the suggestions here, I'll use version of list as a decider.

As a side note, I copied the list command to 3.1 and the script still failed at the list command. I guess the CLI can't parse lines over a certain length on 3.1/3.9.

Opening the script in ED and moving to the line where the list command is and the status area pops up with "line too long" error. It appears to be a 200 character limit, not sure if that's OS or ED related though.
quantum8 is offline  
Old 04 June 2020, 14:28   #6
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,567
ED doesn't like to long lines. Command line length is limited to something like ~250 chars.
daxb is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
AmigaDos script help liviux76 Coders. Scripting 8 09 November 2017 16:20
AmigaDOS script: Replacing characters and checking if directory is empty Frankie Coders. Scripting 4 24 September 2017 19:40
Using VERSION command on a script Akira support.Apps 8 21 October 2016 00:48
How to check free space within a script gulliver support.Apps 9 22 May 2015 16:35
AmigaDos script file help. T_hairy_bootson support.Apps 0 07 March 2006 10:15

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07121 seconds with 14 queries