Skip to main content

[Migrated content. Thread originally posted on 12 December 2011]

Hi,

How should I codify this in Visual COBOL?
List m_ListItemCache = new List();
I need a list which could be ordered and also be searchable...

[Migrated content. Thread originally posted on 12 December 2011]

Hi,

How should I codify this in Visual COBOL?
List m_ListItemCache = new List();
I need a list which could be ordered and also be searchable...
voyager originally wrote:

How should I codify this in Visual COBOL?
List<ListViewItem> m_ListItemCache = new List<ListViewItem>();


An example:

01 m_ListItemCache type List[ListViewItem] value new List[ListViewItem].

It's quite straightforward - are you having problems with it? The Generics sample in the "Visual Studio Integration" samples collection (part of your installed COBOL product) has more examples. You'll need to ensure your program or project imports the System.Collections.Generic (for List(Of T)) and System.Windows.Forms (for ListViewItem) namespaces, and references the System.Windows.Forms assembly, of course.

I need a list which could be ordered and also be searchable...


The .NET Framework List(Of T) class is searchable and sortable, so this ought to do the job.

[Migrated content. Thread originally posted on 12 December 2011]

Hi,

How should I codify this in Visual COBOL?
List m_ListItemCache = new List();
I need a list which could be ordered and also be searchable...
You forgot to specify 'type':
01 m_ListItemCache type List[type ListViewItem] value new List[type ListViewItem].
Thank you. It was time to be heading off and I didn't know how much time will suppose me to find the correct syntax for it (even though I didn't know about this demo project).
Some things get hairy to work with at first sight, anyway.