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: 187
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,155
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,084
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,155
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: 187
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,656
ED doesn't like to long lines. Command line length is limited to something like ~250 chars.
daxb is online now  
Old 08 August 2020, 13:17   #7
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 573
Quote:
Originally Posted by quantum8 View Post
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.
In 3.1, there is a maximum line limit of 512 characters for the Shell. This limit fell with the v45 shell and hence at least one of the BBs of 3.9. For same reason, there is no such limit in 3.1.4 either, the Shell can process arbitrarily long lines (ok, limited by free memory of course).


Quote:
Originally Posted by quantum8 View Post
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.
That is an "Ed" limit. "Ed" is a fairly primitive design, with a fixed size buffer and fixed line length limit.
Thomas Richter is offline  
Old 18 August 2020, 13:38   #8
Tomislav
Registered User

 
Join Date: Aug 2014
Location: Zagreb / Croatia
Posts: 231
KickStarts which workbench.library is NOT in ROM are A4000T, 3.X, "3.9" (custom user 3.1 ROM), 3.1.4 and I think future 3.2. That means that workbench.library can not be used to verify version of KickStart ROM. Maybe better to test exec.library version.

OSes 3.5 and 3.9 are for use with KickStart 3.1. Eventually can use custom "3.9" KickStart. For those OSes is better to test version.library which is in LIBS directory.
Tomislav is online now  
 


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 14:14.


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