Click here to Skip to main content
15,913,854 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionEfficient array save/load Pin
MohammadAmiry23-May-06 6:14
MohammadAmiry23-May-06 6:14 
AnswerI found the answer! Pin
MohammadAmiry23-May-06 6:45
MohammadAmiry23-May-06 6:45 
QuestionVB.NET question Pin
Blue Bird23-May-06 5:07
Blue Bird23-May-06 5:07 
AnswerRe: VB.NET question Pin
Wooster200623-May-06 5:16
Wooster200623-May-06 5:16 
GeneralRe: VB.NET question Pin
Joshua Quick23-May-06 12:41
Joshua Quick23-May-06 12:41 
AnswerRe: VB.NET question [modified] Pin
j-on23-May-06 5:21
j-on23-May-06 5:21 
GeneralRe: VB.NET question [modified] Pin
Joshua Quick23-May-06 12:50
Joshua Quick23-May-06 12:50 
AnswerRe: VB.NET question Pin
Joshua Quick23-May-06 13:06
Joshua Quick23-May-06 13:06 
Hello Blue Bird.

The first 2 responses that you received were not quite correct. Please look at my responses to them.


The following C# code...
int nSize = 24;
object[] pObjArray = new object[nSize];

Will look like this in VB.NET...
Dim nSize As Integer = 24
Dim pObjArray(nSize - 1) As Object


The big difference here is that the array initializer in VB.NET represents the largest index (ie: upper bound) and not the capacity of the array. That's why you should tack on a "-1" as shown above.

You can also generate an array like this via the "ReDim" statement.
Dim pObjArray() As Object ' Array not created yet.<br />
ReDim pObjArray(nSize - 1) ' This create a new array.<br />
ReDim pObjArray(1) ' This creates a new array having 2 elements.


You can also create an array and initialize it at the same time like this...
Dim pObjArray() As Object = {1, 2, 3}

Or like this...
Dim pObjArray() As Object<br />
pObjArray = New Object() {1, 2, 3}


I hope this helps! Smile | :)
AnswerRe: VB.NET question Pin
Dave Doknjas23-May-06 14:25
Dave Doknjas23-May-06 14:25 
Questionvb.net job vb.net job Pin
KRISHNENDU MUKHERJEE23-May-06 4:32
KRISHNENDU MUKHERJEE23-May-06 4:32 
QuestionHiding controls in design view Pin
Joshua Boyle23-May-06 4:00
Joshua Boyle23-May-06 4:00 
AnswerRe: Hiding controls in design view Pin
Wooster200623-May-06 5:18
Wooster200623-May-06 5:18 
GeneralRe: Hiding controls in design view Pin
Joshua Boyle23-May-06 5:37
Joshua Boyle23-May-06 5:37 
GeneralRe: Hiding controls in design view Pin
MohammadAmiry23-May-06 6:21
MohammadAmiry23-May-06 6:21 
GeneralRe: Hiding controls in design view Pin
thesqler23-May-06 9:43
thesqler23-May-06 9:43 
AnswerRe: Hiding controls in design view Pin
Roy Heil23-May-06 10:57
professionalRoy Heil23-May-06 10:57 
GeneralRe: Hiding controls in design view [modified] Pin
Joshua Boyle25-May-06 3:15
Joshua Boyle25-May-06 3:15 
Questionhow to do grab handeling in vb.net Pin
ruchig23-May-06 3:57
ruchig23-May-06 3:57 
QuestionStopping a recursive function in the middle. Pin
Almerica23-May-06 3:56
Almerica23-May-06 3:56 
AnswerRe: Stopping a recursive function in the middle. Pin
arcticbrew23-May-06 11:17
arcticbrew23-May-06 11:17 
GeneralRe: Stopping a recursive function in the middle. Pin
Almerica25-May-06 3:26
Almerica25-May-06 3:26 
Questioncreating a scheduling control like a calendar Pin
SandyMarie23-May-06 3:51
SandyMarie23-May-06 3:51 
QuestionProblem with Port Address in VB.Net Remoting Pin
Virani23-May-06 2:39
Virani23-May-06 2:39 
QuestionListView.ShowGroups=TRUE Pin
Greeky23-May-06 1:23
Greeky23-May-06 1:23 
AnswerRe: ListView.ShowGroups=TRUE Pin
sathish s23-May-06 1:49
sathish s23-May-06 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.