Click here to Skip to main content
15,916,378 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Call module with argument Pin
Mekong River13-Nov-04 4:21
Mekong River13-Nov-04 4:21 
QuestionDatakey for VB datagrid? Pin
Craig C.12-Nov-04 8:30
Craig C.12-Nov-04 8:30 
AnswerRe: Datakey for VB datagrid? Pin
Craig C.15-Nov-04 7:12
Craig C.15-Nov-04 7:12 
GeneralRe: Found it! Pin
Craig C.15-Nov-04 9:48
Craig C.15-Nov-04 9:48 
Generalcall card telephony solution! Pin
manasrahfantom12-Nov-04 8:18
manasrahfantom12-Nov-04 8:18 
GeneralRe: call card telephony solution! Pin
Mekong River13-Nov-04 4:27
Mekong River13-Nov-04 4:27 
GeneralFreespace Pin
KreativeKai12-Nov-04 5:02
professionalKreativeKai12-Nov-04 5:02 
GeneralRe: Freespace Pin
Dennis C. Dietrich12-Nov-04 17:02
Dennis C. Dietrich12-Nov-04 17:02 
GeneralRe: Freespace Pin
KreativeKai15-Nov-04 7:18
professionalKreativeKai15-Nov-04 7:18 
GeneralEdit box focus Pin
Red Sunday12-Nov-04 3:38
Red Sunday12-Nov-04 3:38 
GeneralRe: Edit box focus Pin
MohammadAmiry12-Nov-04 5:01
MohammadAmiry12-Nov-04 5:01 
GeneralRe: Edit box focus Pin
Mekong River13-Nov-04 4:31
Mekong River13-Nov-04 4:31 
GeneralRe: Edit box focus Pin
MohammadAmiry14-Nov-04 22:48
MohammadAmiry14-Nov-04 22:48 
GeneralRe: Edit box focus Pin
Mekong River15-Nov-04 13:27
Mekong River15-Nov-04 13:27 
GeneralDownloading files & VB6 Pin
RichardGrimmer12-Nov-04 0:21
RichardGrimmer12-Nov-04 0:21 
GeneralString Arrays Pin
beowulfagate11-Nov-04 22:50
beowulfagate11-Nov-04 22:50 
GeneralRe: String Arrays Pin
MohammadAmiry12-Nov-04 2:13
MohammadAmiry12-Nov-04 2:13 
GeneralRe: String Arrays Pin
beowulfagate12-Nov-04 13:33
beowulfagate12-Nov-04 13:33 
GeneralRe: String Arrays Pin
Dennis C. Dietrich12-Nov-04 16:13
Dennis C. Dietrich12-Nov-04 16:13 
Hi Beowulf!

How do I return an array of strings from a function? Just like the way String.Split does?

Take a close look at the VB.NET declaration of Split[^]. It's got brackets after its type. All you have to do in the function is to create an array of the appropriate type and size and finally use a reference to it as the function's return value. For example:
Option Explicit On
Option Strict On

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
                              ByVal e As System.EventArgs) Handles Button1.Click
        For Each str As String In TestFunction()
            MessageBox.Show(str)
        Next
    End Sub

    Private Function TestFunction() As String()
        Dim ReturnArray(1) As String
        ReturnArray(0) = "TestString"
        ReturnArray(1) = "Another String"
        TestFunction = ReturnArray
    End Function
End Class

Best regards
Dennis
GeneralLasso with vb.net Pin
arttut0211-Nov-04 22:26
arttut0211-Nov-04 22:26 
GeneralRe: Lasso with vb.net Pin
MohammadAmiry12-Nov-04 6:22
MohammadAmiry12-Nov-04 6:22 
GeneralDisplay record on the webpage Pin
Mekong River11-Nov-04 16:33
Mekong River11-Nov-04 16:33 
GeneralRe: Display record on the webpage Pin
Tom John11-Nov-04 21:21
Tom John11-Nov-04 21:21 
Generaltranslating vb6 code to vb.net 2003 code Pin
Anonymous11-Nov-04 5:50
Anonymous11-Nov-04 5:50 
GeneralRe: translating vb6 code to vb.net 2003 code Pin
Daniel Turini11-Nov-04 7:34
Daniel Turini11-Nov-04 7:34 

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.