When working in KM Editor, I often need to enter three forms of variable names:
%Variable%Local__VN%
$KMVAR_Local__VN
"$KMVAR_Local__VN"
I want to make a KMM:
step1: copy varname by hand
step2: this KMM will process the variable names stored in the system clipboard, generate three var name forms, generate a list, and store it in the variable Local__VN_LIST.
step3: this KMM will display these three var name forms in the Prompt with List window. The user selects one of them, and this KMM will save the selected var name to the system clipboard for future paste.
You can use display text to check that the output of Local__VN_LIST is correct. But after that, I found that this list could not be displayed correctly in the Prompt with List window. I tried several different forms and all failed.
the KMM is:
then I tried:
all failed.
after some tests, I find what's wrong.
If a variable name string contains a double underscore, the double underscore and the part before it cannot be displayed normally.
the KMM is kme - generate diff varname format (--sys-cb) v0.kmmacros (8.5 KB)
you can try the below:
the result is:
If you want to display a “friendly” value as the default value, but store a different value (like a code), you can do this by using a code followed by two underscores (__ ) and then the value, for example:
Here's one way around it, though you'd have to do some work to set up the variable correctly before the prompt with list:
Just to add to this: There used to be an advantage of using double underscores like that - so Prompt for User Input would drop off the leading "Local__". But sometime after that was first implemented, Prompt for User Input changed to exclude "Local_" with one underscore.
Wish that was configurable, like allow triple underscores to display the 'friendly' name. I have a lot of double underscore values. To get around this, I convert my values to _._ and after the Prompt with List selection, I convert the _._ back to double underscores __