Click here to Skip to main content
15,929,596 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: string to double Pin
RichardGrimmer29-Sep-04 2:52
RichardGrimmer29-Sep-04 2:52 
GeneralWinsock control Pin
mohan_balal28-Sep-04 22:38
mohan_balal28-Sep-04 22:38 
GeneralRe: Winsock control Pin
Dave Kreskowiak29-Sep-04 6:01
mveDave Kreskowiak29-Sep-04 6:01 
GeneralleWinsock Control Array Pin
mohan_balal28-Sep-04 19:08
mohan_balal28-Sep-04 19:08 
GeneralRe: leWinsock Control Array Pin
Jose Cezar S. Ynion28-Sep-04 20:17
Jose Cezar S. Ynion28-Sep-04 20:17 
Generaladding a checkbox in a cell of MsFlexGrid Pin
28-Sep-04 18:56
suss28-Sep-04 18:56 
Questionhow to display data in specific textbox when users select any item from list box Pin
Steve Beo28-Sep-04 17:29
sussSteve Beo28-Sep-04 17:29 
GeneralCustom data types in vb.net Pin
PatrickGoettert28-Sep-04 16:24
PatrickGoettert28-Sep-04 16:24 
Hi, first of all sorry for my bad english as I am brazilian...
I want to know how to do something i was very used to in Vb6: custom types that has custom types in it , like in:

Public Type LowerLevel
Dim Value(1 to 100) as integer
End type

Public Type UpperOne
Dim UnderOneLevel (1 to 1000) as LowerLevel
End Type

public MyVariable(1 to 10) as UpperOne

By doing so, I was able to use the variable Myvariable(1 to 10).UnderOnelevel(1 to 1000).Value(1 to 100)... So i could type:
Myvariable(1).UnderOnelevel(555).Value(32) = 123 with no problems at all

Now the Big VB.Net question: How do I do that in .net?
It´s not as simple as it seems, because the structure (that substitutes "type" in .net") cannot have the "arrays" of integer with a declared size in the structure, so:
Public Structure LowerLevel
friend Value(100) as integer
End type
would be invalid because of the "100" in it. Anyway,
Public Structure LowerLevel
friend Value() as integer
End type
would be OK.
Now my example:


Public Structure LowerLevel
friend Value() as integer
End Structure

Public Structure UpperOne
Dim UnderOneLevel () as LowerLevel
End Structure

public MyVariable(10) as UpperOne


It compiles ok in VB.net.... But what if I need 1000 Underonelevel´s and 100 values in each????

The only possible way I could get it to work was the ugliest one:


public x ,y ,z as integer

for x = 1 to 10
redim myvariable(x).underonelevel(1000)
next x

for y = 1 to 10
for x = 1 to 1000
redim myvariable(y).underonelevel(x).value(100)
next x
next y


Why did I do it?
I noticed if I only declare something like:
redim Myvariable(10).underonelevel(1000)
redim Myvariable(10).underonelevel(1000).value(100)

I will only have created 100 "values" in Myvariable.underonelevel(1000),
so Myvariable(10).underonelevel(1000).value(55) would be valid
in the other hand
i wont have 100 "values" in any other "underonelevel" so
Myvariable(10).underonelevel(999).value(55) would not be valid because in Myvariable(10).underonelevel(999) it was not declared how many "values" the variable should have
Similarly, so Myvariable(9).underonelevel(1000).value(55) would not be valid because of the nine... and so on...

Anyway it could be done like in the "old" Vb6????
Do I really need all this code(and time, it took me 30 seconds to init the app)???

Hope someone can help me!
Thanks in advance!

Patrick Goettert



GeneralForms and controls are vertically stretched with foreign language Windows Pin
wleong_lws28-Sep-04 13:15
wleong_lws28-Sep-04 13:15 
QuestionOutlook sync component? Pin
cmkWildsky28-Sep-04 11:56
cmkWildsky28-Sep-04 11:56 
GeneralRe: dropping module into application Pin
Dave Kreskowiak28-Sep-04 9:40
mveDave Kreskowiak28-Sep-04 9:40 
Generalimage's read pixel with VB6 Pin
2ndhandcomputer28-Sep-04 7:22
2ndhandcomputer28-Sep-04 7:22 
GeneralRe: image's read pixel with VB6 Pin
Jose Cezar S. Ynion28-Sep-04 20:33
Jose Cezar S. Ynion28-Sep-04 20:33 
GeneralRe: image's read pixel with VB6 Pin
2ndhandcomputer29-Sep-04 7:55
2ndhandcomputer29-Sep-04 7:55 
GeneralRe: image's read pixel with VB6 Pin
Jose Cezar S. Ynion29-Sep-04 16:39
Jose Cezar S. Ynion29-Sep-04 16:39 
GeneralSaving modified fields Pin
mtone28-Sep-04 4:55
mtone28-Sep-04 4:55 
QuestionHow do you draw outside of your Form?? Pin
RichiLloyd28-Sep-04 4:34
RichiLloyd28-Sep-04 4:34 
GeneralHTML Parser Pin
wmeurer28-Sep-04 3:31
wmeurer28-Sep-04 3:31 
Generalproblem in working with childforms in vb.net Pin
Mohan G28-Sep-04 3:10
Mohan G28-Sep-04 3:10 
GeneralRe: problem in working with childforms in vb.net Pin
Dave Kreskowiak28-Sep-04 3:26
mveDave Kreskowiak28-Sep-04 3:26 
GeneralRe: problem in working with childforms in vb.net Pin
Anonymous29-Sep-04 5:25
Anonymous29-Sep-04 5:25 
Generalseperate string Pin
macmac3828-Sep-04 2:36
macmac3828-Sep-04 2:36 
GeneralRe: seperate string Pin
Jim Matthews28-Sep-04 3:36
Jim Matthews28-Sep-04 3:36 
GeneralRe: seperate string Pin
macmac3828-Sep-04 3:48
macmac3828-Sep-04 3:48 
GeneralRe: seperate string Pin
macmac3828-Sep-04 4:01
macmac3828-Sep-04 4:01 

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.