|
Zwartje Novice
Joined: 08 Feb 2007 Posts: 45
|
Posted: Wed May 02, 2007 10:24 pm
using variables in pathnames |
I cannot figure out how to do this, any advice welcome.
I have a defined path:
Name: path1
Value: 5ej2e
Now I want to dinamically run this path using a variable:
Name: runpath
Value:
#VAR varpath %concat(.,path,%1)
#send (@varpath)
This doesnt work however.
What I want is that when I use 'runpath 1' CMUD sends .5ej2e to the mud
I also tried
.{@varpath}
#exec @varpath
to no avail |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu May 03, 2007 3:03 am |
paths can be named. No need for a variable, just #send .mypath or whatever is the proper method (not sure if paths will expand in a #SEND, but they should).
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Zwartje Novice
Joined: 08 Feb 2007 Posts: 45
|
Posted: Thu May 03, 2007 7:13 am |
Thanks for the answer MattLofton, but its not entirely what I am looking for.
The idea is that I could dynamically call a path.
Now I only have path1, but the purpose is to have many more, path2, path3, ...
I could of course put a
#switch (%1=1) {.path1} (%1=2) {.path2} ...
but I hoped for another way |
|
|
|
Zwartje Novice
Joined: 08 Feb 2007 Posts: 45
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri May 04, 2007 5:03 pm |
$path=%concat(%exec(.path1),%exec(.%1))
#forall $path {#send %i}
This is untested as I am at work. Also I am not sure exactly what you want. I haven't read the other thread. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri May 04, 2007 5:25 pm |
This worked for me:
Code: |
#PATH path1 {.5ej2e}
#alias runpath {#EXEC %concat(".",%1)}
runpath path1 |
You need to make sure you have the English Directions package loaded. If you just try to test this in the default "untitled" session, it won't work because English Directions isn't loaded. But if you create a new session that has English Directions in the list of loaded packages, then it works fine. |
|
|
|
|
|