04-23-2016, 05:29 PM | #1 |
Human being with feelings
Join Date: Apr 2012
Location: Christchurch, New Zealand
Posts: 482
|
JSFX: 'match' not allowing for degenerate @0s at end of string (FIXED)
Okay, so here's the problem:
Code:
desc: String Matching Scenario @init #string = "StartMiddleEnd"; match("%0sStart%s", #string, #beforeStart, #middleEnd); // matches: #beforeStart = "" and #middleEnd = "MiddleEnd" match("Start%0sMiddle%s", #string, #betweenStartAndMiddle, #end); // matches: #betweenStartAndMiddle = "" and #end = "End" match("%sEnd%0s", #string, #startMiddle, #pastEnd); // doesn't match (but should): no string values assigned As you can see, elsewhere in the string it works as specified. My workaround is a backup case in the match chain (without the %0s at the end) that forces a "" for #pastEnd. However, this clutters the code unnecessarily and adds another computation into the works, as well as being rather confusing behaviour to debug. Any chance of fixing this?
__________________
VI Folio - plugins for virtual instruments (EAP) Last edited by ijijn; 04-23-2016 at 06:13 PM. Reason: oops, I meant %0s... never mind :D |
04-23-2016, 06:25 PM | #2 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,117
|
Thanks, fixing!
|
04-23-2016, 06:56 PM | #3 |
Human being with feelings
Join Date: Apr 2012
Location: Christchurch, New Zealand
Posts: 482
|
__________________
VI Folio - plugins for virtual instruments (EAP) |
Thread Tools | |
Display Modes | |
|
|