Add A Structure To A List

Sep 27, 2011

add a structure to a list

View 2 Replies


ADVERTISEMENT

Indexing A List Of List Sub Structure Directly?

Mar 18, 2009

If I have a list of list of myparams, can I access the sub structure of my params directly by indexing the list emelments?, eg..structure myparamsdim p1dim p2end structurepublic my_list as new list(of list(of myparams)))' now try to access list data directly by indexing..my_list(2)(3).param2 = 3but line above cuses error msg= Error 1 Expression is a value and therefore cannot be the target of an assignment!VB2005 starter

View 4 Replies

Make Use Of A List(of String) In A Structure?

Sep 15, 2010

How would I make use of a List(of String) in a structure in vb.net. for example

Structure examplestrut
Public exampleslist As List(Of String)
End Structure

How would I call exampleslist.add("example 1")?

View 1 Replies

.net - Modifiy Item Property In List(of Structure)?

Jan 7, 2012

In a list(of structure), i constantly have to modifiy the property of items using this code

Private Sub ChangeState(ByVal ww As WebWorker, _
ByVal NewState As WorkerState)
Dim oWBB As WebWorker = ListWebWorkers.Find(Function(item As WebWorker) item.Browser.Name.ToLower = [code].....

But this give problem when two or more of the items call this sub procedure. in that one item may already have been removed. This code is executed in the ui thread, and has to be.so is there a better way to modify the items in list structure?

View 2 Replies

Assign Values To Structure Elements In A List?

Aug 19, 2011

I have a user defined structure in a list that I am trying to change the value for in an individual element within the list of structures. Accessing the element is not a problem. However, the compiler complains

"Expression is a value and therefore cannot be the target of the assignment"when I try to update the value.For example:

Public Structure Person
Dim first as String
Dim last as String
Dim age as Integer

[code]....

View 2 Replies

Changing The Value Of A Structure Member While Contained In A List(Of... )?

Apr 6, 2011

I have a question that I really hope someone can shed some light on for me, as this is driving me crazy trying to figure this out. Consider this code..

'declare and allocate
Dim lstNumbers As New List(Of Integer)
Dim nCount As Integer

[code]....

View 4 Replies

Count Items In List(Of Structure) Using Predicate .net 2.0?

Jul 26, 2011

I need to count the items that meet a criteria in a list(of structure) in .net 2.0. eg

Dim listcars as new list(or car)
Structure car
Dim Name as string
Dim year as integer
End structure

Now i need to count all cars with name toyota etc, how do i do it.

[URL]

View 5 Replies

Create A List(of Bytes) Within A Class Structure?

Sep 2, 2011

I have the following Structure within a class[code]...

How do I efficiently use this list?[code]...

View 1 Replies

List Of Structure As Binding Source For DatagridView

Jan 18, 2010

I am trying to bind a list of a structure to my datagridview. But I just get a load of empty rows (I created the columns manually).

Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()

[Code]....

View 6 Replies

Store A Txt File List Into A Structure Array?

Nov 30, 2010

I have a .txt file i want to read that has states by abbreviation and states by name. In that text file some are territories and some are states.

I want to read from that file and put the abbreviations into one structure array and the states into another structure array.

I then want to lookup up the states by abbreviation or state name. The lookup will simply be selected by a radio button which will flag either the states full name array, or the abbreviation array.

all I have is the structures created:

Public Class Form1
Structure Lookup
Dim Abbreviation As String

[Code]....

How can I read from the .txt file and store into an array

View 3 Replies

Getting Field Values From A List Into Fields In A Structure Or Class?

Mar 21, 2012

I have a class (using a class rather than a structure only because I can set a default field value for the fields I declare in the class) and I'm using a web service that returns information (demographic information) in JSON. I am using LINQ to get the values of each "entry" from the returned list and in that, I have to parse through and pull out the actual data that I want.Here's how I have it doing right now (just a start, there are 44 of them total, thus my question which will follow the code):

Dim returnedStats = From ljo As Linq.JObject In returnedObject.SelectToken("results")
'
'
For Each stat As Linq.JObject In returnedStats

[code]....

View 2 Replies

List Of Structure As A DataGrid DataSource VB2010 Expres?

Feb 17, 2012

It's my first time playing with the DataGridView properly and I've hit a little snag...I need to display data in a DataGridView for ease of viewing, and I have a list of all the data. It's a list (of a structure), and I've got no idea how to do this. I can set the datasource as the list, but that doesn't work. I've read up on the topic but don't really understand. Am I forced to use classes not structures in this instance?

View 1 Replies

Refelction To List Properties Of A User Defined Structure

Feb 23, 2009

I am having some trouble using Refelction to list the properties of a user defined structure. I need to get a list of the properties and their values.[code]

View 3 Replies

Retrieve Listing Of Website Structure (Preferably To A List)

Dec 31, 2010

I'm able to create a List(Of String) containing a local directory structure of a LOCAL folder. I'm wondering how I would go about getting this structure for a website, in order to get a listing of all files of a particular type (for example: all .html files)

Something along the lines of what Xenu does would be perfect, but I don't know how to get started. I was thinking of doing something with parsing out "/" of the URL, but then you'd need to know the "deepest" file that exists on the site.. which you won't know...

Is there a way to get a folder listing of each directory of a site without having FTP access or something? (I'm assuming no due to security risks)

My only other option would be to crawl all hyperlinks within the site, and storing all the "internal" ones, but I don't know how to set up that loop, or how to know when it has reached the "deepest" level.

Kinda like when you delete a remote folder from FileZilla, it will traverse all sub-diretories first and delete those files.

View 1 Replies

Sorting List (Of Structure) - Sort Multiple Variables

Feb 17, 2011

I'm using a Listview in VirtualMode, so I can 'add' a lot of files almost instantly. A Listview in VirtualMode does not allow sorting, so I need to sort the data myself. The data is stored as a List of Structure (it's faster to load than a List of ListViewItem). The code below works fine, but I need to sort based on multiple variables in the Structure. Code:

View 2 Replies

VS 2008 - GetItemByName Without Having To Do A Loop When Have A List Of Structure Type

Dec 27, 2009

how to make a new structure somewhat, but what I need to know is how I can do something like, GetItemByName without having to do a loop when I have a list of my structure type. What I mean by this is if I had a structure like this:

[Code]...

View 4 Replies

Create A List (of My Custom Structure) To Hold Only Unique Items?

Mar 8, 2012

How can I create a list (of my custom structure) to hold only unique items? This list should be created from another list.[code]...

View 5 Replies

Structure Inside Another Structure Receives Null Reference Error?

Jan 5, 2012

Module Module1
Public Structure structure1
Public TRANS() As structure2
End Structure
Public Structure structure2
Public X() As Integer
End Structure
End Module

View 17 Replies

Class Structure - Large Structure That Has Lots Of Properties ?

Jan 5, 2010

I'm new to VB 2008 after having spent a long time with VB6, so I apologize if this is a stupid question. But I'd really like to have this straightened out.

Let's say I have a pretty large structure that has lots of properties.

Code:

Now say that I want an internal database with about 10 instances of this structure total, describing, say, 10 different products that a store sells. When these values are loaded from a database, they remain totally static. (However, they can be different each time a program loads)

Now say that I have a class. Each instance of this class is a type of that BaseProduct structure. Meaning, each instance of the class pertains to one of the 10 types of products that the store sells. However, this class has additional properties that pertain specifically to each instance, which are not static.

Code:

Now, the problem here is... If I have 200 different transactions, each one contains an instance of BaseProduct. BaseProduct is HUGE, and is largely redundant (only 10 types possible), so I think it's a little silly to include a whole copy of it with EVERY transaction. However, the Transaction class really needs information regarding the base product it pertains to. Is there a way to, instead of declaring a New BaseProduct in the Transaction class, to simply make one of the properties of the Transaction class a pointer to a BaseProduct variable?

In VB6, I would accomplish this by making a BaseProduct(10) array, and then giving each Transaction an ID number referring to an entry in that array. But in VB 2008, using class structure, this is impossible. I can't define the BaseProduct(10) array outside of a class in a namespace, and if I define it in the actual application's form, then the class loses modularity since it relies on the application that's using it.

View 11 Replies

Converting Structure Within Structure To Byte Array For Socket

Aug 29, 2009

I am trying to communicate with an external device and i am trying to send a byte array to the external device via sockets but i am always getting a response the message size is too small so i am not sure what i have done wrong. Between the data type there should be no alignment present and all numbers are represented in little endian format. The char array is not null terminated as mentioned in the protocol specifications.

I have to send data based on a struct that embeds 2 other struct. So here's my vb.net code for the struct used to convert to byte array and the sending part.

Public Structure MESSAGETYPE_OIP_Login
Dim Header() As COMMANDHEADER
Dim UserName() As PSTRING

[Code]....

View 2 Replies

Invalid Structure Size When Marshalling C Structure To .NET

Apr 14, 2012

I'm experiencing a problem with the following c-structure:

typedef struct tagTEXTUREPROP
{
DWORD dwSize;

[Code].....

The Marshal.SizeOf obviously calculates a size of 76 and it works with the DLL function, but it leaves me with some bad feelings.

View 1 Replies

VS 2008 Convert The XML Structure Into A Class Structure?

Apr 25, 2010

I'm having a problem that's driving me crazy; I can't understand how to convert the XML structure into a class structure (that I want to use to hydrate a XML document).

The XML document looks like this:

xml
<?xml version="1.0" encoding="utf-8"?>
<artists xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.spotify.com/ns/music/1">

[code]....

View 2 Replies

Arraylist Of Structure Within Array Of Structure?

May 23, 2010

I want to make a structure within a structure. Basically it will appear like this:

Structure ID
dim CardType as string
im CardCode as string

[code]......

View 13 Replies

Assign Array Of Structure To Another Of Same Structure?

Oct 12, 2010

In Vb.net I am trying to assign an array of structure to another array of same structure[code]...

View 2 Replies

Structure With A Structure Array?

Sep 12, 2011

I have two structrures

Public Structure PhoneScheduleEntries
Dim Count As UInteger
Dim PhoneSchedule() As PhoneScheduleEntry
End Structure

View 3 Replies

How To Add To A Structure

Jun 11, 2010

I have created a public structure:

Public Structure LogicalEdge
Dim sTypeEdge As String
Dim dTotalLengthOfLines As Double
Dim lstLinesInEdge As List(Of Line)
End Structure

In my code, I create a new list of this LogicalEdge:

Dim myListOfEdges As List(Of LogicalEdge) = New List(Of LogicalEdge)

After, I create a new LogicalEdgecontainer:

LogicalEdge = New LogicalEdge

I set one of it's properties:

LogicalEdge.sTypeEdge = "endcap"

Now, I add it to the list

myListOfEdges.Add(LogicalEdge)

After looping a few times, i want to set one of the other propterties for the same item in my LogicalEdge, but when i do this:

LogicalEdge.dTotalLengthOfLines = 80.77

To look at the values in the collection, I loop through myListOfEdges collection; and I see that dTotalLengthOfLines doesn't pick up the value i have assigned to it. i thought I might need to identify which item in myListOfEdges to add it to... so i tried this:

LogicalEdge = myListOfEdges.Item(i)
LogicalEdge.dTotalLengthOfLines = 80.77

But that didn't work either.

View 2 Replies

.net - Opposite To A Structure?

Jun 29, 2011

I'm sure there is an answer to this somewhere but I'm clearly using the wrong terminology in my searches, so I apologise in advance for this inevitably being a duplicate.Take the function CType. Clearly I can cast (or at least try) a given object to a given reference type. The function will not work if trying to cast to a structure, i.e.CType(myObject, Integer)

will generate a compiler error. This I'm sure most often crops up when working with generics:

[Code]...

What is the opposite? I want only reference types so that CType doesn't fail. I can't overload the T As Structure with a plain T because it considers them identical signatures, so surely there's a keyword I'm missing somewhere?

View 1 Replies

Add A Structure To A Collection?

Sep 18, 2011

Recently I found that I'm not able to instantiate a structure for an array:

Dim mObjectLists() As New objectLayout

Ok, fair but It's an easy way to store a bunch of data in an array instead define a class. And after that I tried to define this:

Dim mObjectLists() As Collection

And add structures to the collection. But it says you should instantiate the reference object first. I searched about creating own Collection based on the base collection class but I think It's wasting time to write a code with class inheritance instead the first sample.

View 1 Replies

C# - Use A Structure Rather Than A Class?

Apr 10, 2009

In a recent project I was working I created a structure in my class to solve a problem I was having, as a colleague was looking over my shoulder he looked derisively at the structure and said "move it into a class". I didn't have any argument for not moving it into a class other than I only need it in this class but this kind of falls down because couldn't I make it a nested class?

View 5 Replies

Convert Structure From VB6 To .Net?

Dec 8, 2009

I need to convert structure from VB6 to VB.Net. This struct is used to pass to a c++ dll. The problem is that the following struct size in VB is 113, but for some reason in VB.Net is 116.

[Code]...

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved