Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

vbscript test boolean variable that is function name

Posted on 2015-01-22
9
Medium Priority
?
162 Views
Last Modified: 2015-01-23
Below is my code, how do I test the function name for true or false?  "If A = True" does not work.  Many thanks for any help.

Function A  
   A=true
End Function
0
Comment
Question by:hardrock95
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 29

Expert Comment

by:leonstryker
ID: 40564854
Ok, why are you testing the 'function name'? Shouldn't you passing a variable into a function to test?
0
 

Author Comment

by:hardrock95
ID: 40564996
I inherited the code.   Is that poor coding practice?
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 40565110
All the above does is assign true to A. Its basically a global constant.  What is this used for?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:hardrock95
ID: 40565142
So, can it be tested for true or false?
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 40565323
From a different place, yes. Something like this:

If A = true Then
   msgbox "Its True!"
Else
  msgbox "Not working!"
End if

Function A  
   A=true
End Function
0
 

Author Comment

by:hardrock95
ID: 40566233
I tried that and it does not work.  Please see original post.
0
 
LVL 29

Accepted Solution

by:
leonstryker earned 2000 total points
ID: 40566364
Works for me no problem. Please tell me more about your environment and how you are running the code.  

The easiest way to test this is copy the code above into a blank file and save it as Test.vbs. You can run it by double clicking the that file.
0
 

Author Comment

by:hardrock95
ID: 40566829
That works for me also. Not sure what my issue was.  I am going to close this and indicate you gave the answer.
Thanks a bunch.
0
 

Author Closing Comment

by:hardrock95
ID: 40566833
Solution by leonstryker
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question