Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Checking for a variable being present

Featured Replies

How do you check to see if a variable exists before you run a script that is dependent upon that variable having a value?

Are you asking about a script parameter, script variable or global variable? Well, I think the answer is the same for all three (although a script variable wouldn't have a value when a script starts unless it's been passed from another script.

If [ IsEmpty ( $$CustomerID ]

... do whever because no variable

Else

... do whatever because there is a value

End If

LaRetta :wink2:

Edited by Guest
Adjusted script

Use, from the standard menu, Tools - Data Viewer.

Create a calc which is '$MyVariable' (if local) or $$MyVariable (if global)...

Then 'Monitor' it.

Data Viewer will display $MyVariable when you run your custom function or script... You may need to 'refresh' the value during execution of the script, be sure to use the correct type of variable if your script performs sub-scripts.

$MyVariable - Autonomous script (i.e. calls no other script..) (Local Variable)

$$MyVariable - Nested Script (Global Variable)

Update... you can't check it ahead of time as script variables are created in real-time (unless global), use debugger with data viewer to check variable as its created..

Edited by Guest

Incidently, what are you using variables for??

By the way... - Great name tag! it's one of my favourite words (Paradigm)...

  • Author

Are you asking about a script parameter, script variable or global variable? Well, I think the answer is the same for all three (although a script variable wouldn't have a value when a script starts unless it's been passed from another script.

If [ IsEmpty ( $$CustomerID ]

Yup I think that's it. I had that and it wasn't working for me and it was driving me crazy. I just figured out what my error was as I started to write a response here. I inadvertently had a script step in place that was setting the script variable to "" just a step before I needed it and I was somehow ignoring or missing the change taking place in the data viewer..

Doh!

I'll try it again.

  • Author

Thanks, I was "monitoring" all my script variables but I guess I was looked in somekind of tunnel vision where I wasn't seeing my error explained in the post above.

  • Author

Incidently, what are you using variables for??

In this case they were being used to drill down in a Construction Estimating Costbook. Divisions>SubDivisions>List of Unit Cost Items. As I was working I realized I could use these variables: $$Find_CategoryID and $$Find_SubCategoryID to "remember" where the user was in the Cost Book and that's where I ran into problems.

I think it should work now that I realized what I was overlooking before.

By the way... - Great name tag! it's one of my favourite words (Paradigm)...

Paradigm is the name of my company(ies). ParadigmProjects.com is the name of my building and remodeling company and Paradigm-360.com is the name of my business consulting operation.

I've had the name for 15 years and seen it grow in use and popularity over that time but still I'm always surprised how many people still mangle the pronunciation at times.

That's some neat stuff you do...

On the paradigm-360 site, I noticed your got CCPM.. Critical Chain Project Management if I'm not mistaken, it's a great system, I installed it at my last company using Concerto software... I'm also into TOC, in the UK, and have been playing around with ideas for a DBR scheduling system using Filemaker...

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.