 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sun Nov 26, 2006 12:45 am
[1.16] #PSUB issues (stripping and expansion) |
ISSUE 1: #PSUBs created via the command line strip their delimiters
In the command line of a blank session type:
#TRIGGER "test1" {ABC (%w) GHI(.)} {$testvar=%1;#PSUB {. $testvar} %x2}
In the settings editor click on the test1 trigger, note that the {}'s in the #PSUB have been stripped add in the {}'s around . $testvar they are needed for the next example.
ISSUE 2: #PSUB not expanding its arguments
Using the "fixed" trigger from Issue 1 enter this into the command line
#SHOW "ABC XYZ GHI."
Output is:
ABC XYZ GHI. $testvar
Expected Output:
ABC XYZ GHI. XYZ |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Nov 27, 2006 7:46 pm |
Added to bug list. I wonder if the problem with $testvar not expanding is because of the . in front of it? That's a bit of a wierd syntax. Have you tried putting quotes around it, like ". "$testvar or using %concat(". ", $testvar) ?
|
|
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Mon Nov 27, 2006 11:49 pm |
Actually its not really weird in Zmud it would be #PSUB {. @testvar} %x2 Which would just replace the period and add the text after it. and as another note this is stripped down pretty bare bones to actually help you narrow it down.
The weird PSUB syntax is here http://forums.zuggsoft.com/phpbb/viewtopic.php?t=25580
But not to get us too far off topic you are right about the . causing problems in cmud yet it still doesnt work correctly. (tried a few your way posting the bugginess)
First issue change the trigger script to read
$testvar=%1;#PSUB {$testvar} %x2
#SHOW "ABC XYZ GHI."
Output is:
ABC XYZ GHI$testvar
Expected Output:
ABC XYZ GHIXYZ
But this only happens with $localvars possibly a scoping issue?
change the code script to read:
$testvar=%1;#PSUB {%lower($testvar)} %x2
#SHOW "ABC XYZ GHI."
Output is:
ABC XYZ GHI%lower($testvar)
Expected Output:
ABC XYZ GHIxyz
but lets not rule out the ". " yet which shouldnt cause a problem after all a . expands to a . right? this example worked correctly in zmud
$testvar=%1;#PSUB {". "@testvar} %x2
testvar=LLL
#SHOW "ABC XYZ GHI."
Output is:
ABC XYZ GHI. LLL
Expected Output:
ABC XYZ GHI. LLL
So that works for regular variables and functions but the same syntax won't work for local vars or functions around local vars so
In summary Localvars won't expand at all in a psub, a period (.) then a space then a function or var won't expand correctly.
I work with alot of Data Records, Conditional Triggers and Psubs/Pcols this is where you will see most of my bug reports centering around and since they tend to be of a more advanced and/or weird syntax they are harder for me to explain.
I <3 Cmud and all your hard work on it! |
|
|
|
 |
|
|
|