Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
45 user(s) are online (39 user(s) are browsing Forums)

Members: 0
Guests: 45

more...

Support us!

Headlines

 
  Register To Post  

Scripting help plox
Quite a regular
Quite a regular


See User information
Hi,

2 questions, firstly AMIGADOS:

Self-explanatory, how do I get this to work?

version c:smbfs >ENV:smbfsver
if $smbfsver >=1.66
echo "here"
else
echo "lower than 1.66"
endif

Secondly, Arexx:

options results

id='req'pragma('id')
address command 'rxset' id $jack_destination
path=getclip(id)
call setclip(id,'')

address workbench
window windows path open

---

This works fine, but how do I join strings?

I want to be able to do this:

Lets asume $jack_destination = RAM Disk:

address command 'rxset' id $jack_destination + Jack/

I would also love to not only open the destination drawer, but launch the actual application, but with limitated documentation it is hard to work with environment variables in both AmigaDOS and Arexx.


Go to top
Re: Scripting help plox
Just can't stay away
Just can't stay away


See User information
@djrikki
Quote:
if $smbfsver >=1.66

With AmigaDOS scripts it's:
IF 1.66 GE $smbfsver

It looks there's not lesser than option. (I remembered it should exist. At least in older AmigaOS versions ?)

Put IF ? into a script to get all arguments listed.

GT = greater than
GE = greater or equal
Quote: "NOTE: You can use NOT GE for LT and NOT GT for LE."
EQ = equal
...

(Edit: I found the documentation...)
sys:Documentation/C/
sys:Documentation/C/shell.doc

@AmigaOS devs
It's required to put IF into a script but when typing IF ? into a Shell it should display all arguments IMHO, shouldn't it ?!?


Edited by TSK on 2011/6/18 17:02:53
Edited by TSK on 2011/6/18 17:03:58
Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: Scripting help plox
Quite a regular
Quite a regular


See User information
I already tried that...

IF: wrong number of arguments... $smbfsver contains text as well: smbfs 1.66

NAME,VERSION/N,REVISION/N,FILE/S,FULL/S,UNIT/N,INTERNAL/S,RES/S,VSTRING/S:

Playing around I cannot seem to get the number only.

Go to top
Re: Scripting help plox
Just can't stay away
Just can't stay away


See User information
@djrikki
Try this:
Version C:smbfs version=1 revision=66 >nil:
IF WARN
Echo "Version too old"
ELSE
Echo "Version ok"
ENDIF

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: Scripting help plox
Quite a regular
Quite a regular


See User information
Thanks TSK.

Yeah I just looked on Aminet and came across Frank Burton's AmigaDOS for Beginners... what you wrote is exactly what I should do.

I would have never have guessed that!

Go to top
Re: Scripting help plox
Amigans Defender
Amigans Defender


See User information
2. ARexx

I don't have a clue what that code is doing, however have a play around with the PathPart AmigaDOS command - it joins and splits paths.

Otherwise you can put something together in ARexx which checks if the last character of the initial string ends in : or /, add / if it doesn't and then append whatever the next part of the path is. That should work in the majority of cases.

Go to top
Re: Scripting help plox
Quite a regular
Quite a regular


See User information
@djrikki

You can simpy join strings in ARexx with '||', something like this:

text text||"Eine oder mehrere Umgebungsvariablen"||nl||,"sind nicht zu finden/zu öffnen !"


Further ARexx has some powerful DOS extensions, that should be able to retrieve pathes, filenames etc. for you.

BTW: Why not use a newer version of SMBFS? (Version 1.74: http://amiga-smbfs.sourceforge.net/)

X1000|II/G4|440ep|2000/060|2000/040|1000
Go to top
Re: Scripting help plox
Just can't stay away
Just can't stay away


See User information
@djrikki

Quote:
but with limitated documentation it is hard to work with environment variables in both AmigaDOS and Arexx.

Arexx documentation
http://aminet.net/package/util/rexx/ARexxGuide2_0A


@TSK
Quote:
It looks there's not lesser than option. (I remembered it should exist. At least in older AmigaOS versions ?)

Quote:
It's required to put IF into a script but when typing IF ? into a Shell it should display all arguments IMHO, shouldn't it ?!?

I reported both already.


Edited by Elwood on 2011/6/18 23:07:48
Philippe 'Elwood' FERRUCCI
Sam460ex 1.10 Ghz
http://elwoodb.free.fr
Go to top
Re: Scripting help plox
Just can't stay away
Just can't stay away


See User information
@djrkki
Try this:
set jackpath `PATHPART ADD "$jack_destination" "jack"`
echo $jackpath

Keep in mind that the hashmarks " `" are not the same as apostrophe " ' "


Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top

  Register To Post

 




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




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project