-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
input() PROPS option no longer works. #1278
Comments
Not the same build at all. |
@Merudo Appears to be a casualty of the input() changes. |
BTW, having a json option for "props" where it uses the key value for the label and value for the data would be awesome. Then I could have multiple word labels. |
@aliasmask it might be doable. What do you suggest the option be called? |
I figured it just keep the PROPS option and just note if the format is a JSON object rather than a string prop then it just use that. I would hate to try and write the raw json part out would likely always use strformat to put in the json. But maybe it's easier to specify it as an option like type=json. So, given the above:
|
I think if it could determine the type between the |'s, type=json would actually specify the return type. So, you could have "a" as a string prop and test would return a json object. Going the other way doesn't work well with the limitations of string props, ie a is a json and test is a string prop. |
So there would be two parameters, one for the values to display and one for the return type? Or do you suggest the type for the values to display be automatically determined? |
- Fix props type not working with input() - Add option WIDTH to props. It works the same as WIDTH for text, except it defaults to 14 instead of 16 - Default behavior of props is left unchanged compared to 1.5.12 - Close RPTools#1278
PR #1280 fixes the bug with PROPS. |
New Option for PROPS type: WIDTH . Same as for TEXT with a default of 14. |
Tested. PROPS input type working as expected. New WIDTH option working. |
- Add json support to input() props: a json object can now hold the labels and values instead of a string property list - Remove ParserException try/catch for cases where no ParserException could be thrown - Discussed in RPTools#1278 - Example: [H: a = json.set("{}","one",1,"two",2)] [H: input(strformat("test|%{a}|Test|PROPS"))]
PR #1283 adds the feature. Example:
|
Does "test" become a json object or remain a string prop when a json is used for key/value pairs? I just tested the json functions for converting and they would work fine if not converted to json with an invalid string prop key like "two words=1;" |
returns
|
- Add option TYPE=JSON to input() PROPS, in which case the input will store the output as a json instead of a string property list - Discussed in RPTools#1278
PR #1286 adds option Example:
returns |
Yeah, I noticed the string prop was more forgiving. Not sure when that happened. Something like "Little Jon=1" would only display "Little" and "1" for value. But now it seems fine. Still happy about the type=json option. I never use it, but I wonder how using setvars=unsuffixed would work with an "invalid" name for a local property assignment. |
New options tested. Wiki page updated. Closing. |
Describe the bug
I'm getting an error in alpha 6 that I don't get in 1.5.12. Apparently the PROPS option no longer works. Gives null pointer exception error.
To Reproduce
[input("test|one=1;two=2;|Test|props")]
Expected behavior
Should give me fields "one" and "two" with their values.
MapTool Info
Other
I thought alpha 6 and 1.5.12 was the same build, but with html5 stuff. I do recall mention a change to input() to include json options. Maybe that change was implemented in alpha 6 and has a bug in it.
The text was updated successfully, but these errors were encountered: