NoteWorthy Composer Forum

Forums => Tips & Tricks => User Tools => Topic started by: hmmueller on 2018-05-06 07:14 pm

Title: Bug (or unfortunate behavior) in nwcItem:Get()?
Post by: hmmueller on 2018-05-06 07:14 pm
Calling nwcItem:Get('ControllerName') on
Code: (nwc) [Select · Download]
|User|EnvelopeMaestro.hmm|Pos:-6.5|Class:StaffSig|Bottom:-6|Top:-1|ShowLocation:below|MinValue:60|Pen:dash|PenWidth:0.7|Controller:71|ShowAs:Blend|ControllerName:"Select by number"
yields '"Select by number"' - i.e., a string including the double apostrophes. As these are added by the serialization to the nwc or nwctxt file only for strings with spaces (the string '7:Volume', e.g., is serialized without double apostrophes), I would have expected that this "implementation detail" is not shown when calling :Get().

Also, an embedded \" is returned exactly like that in the string: as two characters, a backslash and a double apostrophe.

Altogether, right now I would have to do some postprocessing on :Get()'s result to get the actual value, wouldn't I?

H.M.
Title: Re: Bug (or unfortunate behavior) in nwcItem:Get()?
Post by: NoteWorthy Online on 2018-08-18 09:50 am
This seems like a bug in the nwcut library. User object uses cd.opt_Raw for parameters, when it should probably have used cd.opt_Text.

Since cd.opt_Text/nwcOptText uses a .Text member for access, I'll have to do some testing. It seems as though changing it now would break existing tools that work with user data.