I am a newbie to VB Scripting but looking around threads I found a code to help me out reusing a Sub I have already written in another display. To save me cope and pasting the whole Sub over and over again.
Here is what I have so far:
I have a display that I am referring to and have set its properties to "Keep at back" and "Always Updating"
Also have a macro saying "Display MAIN_MENU /B /ZA" which is what I startup along with the display. (MAIN_MENU is the name of the display)
Now I have a Public Sub "FileCheck" in that display and would like to call that sub from another display
In the second display I have the following code:
Dim AllDisplays As Displays
Dim MyKernelDisplay As Display
Private Sub Display_AnimationStart()
Set AllDisplays = LoadedDisplays
Set MyKernelDisplay = AllDisplays.Item("MAIN_MENU")
End Sub
Private Sub Button3_Released()
Call MyKernelDisplay.FileCheck
End Sub
Problem: When I hit the button, it does not call the function but highlights the Call function and says "Runtime Error 424 - Object Required"
Been banging my head about this for like a few hours but have nothing so far
Need your help to see what the issue might be or am I missing out on something here
Here is what I have so far:
I have a display that I am referring to and have set its properties to "Keep at back" and "Always Updating"
Also have a macro saying "Display MAIN_MENU /B /ZA" which is what I startup along with the display. (MAIN_MENU is the name of the display)
Now I have a Public Sub "FileCheck" in that display and would like to call that sub from another display
In the second display I have the following code:
Dim AllDisplays As Displays
Dim MyKernelDisplay As Display
Private Sub Display_AnimationStart()
Set AllDisplays = LoadedDisplays
Set MyKernelDisplay = AllDisplays.Item("MAIN_MENU")
End Sub
Private Sub Button3_Released()
Call MyKernelDisplay.FileCheck
End Sub
Problem: When I hit the button, it does not call the function but highlights the Call function and says "Runtime Error 424 - Object Required"
Been banging my head about this for like a few hours but have nothing so far
Need your help to see what the issue might be or am I missing out on something here