Results 1 to 5 of 5

Thread: Dumb question, but have to ask

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Question

    I'm trying to pass a variable back from a function and it is not working. I know that I'm forgetting something, but I have confused myself.
    sub tryingtofind()

    counters = FileFinder(GetFiles)
    Counter = CInt(counters)
    If Counter <> 0 Then
    CaptionValue = 2
    StatusCaptionCase (CaptionValue)
    'lblStatus.Caption = StatusCaption

    'move the files from the input directory to the correct subfolder
    'of the directory to store the files
    result = MoveFiles
    ActionValue = result
    If ActionValue = 3 Or ActionValue = 4 Then
    CaptionValue = 3
    Else
    CaptionValue = 0
    End If
    'write to the lstReport what was done
    'example "Moved file from here to there
    ActionCase (ActionValue)
    lstReport.AddItem Action
    'write to the lstFile the file name that was moved
    'example "NF-XYZ-000-1234"
    lstFile.AddItem FileName

    End If
    end sub
    Public Function FileFinder(WatchDir As String) As String
    Dim FileFinding As String
    Dim count As Integer
    Dim counts As String
    count = 0
    FileFinding = Dir(WatchDir) 'Where to look for.
    Do Until FileFinding = ""
    count = count + 1
    FileFinding = Dir
    Loop

    counts = CStr(count)
    'FileFinder counts
    End Function
    Using VB6 Still Pluging away

  2. #2
    Guest
    If counts is variable you want to pass back, put this at the end of your Function.

    Code:
    FileFinder = counts

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Wink

    Thanks, I knew that it was something simple.
    Using VB6 Still Pluging away

  4. #4
    Addicted Member
    Join Date
    Feb 2000
    Posts
    224

    Please Format your code...

    ASSUMING...GURU MEGATRON...SOLVED your Problem..

    Your TOPIC...Inspired me to write this blurb for this
    forum...

    " WELCOME TO VB-WORLD.
    where you can ASK the DUMBEST question,
    HEAR DEAFENING Answers and
    SEE the BLINDEST Programming Ideas.. "

    ANY...one with no sense of Humour..?
    Please....Pardon.



  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Wink

    Yes he answered the question for me. AND thanks for the joke it is well welcomed on a day when all the is required is =, but you can not remember that.
    Using VB6 Still Pluging away

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width