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

v2: Changed SplitPath to return an object when no output parameters are passed. (Approach 3.) #296

Open
wants to merge 1 commit into
base: alpha
Choose a base branch
from

Conversation

jeeswg
Copy link
Contributor

@jeeswg jeeswg commented Aug 25, 2022

Rationale

  • The functionality was previously mentioned in Thoughts for v2.0.
  • The functionality would be useful in preparing AHK v1 scripts, for subsequent conversion to AHK v2. (With a custom SplitPath backport used in AHK v1.)
  • If A_ScriptName will remain as currently defined in AHK v2, it will be a modifiable custom dialog title, not a consistent script file name, therefore SplitPath(A_ScriptFullPath).Name would be the AHK v2 equivalent of AHK v1's A_ScriptName.

Implementation

This approach creates 5 (or fewer) strings, as individual internal variables, and outputs them either to variables, or to an object.

At present, the internal SplitPath function always returns OK.
(The external function returns a blank string as before, else an object.)

See also:
Attempt 1. #276.
Attempt 2. #289. (This was fixed with a 2nd commit, not shown in the PR description.)
Attempt 3. This PR. Third time lucky? (This PR passes the same test code as in #289.)

(Attempts 2 and 3, differ, but both have good ideas.)
(There are just so many approaches and minor considerations.)
If any major changes are needed for the code, and a separate commit is created, that's fine, I don't need to be credited.
I would look forward to seeing the main dev's implementation. Warm regards.

@jeeswg jeeswg changed the title v2: Changed SplitPath to return an object when no output parameters are passed. (Attempt 3.) v2: Changed SplitPath to return an object when no output parameters are passed. (Approach 3.) Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant