Skip to content
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

[Bug]: varsFromStrProp() parameter issues. #5047

Open
FullBleed opened this issue Nov 15, 2024 · 0 comments
Open

[Bug]: varsFromStrProp() parameter issues. #5047

FullBleed opened this issue Nov 15, 2024 · 0 comments
Labels

Comments

@FullBleed
Copy link

FullBleed commented Nov 15, 2024

Describe the Bug

I found that the wiki did not show how to use a non default delimiter with varsFromStrProp. In testing I found that while you can use a custom delimiter with it, there are some issues. A delim parameter can be used as the second parameter. Or as a third parameter if you use "UNSUFFIXED" as the second (decor) parameter. It can not be used with the "SUFFIXED" or "NONE" decor parameters.

Forther, there does not seem to be a way to use "SUFFIXED" at all.

To Reproduce

Using the structure of the example on the wiki and changing the default delim from a semicolon to a comma:

Works:
[h: varsFromStrProp("a=blah, b=doh, c=meh", ",")]
[r: a] [r: b] [r: c]
[h: varsFromStrProp("a=blah, b=doh, c=meh", "UNSUFFIXED", ",")]
[r: a] [r: b] [r: c]

Does not work:
[h: varsFromStrProp("a=blah, b=doh, c=meh", "SUFFIXED", ",")]
[r: a] [r: b] [r: c]
[h: varsFromStrProp("a=blah, b=doh, c=meh", "NONE", ",")]
[r: a] [r: b] [r: c]

Using the default semicolon delimiter:

Works:
[h: varsFromStrProp("a=blah; b=doh; c=meh", "UNSUFFIXED")]
[r: a] [r: b] [r: c]

Does not work:
[h: varsFromStrProp("a=blah; b=doh; c=meh", "SUFFIXED")]
[r: a] [r: b] [r: c]
[h: varsFromStrProp("a=blah; b=doh; c=meh", "NONE")]
[r: a] [r: b] [r: c]

This:
[h: varsFromStrProp("a=blah, b=doh, c=meh", "", ",")]

Produces this error:
varsFromStrProp called with 3 arguments, but second argument "" was not one of NONE, SUFFIXED, or UNSUFFIXED.

Expected Behaviour

Custom delim parameter should be in a fixed location, presumably the third given that decor is the second.

A blank second parameter should be default (NONE/UNSUFFIXED) and not throw an error.

SUFFIXED should work as a parameter.

Screenshots

No response

MapTool Info

1.5.2

Desktop

Window 11

Additional Context

No response

@FullBleed FullBleed added the bug label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant