|
Llohr Apprentice
Joined: 17 May 2005 Posts: 108
|
Posted: Tue Feb 02, 2016 5:47 pm
Explicit Pathing |
Any reason I shouldn't do something like this:
Code: |
#execute {//%char/class/varname=value} |
I've had a lot of trouble in the past with using variable paths when explicitly pathing things. My hacky workarounds function 99% of the time, but I want that other 1%. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4702 Location: Pensacola, FL, USA
|
Posted: Tue Feb 02, 2016 6:57 pm |
Using #EXECUTE is only frowned upon because it takes more system resources.
I have never noticed a speed performance hit myself. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Llohr Apprentice
Joined: 17 May 2005 Posts: 108
|
Posted: Tue Feb 02, 2016 10:01 pm |
Excellent, the old hack
Code: |
#addkey %expand(//%char/Affects/ACStart, 1) %char 1 |
works, but if things go bad, that sort of thing tends to quit working before anything else. It also doesn't reliably work on packages people download from the library.
Looks like I DO need to make one amendment to the syntax though.
Code: |
#execute {//%char/class/variable={value}} |
Will clear the value if it's left blank, which is generally what I want. |
|
|
|
Llohr Apprentice
Joined: 17 May 2005 Posts: 108
|
Posted: Wed Feb 03, 2016 1:05 am |
If anybody's keeping score at home, this doesn't work:
Code: |
#execute {//%char/class/variable={key1=val1|key2=val2}} |
but this does:
Code: |
$Somevar={key1=val1|key2=val2}
#execute {//%char/class/variable={$Somevar}} |
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4702 Location: Pensacola, FL, USA
|
Posted: Wed Feb 03, 2016 2:50 am |
Yes, the use of local variables is recommended when dealing with database variables, or anything with a complicated variable name.
Given that you want to use full path names, you might want to consider making a setter alias to make such declarations easier |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|