Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
533 Views, 3 Replies

Creating a Function

Here's my setup,

  1. I have 14 rules that all use the same dictionary.
  2. I would like to place that dictionary in a rule, and then pass the value i want to lookup in that dictionary to that rule.
  3. I would then like the dictionary rule to send the entry back to the main rule
  4. I would like the main rule to pull values from that entry

 

my current code looks something like this:

 

SyntaxEditor Code Snippet

Dim WPS As New Dictionary(Of String, List(Of String))

WPS.Add("10N-888", New List(Of String)(New String(){"10N-888", "P1-P1", "GTAW", "FCAW", "SAW", "N/A", "N/A", "N/A", "0.188-8.000", "CS", "-60", "0.750-1.750"})) ....
....
....
....
.... WPSx = WPS(Parameter("Weld_G1S_WPS"))
Parameter("Weld_G1S_MaxWall") = WPSx(8) Parameter("Weld_G1S_Filler") = WPSx(9) Parameter("Weld_G1S_MinT") = WPSx(10) Parameter("Weld_G1S_CVNR") = WPSx(11)

 

Does anybody have a tutorial or can provide some help with creating a function that can have varibles passed to and from it?

 

Basically, I want to pass the parameter "Weld_G1S_WPS" to the new function and then have that function send the entry back and then it pulls the index value out of the entry. I want to do this because when these dictionary entries change, i want to change it in the code once, rather than in 14 different rules.