Click here to Skip to main content
15,891,136 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionscalable picture box Pin
iain65944-Jun-08 23:07
iain65944-Jun-08 23:07 
AnswerRe: scalable picture box Pin
JoeSharp4-Jun-08 23:40
JoeSharp4-Jun-08 23:40 
GeneralRe: scalable picture box Pin
iain65945-Jun-08 4:13
iain65945-Jun-08 4:13 
AnswerRe: scalable picture box Pin
Christian Graus5-Jun-08 4:51
protectorChristian Graus5-Jun-08 4:51 
QuestionHow to set default credentials on Vista using .Net ? Pin
Rizwan Bashir4-Jun-08 22:46
Rizwan Bashir4-Jun-08 22:46 
Questioncreate word document with open xml format Pin
zvedu0074-Jun-08 22:21
zvedu0074-Jun-08 22:21 
QuestionPassing Object Arrays as arguments and changing it. Pin
Joakim Nygren4-Jun-08 21:14
Joakim Nygren4-Jun-08 21:14 
AnswerRe: Passing Object Arrays as arguments and changing it. Pin
Johan Hakkesteegt5-Jun-08 3:44
Johan Hakkesteegt5-Jun-08 3:44 
Hi Jocke,

Supposing that you are using vb.net, and not knowing the rest of the code in the function, the error might not point to the objects in your array.

Generally speaking a function will work like so:
Private Function MyStringAlittleShorter(ByVal MyInputString As String, Byval Divider as integer) As String
Return MyInputString.Substring(1, MyInputString.Length / Divider)
End Function

...because I am returning the same type as I declared my function to be (even though one of the Byvals is of a different type).

Now your Byval is an array of type Object, which means that it can contain elements of different types. If you are also trying to return an array, and your function is declared boolean, you would get a type mismatch error. I.e. declare the function to be an array of type object, or perform the logic inside the function, and return a boolean.

Maybe that is the case ?

As for your second question: if the array is of type Object, than you should be able to add new elements of any type. You might get Index out of bounds errors ofcourse.

Hope it helps,

Johan

My advice is free, and you may get what you paid for.

Questionto get reply in child node Pin
Shanmugapriya.G4-Jun-08 20:44
Shanmugapriya.G4-Jun-08 20:44 
AnswerRe: to get reply in child node Pin
Ashfield4-Jun-08 21:12
Ashfield4-Jun-08 21:12 
QuestionOdbc Connection at the run time Pin
r_mohd4-Jun-08 20:43
r_mohd4-Jun-08 20:43 
AnswerRe: Odbc Connection at the run time Pin
Anubhava Dimri5-Jun-08 21:18
Anubhava Dimri5-Jun-08 21:18 
QuestionControl? Pin
RobertSoelner4-Jun-08 20:16
RobertSoelner4-Jun-08 20:16 
AnswerRe: Control? Pin
Rajesh Anuhya4-Jun-08 20:31
professionalRajesh Anuhya4-Jun-08 20:31 
AnswerRe: Control? Pin
Christian Graus5-Jun-08 4:53
protectorChristian Graus5-Jun-08 4:53 
AnswerRe: Control? Pin
Anubhava Dimri5-Jun-08 21:20
Anubhava Dimri5-Jun-08 21:20 
AnswerRe: Control? Pin
LloydA1117-Jun-08 9:00
LloydA1117-Jun-08 9:00 
Questionhow to? Pin
SSN4-Jun-08 5:35
SSN4-Jun-08 5:35 
AnswerRe: how to? Pin
Christian Graus4-Jun-08 6:05
protectorChristian Graus4-Jun-08 6:05 
AnswerRe: how to? Pin
~V~4-Jun-08 19:38
~V~4-Jun-08 19:38 
GeneralRe: how to? Pin
Guffa4-Jun-08 20:02
Guffa4-Jun-08 20:02 
GeneralRe: how to? Pin
SSN11-Jun-08 4:50
SSN11-Jun-08 4:50 
AnswerRe: how to? Pin
Guffa11-Jun-08 7:50
Guffa11-Jun-08 7:50 
AnswerRe: how to? Pin
Jay Royall4-Jun-08 22:48
Jay Royall4-Jun-08 22:48 
QuestionRe: how to? Pin
SSN11-Jun-08 4:43
SSN11-Jun-08 4:43 

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.