|
-
Jul 14th, 2000, 12:45 PM
#1
Thread Starter
Lively Member
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
-
Jul 14th, 2000, 12:51 PM
#2
If counts is variable you want to pass back, put this at the end of your Function.
Code:
FileFinder = counts
-
Jul 14th, 2000, 12:59 PM
#3
Thread Starter
Lively Member
Thanks, I knew that it was something simple.
Using VB6 Still Pluging away
-
Jul 14th, 2000, 01:09 PM
#4
Addicted Member
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.
-
Jul 14th, 2000, 01:41 PM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|