Skip to content

Comments

Modify # function to detect long sequences#36

Open
nilness wants to merge 1 commit intofilemakerstandards:masterfrom
nilness:patch-1
Open

Modify # function to detect long sequences#36
nilness wants to merge 1 commit intofilemakerstandards:masterfrom
nilness:patch-1

Conversation

@nilness
Copy link

@nilness nilness commented Aug 31, 2017

Long sequences (like a Base64 encoding) are returning an error.

In line #63, GetAsNumber ( Base64 encoding) is returning "", but in line #82 the comparison "value ≠ ~number" is returning False, so ~value is set to ~number which is empty.

I found two solutions, changing the comparison in line #82 to "value ≠ GetAsNumber ( ~number ) ;", or in line #66 adding " or number = "" " to the first Case test that assigns to "~value".

I suggest the first as it will short circuit the Case tests preventing unneeded comparisons.

Does it cause a problem? It seems that it could only cause a problem if it causes Date/Time/Timestamp/Number detection to be fail. The only way it could do that is if GetAsNumber (Date/Time/Timestamp/Number) returned an empty string, and I can't see where that could happen.

My limited testing confirms this, but further testing/brighter minds may see something I don't.

Long sequences (like a Base64 encoding) are returning an error. GetAsNumber ( Base64 encoding) is returning "", but the comparison "value ≠ ~number" is returning False, so ~value is set to ~number which is empty.
I found two solutions, changing the comparison to "value ≠ GetAsNumber ( ~number ) ;" and adding " or number = "" " to the first Case test that assigns to "~value". I suggest the first as it will short circuit the Case tests preventing unneeded comparisons.
I don't believe it will interfere with date/time/timestamp/number values as they should not return an empty string from GetAsNumber. My limited testing confirms this, but further testing/brighter minds may see something I don't.
@jbante
Copy link
Collaborator

jbante commented Sep 13, 2017

Can you add tests for your fix to the FileMaker file that goes along with these functions?

@nilness
Copy link
Author

nilness commented Sep 13, 2017

Can you give me more info about what kind of tests you'd like to see, and how to present them?

@jbante
Copy link
Collaborator

jbante commented Sep 13, 2017

Check out the test scripts in the FileMaker file for the # functions for some examples to follow. The gist of it is that you'll want to:

  1. Add a test for the # ( name ; value ) function that demonstrates the problem you're reporting
  2. Run the test to confirm that it fails, and therefor that it detects the issue
  3. Make your changes to the # ( name ; value ) function in that file
  4. Run the suite of tests to confirm that your change (1) fixes the issue and (2) doesn't break anything else.
    Your changes to that FileMaker file should be part of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants