Forum Discussion
- rraghvaniChampion Level 3
Here's an example,
def myfunc(): x = 3 class MyClass(object): y = x def myMethod(): Log.Message("myMethod") return MyClass def main(): Log.Message(myfunc()) Log.Message(myfunc().y) Log.Message(myfunc().myMethod())
- AlexKarasChampion Level 3
Hi,
Can you provide a code example and corresponding error?
- aafreen_jamadarOccasional Contributor
Hi, I've written a script with a class and functions That I am trying to access using the object of the class. There is no error but the button to run the code is disabled.
- AlexKarasChampion Level 3
Hi,
Again, can you provide code sample?
Only parameterless functions/procedures can be executed using Run button.
Classes cannot be executed themselves but must be instantiated/called from regular functions.
- aafreen_jamadarOccasional Contributor
def Test():
class Light():
lightManager = Aliases.PD2000i.HwndSource_MainWindow.MainWindow.MainLightManager
def white():
light Manager.Click(164, 68)
aqObject.CheckProperty(lightManager.FloodWhiteTitle, “WPFControlText”, cmpEqual, “White”)
lightManager.Click(137,728)
lightManager.Click(137,728)
def dif_white():
aqObject.CheckProperty(lightManager.DiffusedFloodWhiteTitle, “WPFControlText”, cmpEqual, “Diffused White”)
lightManager.Click(160,794)
lightManager.Click(160,794)
obj = Light()
def iteration():
obj.white()
obj.dif_white()
How do I instantiate this from a regular function?
Related Content
- 4 years ago
- 15 days ago
Recent Discussions
- 3 hours ago