English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 23 January 2009, 05:35   #1
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Passing arguments to scripts

I was hoping that "script A B C" would pass the arguments into the local $0 $1 $2 etc. but unfortunately it doesn't. Is it possible to do this in a single line somehow without writing a tool for it? I'd be happy to use an existing tool if there is one.
Leffmann is offline  
Old 23 January 2009, 08:19   #2
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,750
If you mean AmigaDos, then this is how to do it:
Code:
.key opt1,opt2,opt3,opt4

echo <opt1>
echo <opt2>
echo <opt3>
echo <opt4>
Or:
Code:
.key opt1,opt2,opt3,opt4
.bra {
.ket }

echo {opt1}
echo {opt2}
echo {opt3}
echo {opt4}
You can make the argument names just about anything you want, and they're displayd when you type: scriptname ?

Last edited by Thorham; 23 January 2009 at 18:57.
Thorham is online now  
Old 23 January 2009, 13:44   #3
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
That's exactly what I was looking for. Thanks Thorham
Leffmann is offline  
Old 23 January 2009, 18:58   #4
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,750
Quote:
Originally Posted by Leffmann View Post
That's exactly what I was looking for.
That's what I thought
Quote:
Originally Posted by Leffmann View Post
Thanks Thorham
You're welcome
Thorham is online now  
Old 23 January 2009, 20:43   #5
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,644
Oooh I love AmigaDOS scripting!
I need to get back to it, I used to have some mad codes xD
Amiga1992 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
Invalid workbench arguments Wasagi project.WHDLoad 2 22 February 2021 21:16
Executable script file/arguments shrub3056 support.Apps 1 26 July 2011 18:08
AmigaDOS scripts lloyd Coders. General 2 22 November 2004 19:47
I don't want to be the cause of more arguments, but... MethodGit Retrogaming General Discussion 27 08 October 2004 15:45
Norwegians passing thru OSLO? PLEASE READ :) AmiDelf Amiga scene 0 29 September 2003 15:11

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 08:12.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09688 seconds with 15 queries