Code Array In Program?
Apr 1, 2012How can i convert this to vb.net?
View 4 RepliesHow can i convert this to vb.net?
View 4 Repliesnote, this is homework. It's not worth much, but i really need to learn how to store things in arrays. my biggest confusion is that i have no idea how to store something in an array, have the program run again andcontinuouslybuild the array andthen display the array in its current state (by like clicking a display poll button) and then still allow it to build more once more data is entered.Here's the whole assignment. I don't really understand how to start it and the problem above is my biggest frustration!ite a Visual Basic application that can be used to determine the best Super Bowl commercial. The choices are as follows: Budweiser, FedEx, E*Trade, and Pepsi. The application should allow for the user to enter a voter's name, gender and select a commercial from a list.
Create a Vote structure that will contain the voter's first name, last name, gender and the selected commercial. Each time a vote is entered, the information should be added to an array of Vote structures.Provide the ability to save your data to a sequential access file. The program should also be able to read an existing file of vote data into an your array of Vote structures. Doing so, should eliminate any data that may have already been in the array.
I have a program that will compare an array of grocery list items glist and an array of coupon item clist.When I compare the two and if there is a match somewhere in the array I want to have a picturebox visible.When there is no match, I want the picture box not to be visible. [code] The code seems to work great until I come to the else statement.When the code finds a match it displays the picture box and the msgbox without error, but as soon as the message box is cleared, even though i've input it as an ELSE statement, the picturebox goes false again.Does anyone have any idea of how I can "hold" the picturebox to stay visible while the match between the arrays exists?
View 18 RepliesI'm wondering if it is possible to write the code for the button so that, when pressed by the user, it would add whatever text is in the text box to the list box and change the code of the form load to add that text to the pre-existing listbox.items.add's that are in the code of the form load.
View 2 RepliesThe program has errorhandle and write log function, however, it could not catch the error message in the program.
The following error message in Event Viewer. Error Module: oleaut32.dll ,version 5.1.2600.5512, error code: 0x000048f9
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 RepliesI've come up with a solution that works, and it's cleaner than I had originally thought up for it. [code] I'm a PHP programmer, trying to learn some VB.NET. Arrays greatly confuse me in VB.NET, so I wrote some example code in PHP the way I know how to do it.[code]
View 1 RepliesI have a .Net application (VB in particular, although I would this to be as language agnostic as possible) that uses a COM object (made in C++). I need to implement a event in COM that passes a char array from C++ to .Net. I guess I need to convert the array to a managed array; How can I do this?
View 2 RepliesI'm collecting in an array the splitted text of a textbox in order to search in a bimensional array for matching in the name, but I got the error "NullReferenceException" at the red line. Now, I looked the code multiple times, but I didn't find the error. Dim info(0 To 0, 0 To 5) 'this is array is already filled by a sub
[Code]...
Redefining array - would this code work? I attempt to redefine the dimensions of a one-dimensional array every time i need to add a value to it. Would the following code accomplish that?
' Add account to array
If accounts.Length > 0 Then
ReDim accounts(accounts.Length +1)[code]......
i have been working on a simple program but cant get my head around it. It does not show any errors at the moment but when i run it does not do the things i would like it to do. I will paste in the code first and explain it below.
[Code]...
So basically the form has help button to show instructions, quit to quit the program and check to check whether the country from listbox lstCountries matches the correct capital in lstCapitals. The idea of the program is to shuffle the items in two arraylists and then add them to seperate listboxes called lstCountries and lstCapitals. At start i used 1 dimensional array and it worked like a charm for mixing up items in arrays and then adding them to listboxes, but then the problem had to match the correct Country with correct Capital and it only worked if i picked the items on the same index such as 1 and 1(straight line). It all sounds complicated and confusing, P.S alot of code is commented out, because i have tried many ways to make it work.
[Code]....
I am using visual studio 2008 and i can't seem to rectify this error..it seems simple but i really can't seem to rectify this.What iam trying to do is pass the values of an initialized string array to an uninitialized string array using a loop..here's my code:-
Document ^doc = gcnew Document("Abdul.doc");
String ^yes = doc->GetText();
array<Char>^chars = {' '};
array<String^>^splitx = yes->Split(chars);
[code]....
I have a button array that I filled up. Here is the code I used to do that.
Public buttons(29) As Button
For i = 0 To 29
buttons(i) = CType(Me.Controls("Button" & i), Button)
i += 1
Next i
Here is some code that I used (it is extremely inefficient):
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click, Button5.Click, Button6.Click, Button7.Click, Button8.Click, Button9.Click, Button10.Click, Button11.Click, Button12.Click, Button13.Click, Button14.Click,
[CODE].....................
The format I use in the file I am reading is this: [property name]=[property value],[property name]=[property value],[property name]=[property value], [etc...]
I coded the following, but I pinpointed an error on the very last line of code shown here.[code]...
I have code that increments an array of numbers. However, due to performance issues, I need to optimize it.
Here is the code:
Public Sub increment(ByRef Index() As UInt16)
Dim N As Integer = Index.Length - 1
If (Index(0) = 65535) Then
Index(0) = 0
[Code] .....
First of all; I'm completely new to VB.
Pass a string array from Visual Basic Express 2008 to unmanaged code in a Dll.The array is Dimmed as in DIM myArray(11) as String
I'm developing the dll myself using Powerbasic.
The dll expect a 4 bytes pointer to a safearray's handle. As far as I have understood it; the array's string elements must be passed in ANSI format. The code in the dll will then use OLE Api to get the LBound and Ubound of the array and the address of the first element in array.
I have returned object from signature device and when i make quick watch on it, it told me that its an array of long and when i pass it to web method in my code behind (vb.net) it gives me nothing. note: i'm using an activeX to capture the signature from the device.
this is javascript code :
function OnSave() {
var sign = document.FORM1.SigPlus1.SignatureString;
PageMethods.Save(sign);
}
this is my webmethod:
<WebMethod()> _
Public Shared Function Save(ByVal obj As Object) As String
Dim obj1 As New PFSIGNATURELib.SigniShellSignature
[code]....
I'm using Real Studio 2011r3.It's just a simple game that's a small maze from a bird's eye view and you've got to dodge enemies and what not.But I've been told to make a map array like this: [code] I've got level1map(13,13) as an integer, and the numbers in the brackets are supposed to be ypos, xpos.Say I make level1map(5,7) as = 1, it'll make both the 5,7 and the 7,5 so that you can't walk into them.. even if 7,5 is still = 0.I could have just left something out somewhere, but I've been trying to work this out for days..Oh, and with the 7,5 will let me walk there if I walk from the left or right.. but not from the top or bottom.
View 11 RepliesIm using VB 2008 is it possible to set array items with one line code?for example, can i do something like: Dim array = Array("a", "b", "c", "d")
[code]...
I'm wondering if you know if there is a better way to write this code in order to speed it up. It has several blocks of if statements filling arrays, like this:
row0: If x < b(1, 1) Then a1(i, j + 1) = 0
If x > b(1, 1) And x < b(1, 2) Then a1(i, j + 1) = 30
If x > b(1, 2) And x < b(1, 3) Then a1(i, j + 1) = 60
[code].....
I'm currently implementing an inventory screen, a simple grid of picture boxes which displays what the player is carrying (read from a simple array of items).
I can create a nice array of picture boxes (allowing me to easily change their .image property to display items) but now I would like to capture a click event on these newly created picboxes, so when one is clicked, the items attributes are collected from the array and displayed below.
For a picbox created in the designer, this is easy, as I just double click the control, and enter my click event in the sub that is created. How would I do this for a code created picbox however?
Here is the code I use to generate my array once the inventory form loads:
Private Sub Inventory_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim x, y As Integer
[Code]....
I have done a few tests, and I know that the names of the boxes are pb00, pb01 etc, but I cant seem to make this work.
i want to generate a code with 2d-dynamic array to make a matrix?
View 9 RepliesI would like to delete the contents of my array in .NET code. The examples I have seen say..[code]This is way too simple to be so complicated. I just want to delete the array between populations.
View 8 Repliestrying write code to find smaller array in bigger (arrays have 2 dimensions) (i have 2 arrays type Color they contains 2 bitmaps data inside - captimage is bigger bitmap where is need to search)
function CompareI: boolean;
var
y, x, yy, xx: integer;
begin
[code]....
but no luck.. something is wrong - result is always false, can someone provide a little fix or point me to 2dimensional array compare code?
I was just wondering how to clear an array in VB.[code]...
View 1 RepliesPossible Duplicate:VB.Net Initialising an array on the fly
This maybe a stupid question, but its got me exasperated. How do I declare a new array inline? Is this possible? I've tried all of the following and they all don't work.[code]...
Is there a better way to program an array of Labels ?
( L(90) has already been declared as type Object )[code]...
I've searched high and low for the proper way to read from a csv file into a two dimensional array. I thought I found the answer but for some reason I'm getting an "IndexOutOfRangeException" was unhandled message.[code]...
View 4 RepliesI want to be able to effectively search an array for the contents of a string.
dim arr() as string={"ravi","Kumar","Ravi","Ramesh"}
I pass the value is "ra" and I want it to return the index of 2 and 3.
How can I do this in VB.NET?
For example, I have string variable (MyString) as below.MyString = "First word || second order || third example || fourth item || fifth stuff"
There are separator "||" at MyString variable. I want MyString variable is spited based on separator "||"and stored it into new array variable.
Could you advise me the most efficient code to do this job in VB?