Cable Posted November 18, 2020 Posted November 18, 2020 (edited) I have a script that distributes a quantity across various number fields using a "set field" script step. It is possible for the number being distributed to be zero. When I run the script with debugger, it puts zeroes in the number fields as expected. But if I run the script without debugger, it enters zeroes as null (blank). I have absolutely no idea why! I've tried modifying the script to specify the value with GetAsNumber and I've even tried adding to the Case statement (which determines the portion of the value to be distributed) that if the value to enter is not greater than zero to just enter a zero. Still makes the field blank. 99% of the time but not 100% of the time. I've checked to make sure all fields are set to be number fields. I've verified this happens for me in both FMP 18 and FMP 19 on two different Windows machines. For my use case there is a difference between a blank and a zero so it must be correct. Sometimes the field is legitimately empty. What should I be checking? Edited November 18, 2020 by Cable
comment Posted November 18, 2020 Posted November 18, 2020 Can you provide a simple way to reproduce the problem?
Cable Posted November 18, 2020 Author Posted November 18, 2020 I don't think so. I might be onto something. I turned off indexing for the first number field to see if that would help. I was expecting it to put the zero in the first field not not any others. Instead, it put the zeroes in all of the field properly. Huh. However, I also paused the script at one point because I wanted to see something so maybe that had an effect. Running it again. Unfortunately, it takes almost an hour to run. So, testing is cumbersome!
Cable Posted November 18, 2020 Author Posted November 18, 2020 Yep, I'll be *******, that fixed it. I'm at a loss to explain but I'll take the win! 😆
Recommended Posts
This topic is 1464 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now