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

Convert repeated code blocks to User Defined Functions #21

Open
KyleFS opened this issue Jun 24, 2020 · 1 comment
Open

Convert repeated code blocks to User Defined Functions #21

KyleFS opened this issue Jun 24, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@KyleFS
Copy link

KyleFS commented Jun 24, 2020

Is your feature request related to a problem? Please describe.
Some code blocks show up repeatedly throughout the codebase. It creates a cluttered codebase

Describe the solution you'd like
Convert repeated blocks into User Defined Functions.

Describe alternatives you've considered
Doing nothing is a valid option.

Additional context
The capitalize function is the most obvious candidate for conversion. The following code shows up ~50 times

[h:CapitalName=capitalize(subclass)]
[h:CapitalName=replace(CapitalName,"(?<=\\s)Of(?=\\s)","of")]
[h:CapitalName=replace(CapitalName,"(?<=\\s)A(?=n?\\s)","a")]
[h:CapitalName=replace(CapitalName,"(?<=\\s)Th(?=(?:e|at|ose)\\s)","th")]
[h:CapitalName=replace(CapitalName,"'S(?=\\s)","'s")]

https://lmwcs.com/rptools/wiki/defineFunction

@rtakehara rtakehara added the enhancement New feature or request label Jun 26, 2020
@rtakehara
Copy link
Owner

rtakehara commented Jun 26, 2020

oh yeah, good idea, i'll do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants