Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3165 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

When I set a variable this way: Set Variable [$StudentIDs = ""] the actual value of $StudentIDs is 0, not empty or blank. So it fails the IsEmpty test.

Is this by design, it is a bug or am I doing something stupid?

- Brad

Posted

can you post the actual script?  Setting a variable to "" should kill the variable and it will not even show up in the data viewer.  Do you still see your variable in the data viewer set to 0?

(if you do: make sure you don't have anything else like a "watch" in the data viewer or a script trigger that sets it to 0 explicitly)

Posted

I am using an eval copy of FM Pro so no data viewer until I actually buy the advanced version (which I am probably doing this week.)

I refactored my script so I no longer need to set the variable to empty (it was a stupid thing to do anyway). I tried to create another script to reproduce the behavior, but it is working as expected now - no 0's in sight.

This is a simplified version of what I was doing - I can't copy/paste the script into plain text to post here:

Set Variable [$StudentIDs; Value: ""]
Show Custom Dialog ["StudentIDs is:" & $StudentIDs]

The dialog was saying:  StudentIDs is:0

In earlier code I was placing a comma delimited list from the results from an ExecuteSQL into the variable and iterating through the list, "popping" each element with Left/Position and Middle/Position calculations until empty and then existing loop. 

- Brad

Posted
1 hour ago, Brad Mathews said:

This is a simplified version of what I was doing - I can't copy/paste the script into plain text to post here:


Set Variable [$StudentIDs; Value: ""]
Show Custom Dialog ["StudentIDs is:" & $StudentIDs]

The dialog was saying:  StudentIDs is:0

Well, that's obviously too "simplified" - since it would not produce the claimed result.

I am guessing you were either using a different variable, or looking at the result of a numerical operation involving that variable - e.g. 3 * $undefinedVariable will return 0.

Posted

"When I set a variable this way: Set Variable [$StudentIDs = ""] the actual value of $StudentIDs is 0, not empty or blank. So it fails the IsEmpty test."

You cannot declare a variable that way. Setting a variable requires at least two entries; the variable name; and the value.

If you HAVE put a value into $studentIDs; and later TEST for $studentIDs=""; then the correct result is in fact 0; because the statement is false.

That's why it would have been helpful to see your complete and exact script.

Posted

Bruce,

I think we have a winner!

I did try and go back to duplicate that incorrect syntax when attempting to recreate the problem, but it would not let me - it insisted on using the gear icon which of course forces correct syntax. So I assumed I had just typed it wrong into the forum post so did not mention it.

I still can't figure out how I managed that incorrect syntax.

- Brad

This topic is 3165 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.