Access Array From Another Form / Function?
Dec 24, 2010I downloaded VB Express 2010 and trying to access a variable array I created in the main form1 private section in another form / function. [code]...
View 3 RepliesI downloaded VB Express 2010 and trying to access a variable array I created in the main form1 private section in another form / function. [code]...
View 3 RepliesI need to pass an uint8 array from C++ DLL to VB6 application but I receive always following error: "subscript out of range" if I try to work with the array 'pabyData' in my VB6 procedure. The C procedure is: typedef void (__stdcall *FUNCPTR2SendData) (const uint8_t* pabyData, uint16_t wDataLength); void SendData(const uint8_t* pabyData, uint16_twDataLength) { FUNCPTR2SendData vbFunc; vbFunc = (FUNCPTR2SendData) ptCBFPointers->p2NewDirectDataSMSEvnt; // ptCBFPointers are call back pointers, where is saved the call back address of VB6 functions vbFunc(pabyData, wDataLength); } The VB6 procedure is: Public Sub SendData(ByRef pabyData() As Byte, ByVal wDataLength As Integer
View 2 RepliesI am creating a dll with all the functions and subroutines that I use all the time and I decided to create a function that I can pass different types of array to so the function obviously (or not) would have an array of type object. Now I no you can pass any type into an object type but when I pass an integer array into an object array I get an error.
value of type '1-dimensional array of integer' cannot be converted to '1-dimensional array of object' because 'integer' is not a reference type.
Shared Function CompareArray(ByVal FirstArray() As Object, ByVal SecondArray() As Object, Optional ByRef ErrorMessage As String = "") As Boolean
Dim IntArrayOne() As Integer = {1,2,3,4,5} Dim IntArrayTwo() As Integer = {1,2,3,5,6} Dim IsSame As Boolean = False IsSame = CompareArray(IntArrayOne(), IntArrayTwo())
I previously posted a Question about code that uses a function to return the frequency of characters in an array. I have now got this code.
View 5 RepliesI have a lot of control array textboxes called txt(1) to txt(320) on form2. I have a textbox1 on form1 with a click evet that says textbox1.text= form2.txt(1).text but it gives an error (txt is not a member of form2). I tried disabling option explicit, option strick and option infer. Still won't work. My code is to long for this place maybe a short version osf the code. Do I need to make a Public MyArray(15,15,15,15) as string, in the Module1 then copy txt(n).text to the array or is there a way to access txt(n).
Public Class Form2
DPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loadim txtBox(340) As TextBox
[code]....
I want to filter a list of entities that I am fetching from a database. In fact, I should be getting only 1 entity back and I want to make sure its category is one of the allowed ones. What's the best way to filter? My first thought was to do something along the line of :
[code]...
Of course, it doesn't work and I'm having issue finding documentation on that "Where".
If I make the following array in a push button event and I want to put those array variables in a class array. How do I do that? I am just beginning to learn about classes in vb.net but I am having problems using classes and arrays.Is there any good tutorials on that subject.
[Code]...
I'm trying to call an array from another function into an argument command for a command prompt, but I have no clue on how to do so.This code is the code where I am calling the command prompt and adding arguments
Private Sub ConvertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ConvertButton.Click
Using m_Process As New Process()
[code].....
I would simply like to know if it is possible to call a function using a string value.
As an example i have many functions called "openford","openvauxhall","openmini" etc.
So what I mean is, can I put all those function names into an array, then pull a name from the list and call it.
Before adding rows to a table I am evaluating the SSN number. These will later be flagged for correction so I am setting a datatable column to true or false if it passed muster or not.
I wrote a function to check the number and make the determination plus pad it with zeros and hyphens where they should be. My problem is I want to return the results in an array. I am getting system.string[] as the return value.[code]...
I'm trying to write a function that returns an Array that I can pass into a String.Format[code]...
View 3 RepliesI need to get the bytes from an array of bytes starting at a certain index and for a certain length (4), how can get this? Note: I don't want to use the Array.copy sub as it is not a function.I need to put it in something like Sub MySub([arguement as byte()]the_function_I_Need(Array, index, length))
View 2 RepliesI want to pass the entire array to the next function[code]...
View 3 Repliesi need to pass array value to a function , here are the details
function MyTest(byval a as integer, byval b() as string)
if b is nothing
msgbox("no array")
[Code]......
I want to return an array from a function.dt is a DataTable that is global
HTML
Dim dr As DataRow
For x As Integer = 0 To adoc.GetUpperBound(0)
dr = ds.Tables(0).NewRow()
[code].....
I'm definitely missing something here. I am trying to return an array forn the sql statement, chich I can reference as abom() in the original source.The ultuimate goal is to manually populate dt.
I need to return an array but the array size will change from one call of the function to another so I need away to storing the returned array. The function is as below, and as you can see the returned array will be of different sizes:
[Code]...
Im overiding getRolesForUser() I have 2 columns i return from the query IAdapter.GetRolesByUserName(userName) returns two columns (roleID, formID) How can I return them and access the two columns data? 2 dimensional array?
[Code]....
Is it possible to use a recursive function on an array
If I have an array like this[code]...
I want to use a recursive function to make in out like this[code]...
I'm trying to write a function that returns an Array that I can pass into a String.Format:
Public Function ToArray() As Array
Dim vals As New ArrayList()
vals.Add(Me("district"))
[code].....
I've written a short function for array intersection and wanted to know why one function is faster than the other.
1)Dim list2() As String 'Assume it has values'Dim list2length As Integer = list2.length
[Code]...
Is it possible to get the arguments from a sub or function in vb2005 as an array?
View 4 RepliesI have a Sub with an array of strings as parameter:
Private Sub des(ByVal array() As String)
Dim i As Integer
For i = 0 To UBound(array)
[code]....
When I call the function inside my main function , the value of str changes even if the array is passed to the function Byval
Dim str() As String
str = {"11111", "22222", "33333", "44444", "5555", "66666"}
des(str)
I tried making a copy of the array in the Sub, but it still changes in the main function
Private Sub des(ByVal array() As String)
Dim i As Integer
Dim array2() As String
[code]....
I read on a site that you cannot pass arrays ByVal ,is this true? If so , how should I proceed?
I am trying to call the method with the following declaration[code]...
The structs should both be twodimensional arrays with indexes of 4,4 and 5,4 respectively. The second one is an out parameter.
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].....
how is the best to store cards? I tried to use array, but I couldnt find simple function to remove one element from array (like in PHP unset() ),
View 1 RepliesDim oList as new Hashtable
oList.Add("1","Value1")
How can I create a a function to return my objects like the above one.
[code].....
I am in the process of using a two-dimensional array to find wind chill factors. My application uses a nudTemp for temperature and nudWind for Wind Velocity. When temp and wind are chosen from the nud list, it is supposed to display the wind chill temp in a text box and then display a message box. Right now it does everything it is supposed to do except that it does not display the proper wind chill factor.
I know it is an issue with my arrays so I was provided with an example but I don't know how to modify it so that it matches my code. I have added all of the array values but it is naming the array variables I am having issues with.
Sample code I was provided:
Private arr1 As Integer() = New Integer() {10, 20, 30}
Private arr2 As Integer() = New Integer() {100, 200, 300}
[CODE]...
I have provided my code as I have it thus far, listed below.
Option Strict On
Public Class frmWindChill
Dim intWindChill(7, 5) As Integer
[CODE]...
Im having a very difficult time trying to pass an vba array ive built from ms- access vba to a .net function.I don't have a com problem I can reference the library just fine from vba but and i can call a simple function from vba. however my problem exist when i attempt to try to pass an array to the vb.net function. vb.net code
View 3 Repliesi am using XML as database, so updating or inserting diffrent XML's currently i am manage a seprate class for seprate XML file, this process consuming my lot of time, i want to create a genrelize class. currently according to the XML need i am sending two, three, four or five parameter in my function.
now i want to send array of the parameter to my function, so becoz of this thing i could mange all of my functions via a single class...
i am sending u the example what currently i use now...
Public Function Update(ByVal Item_ID As Long, ByVal ProductName As String, ByVal Price As Long, ByVal Path As String) As Long
Try
[Code].....
I have a multidimensional array (not jagged array) that saves data from rows and columns of an excel spreadsheet. After it completes recording the data from Excel, I need to pass the array to another function.I understand how to pass a jagged array, but not a true multidimensional array.
Can someone point me in the right direction? I've done some searching on this site, and others, but most of the info only includes single dimension arrays or jagged arrays.