>IF EVAL(UDFExpr) >*** Do something >ENDIF >>
' expO1 Data provider Private Function ProcessTaskQuery(ByVal toDataProvider As Framework.Framework.Data) As Boolean Dim lcClass As String = "" Dim lcMethod As String = "" Dim lnCounter As Integer = 0 Dim loAssembly As System.Reflection.Assembly Dim loMethod As System.Reflection.MethodInfo Dim loObject As Object Dim loParameterClass(1) As Object Dim loRow As DataRow Dim loType As System.Type loParameterClass(0) = oApp loParameterClass(1) = Me ' Establish the reference to the EXE loAssembly = System.Reflection.Assembly.LoadFrom(oApp.cStartupDirectory + "Robot.exe") ' Scan each task to execute For lnCounter = 0 To toDataProvider.nCount - 1 loRow = toDataProvider.oDataSet.Tables("Temp").Rows(lnCounter) Status.Text = "Processing " + Trim(loRow("Title")) + "..." lcClass = Trim(loRow("Class")) lcMethod = Trim(loRow("Method")) Try ' Get a reference to the class loType = loAssembly.GetType("Robot." + lcClass) loObject = Activator.CreateInstance(loType, loParameterClass) ' Get a reference to the method loMethod = loObject.GetType().GetMethod(lcMethod) ' Call the method loMethod.Invoke(loObject, Nothing) Catch loError As Exception oApp.ErrorSetup(loError) Return False End Try Next Return True End Function