How to copy code to multiple symbols in a display?

Discussion created by pisupportduke on Aug 10, 2011
Latest reply on Aug 17, 2011 by dtakara



I have everything worked out in the code for it to work for one object in the display. My problem is how to copy that code so every time I click on a different object a form specified for that object will display and then able to save that inputted information to that objects specific form. Here is my display:4401.q3.gif


This is my coding window. I know how to add more forms but not more display objects. I require more display objects because my click event is within my symbol. This is my code for the symbol:

Private Sub Aircompressor3_1_Click(ByVal lvarX As Long, ByVal lvarY As Long)
End Sub




Sub store_value(Name As String, value As String)
    If ThisDisplay.NamedValues(Name) Is Nothing Then
    ThisDisplay.NamedValues.Add Name, value
     ThisDisplay.NamedValues(Name).value = value
 End If
End Sub




Function get_value(Name As String) As String
    If Not ThisDisplay.NamedValues(Name) Is Nothing Then
    get_value = ThisDisplay.NamedValues(Name).value
    get_value = ""
  End If
End Function





I would be okay if I could add multiple "this display" objects so in each "this display" I could change the symbol name.




Please dont hesitate if you have any questions.


Thanks, Alex