Delete A Position On Structure Array?
Dec 8, 2011I'm working with a structure array but I don't know how to delete a specific position...
View 8 RepliesI'm working with a structure array but I don't know how to delete a specific position...
View 8 RepliesAssuming I have a folder structure like:
[Code]...
This works fine, unless I have Windows Explorer open and I'm looking at the 'MySubFolder' directory. Then I get an IOException The directory is not empty. - clicking OK dismisses this and then the folder structure is not deleted. Any thoughts on how I can get this to perform correctly (i.e. delete), even when running this code while having the folder struture open in Windows Explorer?
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]....
I am using structures in my programming and I sort the structure according to a value in the structure using IComparer.This is a simple example for what I want.
Dim MyArray(6) As Integer
MyArray(0) = 1
MyArray(1) = 45
[code]....
How does number 1 get sorted? Is it brings the newest 1 to top or keeps the old 1in the same index? In my original example (before sorting), MyArray(0) = 1 and after sorting MyArray(0) = 1.Is this the same original 1 or this another 1 (the newest one added to the array) moved to that position?In case the MyArray(0) = 1 after sorting should be MyArray(5) = 1 before sorting.
Here is my a sample of my Code:
Public Structure ToSolve
Dim Con(,) As Integer
Dim Discharge(,) As Double
[code]....
Using all these methods, how can I preserve the positions of similar number in the list? i.e. I want to bring the newest 'Similar' value to the top of the list.
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]......
In Vb.net I am trying to assign an array of structure to another array of same structure[code]...
View 2 RepliesI'm trying to sort an array based on a structure but whenever I do this, it basically erases all the data in the entire array.I have verified that the array is populated correctly, it is when using array.sort that everything returns blank.
View 6 RepliesI'm having problems with marshaling in VB.NET to C++, here's the code :
In the C++ DLL :
struct APP_PARAM
{
[code].....
Here's the data I'm trying to work with
Spark Plugs
column 1: PR214,PR223,PR224,PR246,PR247,PR248,PR324,PR326,PR444
Brands:
column 2: MR43T,R43,R43N,R46N,R46TS,R46TX,S46,SR46E,47L
column 3: RBL8,RJ6,RN4,RN8,RBL17Y,RBL12-6,J11,XEJ8,H12
column 4L 14K22,14K24,14K30,14K32,14K33,14K35,14K38,14K40,14K44
Here is what i came up with for my code so far
Public Class frmMain
Private strSpark() As String = {"PR214","PR223","PR224","PR246","PR247","PR248","PR324", "PR326","PR444"}
Private strBrands As String(,) = { { } }
End Class
I have two structrures
Public Structure PhoneScheduleEntries
Dim Count As UInteger
Dim PhoneSchedule() As PhoneScheduleEntry
End Structure
i need to delete particuler postion in textfile..how can i delete..
my text file is like this
function validateLength(oSrc, args)
args.IsValid = (args.Value.length == 10);
}
[Code]...
After gathering the Machine names on the (sealed) LAn i am then getting the ip addresses, MAc address and Macine User name of each machine on the LAn..These details will need to be accessed seperately for use in the security testing and i am unsure how best to store the active data (though eventually in a database) Am i best to create a Multidimensinal arrayList or array(bearing in mind that all the data is convereted to "String" (arrays can only store one data type??) The data found on the live network is allways changing making an array a difficult choice? I have read some tutorials mentioning making a structure with the data and storing this in an arraylist but i dont know whether this will make accessing the individual data items (ip,MAc,HostName etc) a difficult procedure?
View 1 RepliesI'm currently stuck on an issue regarding declaring an array of type short in a structure and having it default to 'nothing' rather than '0' after ReDim.'Declaring array and setting it's initial size
Private Structure Totals_T
Dim sTot_Desc As String
<VBFixedArray(10)> Dim iTot_Cnt() As Short
Public Sub Initialize()
ReDim iTot_Cnt(10)
End Sub
[Code]...
When calling m_Totals(0) the arrays returned have 10 records in the arry with sTot_Desc and iTot_Cnt having values of nothing in all records. When I ReDim m_Totals both the variables I declared in the structure(sTot_Desc and iTot_Cnt) are declared as nothing, it's fine for the String but I need the Short I declared to be declared as '0', which is what I thought happens when you ReDim. Can anyone see what's going on here and why it's declaring my variables as 'nothing' rather than defaulting to '0' for the short and ""/nothing for the string?
I am once again struggling with my weekly project. I am assigned to write a program that converts a predetermined english sentence to both french and german. The code is to contain an Array and a structure. Also we have not covered retrieving array data from a TXT file, so we are to hard code in the array data. I coded the structure and the array, I added the array data, but am confused how to access the data. The examples I have found all deal with retrieving data from a TXT file. Can someone give me a nudge in the right direction.[code]....
View 3 RepliesThe more I read my book the more confused I get, as the programming example is not even close to what this assignment is I am to modify my existing project to keep track of an order in an array.
View 1 RepliesI'm very new to VB.NET and I suppose this is a little big for a first project.I've done the same thing in other languages so I figured it wouldn't give me much trouble.I'm working on a map editor program for a 2D platformer game.The map will be an array of a structure which contains the width, height, and tile elements of each layer. the tile elements are stored in a 2D array within the structure.[code]That didn't give an exception but I'm not sure that it actually redimmed considering the second assignment command still crashed.
View 1 RepliesI have the following array structure defined and am having trouble figuring out how to sort it..
Public svrElements() As svrElementRec
Structure svrElementRec
Public ElemName As String
[Code]....
I am writing a class and room scheduling program, and would like to use an arraylist that will contain structures. The structure has a couple of arrays in it for when the class meets, and I am having difficulties figuring out the correct syntax to declare the array in the structure. Additionally, in the syntax to access the array. For instance, say I want the MeetingDays to be T, F, T, F, F, F, F; the Meeting Times to be "8:00AM", "", "8:00AM". "", "", "", "", ""; and the Duration to be 75, 0, 75, 0, 0, 0, 0
Public ClassList As ArrayList = New ArrayList
Public Structure MyStructure
Private _ClassName As String
[code].....
I'm trying to create a structure and inside it put an array of "Genres". This is my structure declaration:
Structure BookData
Dim strGenres() As String
[code]....
But I keep getting an error with the .strGenres(5). VB is telling me "End of statement expected"
I'm having a bit of trouble trying to iterate or search through my array (or structure).I am reading in some values from a file, and populating my array.Then, I need to search to compare to one of the values in my array.[code]any pointers? should I use something else instead of arrays / structures ?
View 4 RepliesI have an array of structures:
[Code]...
An array of the above structure with 30 element. I want to sum the empsal of those emp elements whose emp.empName & emp.empAge is equal.
[Code]...
I am trying to be able to add to an established Array that is read in from a CSV file. I'm using structures and I get the concept, but I just can't seem to get it to store. I am using Visual Basic 2010. Sorry for posting in here, but I did not see a category for it.
[Code]...
I wish to write a structure made up of fixed length strings to a file using y.Computer.FileSystem.WriteAllBytes or the like.I am using a VB6 project with fixed length strings that I have converted in to VB.Net.
Structure Record
<VBFixedString(22),System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray,SizeConst:=22)> Public tim() As Char
[code].....
I am trying to declare a array within a structure, and it is not working. [code] So I want each league to have a single name and id and 20 players.Is there a way other than writing out dim player1, player2 etc.
View 3 RepliesCan anyone tell me how I would declare an array for data that will come from textboxes? Every example I find seems to be data that comes from an input box, and the array name would just be strInputbox, for example. However, in my case the user will input data into several textboxes (each named txtBox1, txtBox2, txtBox3, etc.) and I'm not sure how to write this.
Thank you.
I've this code, but there is a problem with setting values. I get "null object" error. how to work properly with functions.
Public Structure Results
Dim Nickname As String
Dim Result As Integer
[Code].....
This is my structure...
<Serializable()> _
Public Class AcctRecords
Public Amount() As Long
Public DateC() As String
[Code] .....
This is where I try to create a new instance but I get an error that states:
Overload Resolution Failed Because No Accessible "NEW" accepts this number of ArgumentsPrivate Sub FixMasterArraySize(ByVal Cnt As Integer)
ReDim Preserve Acct.Master(Cnt)
For I As Integer = 0 To Acct.Master.Length - 1
Acct.Master(I).AcctType =
New String
Next
End Sub
If Acct.Master(I).AcctType was a Boolean type there would be no error..
I have this as the structure
Public Structure TagInfo
Dim TagName as String
Dim hpt as Integer
[code]....
have the structures are populated and when the form opens up, I make a copy of the structure.on my form i have a textbox... that would have information matching the TagName(x).TagValue I am trying to figure out how i could find that value in my textbox quicker than doing a loop through the tagname structure.
I have create a structure type array. sort the array so i can display the sorted array in a listbox. I want to be able to either sort by last name or the student with the highest score. Here's what I have so far:
Structure student
Dim firstName As String
Dim lastName As String
[Code]....
I heard about the IComparer thing but I didn't know how to implement it into my project.
I made an Array of Structure as given below. Now I want to sort them using different parameters.
"Array.Sort(ArratName)" or "Array.Reverse(ArrayName)" didn't work as I expected.
Structure
CheckRecord
Dim
CheckNumber As
Integer
[Code] .....