| | | Supreme Being
       
Group: Forum Members Last Login: Tuesday, May 20, 2008 Posts: 59, Visits: 155 |
| | Hello How to work with array variables? 1) initialize 2) get data over index 3) change data over index I didn't find it in help unfortunately |
| | | | Supreme Being
       
Group: Forum Members Last Login: Today @ 12:17 AM Posts: 136, Visits: 600 |
| Hi Jimmili, Please find the sample code in VBScript. Dim i As Integer Dim arrLst As New ArrayList Dim strUsers As String Dim VarCount1 as Integer strUsers = "" arrLst = CType(ctx.Variables.Item("resSequentialApprovers").Value, ArrayList) ctx.log.LogInformation("COUNT IS >>>>>>>>>>>>> " & arrLst.Count.ToString()) VarCount1 = CInt(arrLst.Count.ToString()) For i = 0 To arrLst.Count- 1 If i = 0 then strUsers = arrLst(i).ToString() else strUsers = strUsers & "," & arrLst(i).ToString() end if Next ctx.Variables.Item("strUsers").Value = strUsers ctx.Variables.Item("VarCount1").Value = VarCount1 ctx.log.LogInformation("USER LIST 1 >>>>>>>>>> " & ctx.Variables.Item("strUsers").Value.ToString()) ctx.SaveVariables()
Regards, Bineesh E Raghavan |
| | | | Supreme Being
       
Group: Forum Members Last Login: Tuesday, May 20, 2008 Posts: 59, Visits: 155 |
| | Thanks But could I work with Array variables without scripts programming? For example, I need initialize array with database ID's and process it in cycle (using For-Loop activities). |
| | | | Supreme Being
       
Group: Forum Members Last Login: Today @ 12:17 AM Posts: 136, Visits: 600 |
| | Yes, it is possible. It was just a sample script. You can use C#, VB.Net or JScript.Net language.
Regards, Bineesh E Raghavan |
| | | | Supreme Being
       
Group: Forum Members Last Login: Tuesday, May 20, 2008 Posts: 59, Visits: 155 |
| | And how I can do it? In "Update Variable" there are no options to work with array values. |
| | | | Supreme Being
       
Group: Forum Members Last Login: Tuesday, May 20, 2008 Posts: 59, Visits: 155 |
| | and how to implement Array variables? ctx.Variables.Item("Arr").Value(0)="1001" ctx.Variables.Item("Arr").Value(1)="1002" Such script doesn't works. And "ctx.Variables.Item("Arr").Add("1002")" also doesn't work because "Add is not a member of Workflow.NET.Variable"
|
| | | | Supreme Being
       
Group: Forum Members Last Login: Today @ 12:17 AM Posts: 136, Visits: 600 |
| Hi Jimmilee, Try this : ArrayList temp = new ArrayList(); Assign values.. And _WorkItem.CurrentContext.Variables[approveUsersName].Value = temp;
Regards, Bineesh E Raghavan |
| |
|
|