Skip to main content
Topic: Bug (or unfortunate behavior) in nwcItem:Get()? (Read 5105 times) previous topic - next topic

Bug (or unfortunate behavior) in nwcItem:Get()?

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.

 

Re: Bug (or unfortunate behavior) in nwcItem:Get()?

Reply #1
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.