LifesGladiator
New member
- Joined
- Oct 5, 2010
- Messages
- 2
- Programming Experience
- 1-3
Hi,
Im using VB Express 2010.
Ive had previous VB 6 experience and have been playing around with VBA for some time. Now, I have started working on VB.NET (A complete no brainer i am on .NET)
Okay here is the problem:
I have a Multiline string lets name it ToolsSubscribedTo it contains the following text:
Appscan
CC
CCMS
CQ
CQMS
Now, i need to split this and put it across in a list view which has all the tools as columns. here's an example:
Name Appscan CC CCMS CQ CQMS ReqPro PolicyTester
Mr.Abc 1 1 1 1 1 0 0
Now, in .NET I need a way to search the ToolsSubscribedTo which will contain different combinations for different users and populate the listview to give me a matrix of users against tools.
Here is the code i have right now. Listview columns are added earlier based on list of all tools.
ToolsUsed = Licenses_UsedList.Replace(vbCrLf, " ")
ToolsUsed = ToolsUsed + " "
For j = 0 To UBound(ListofAllTools)
Dim strCurrentTool As String
strCurrentTool = ListofAllTools(j) + " "
If InStr(ToolsUsed, strCurrentTool, CompareMethod.Text) > 0 Then
lv.SubItems.Add("1")
Else
lv.SubItems.Add("")
End If
Next
Need to be careful as if i search for CQ, it is available in two lines so i add a space after each tool and search including the space.
Now,
When strCurrentTool = "CQ" and Tools Used = "CC CCMS CQ CQMS "
InStr(ToolsUsed, strCurrentTool, CompareMethod.Text) returns 8.
If i make strCurrentTool = "CQ " it returns 0 why is that? is there a better way to achieve this?
I am so worried about this space because for some records, CQMS might be before CQ and i dont want to mistake CQ with CQMS thru InStr.
Now im really confused.......... Somebody please help.
Im using VB Express 2010.
Ive had previous VB 6 experience and have been playing around with VBA for some time. Now, I have started working on VB.NET (A complete no brainer i am on .NET)
Okay here is the problem:
I have a Multiline string lets name it ToolsSubscribedTo it contains the following text:
Appscan
CC
CCMS
CQ
CQMS
Now, i need to split this and put it across in a list view which has all the tools as columns. here's an example:
Name Appscan CC CCMS CQ CQMS ReqPro PolicyTester
Mr.Abc 1 1 1 1 1 0 0
Now, in .NET I need a way to search the ToolsSubscribedTo which will contain different combinations for different users and populate the listview to give me a matrix of users against tools.
Here is the code i have right now. Listview columns are added earlier based on list of all tools.
ToolsUsed = Licenses_UsedList.Replace(vbCrLf, " ")
ToolsUsed = ToolsUsed + " "
For j = 0 To UBound(ListofAllTools)
Dim strCurrentTool As String
strCurrentTool = ListofAllTools(j) + " "
If InStr(ToolsUsed, strCurrentTool, CompareMethod.Text) > 0 Then
lv.SubItems.Add("1")
Else
lv.SubItems.Add("")
End If
Next
Need to be careful as if i search for CQ, it is available in two lines so i add a space after each tool and search including the space.
Now,
When strCurrentTool = "CQ" and Tools Used = "CC CCMS CQ CQMS "
InStr(ToolsUsed, strCurrentTool, CompareMethod.Text) returns 8.
If i make strCurrentTool = "CQ " it returns 0 why is that? is there a better way to achieve this?
I am so worried about this space because for some records, CQMS might be before CQ and i dont want to mistake CQ with CQMS thru InStr.
Now im really confused.......... Somebody please help.
Last edited: