Paradigm Posted January 16, 2007 Posted January 16, 2007 How do you check to see if a variable exists before you run a script that is dependent upon that variable having a value?
LaRetta Posted January 17, 2007 Posted January 17, 2007 (edited) 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 January 17, 2007 by Guest Adjusted script
dazlunn Posted January 17, 2007 Posted January 17, 2007 (edited) 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 January 17, 2007 by Guest
dazlunn Posted January 17, 2007 Posted January 17, 2007 Incidently, what are you using variables for?? By the way... - Great name tag! it's one of my favourite words (Paradigm)...
Paradigm Posted January 17, 2007 Author Posted January 17, 2007 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.
Paradigm Posted January 17, 2007 Author Posted January 17, 2007 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.
Paradigm Posted January 17, 2007 Author Posted January 17, 2007 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.
dazlunn Posted January 17, 2007 Posted January 17, 2007 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...
Recommended Posts
This topic is 6522 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