Hierophant
Registered User.
- Local time
- Today, 23:07
- Joined
- Mar 14, 2003
- Messages
- 28
Gday,
I've very little experience with VB, so am remedying that. I'm writing a fun little app that will let me document my data CD collection. Ie, you put a CD in, hit 'Document', and away you go. A DB searched will tell lots of interesting things, and should avoid those 30 minute flipping-thru-cd sessions trying to find something.
My problem is - I've written a simple recursive method that takes two arguments. However, VB syntax checker yells when I specify these two arguments in func(arg1, arg2) fashion - it says, "expected '='". Why is this?
Here is where I am calling the function..
And here is the recursive function - see it requires a passed in int,
which is supplied literally initially as zero, then is found consequently
as a returned value from the documentFolder() func.
Note that the documentFile(file, integer) function also goes red, and demands a '='.. but strangely the documentFolder(folder, integer) function doesn't spawn any complaints! It returns a value...
Ahh.. this should be an easy one guys.
Syntax! (I should buy a book, probably)
Cheers, and hope to hear from you soon.
Hiero
I've very little experience with VB, so am remedying that. I'm writing a fun little app that will let me document my data CD collection. Ie, you put a CD in, hit 'Document', and away you go. A DB searched will tell lots of interesting things, and should avoid those 30 minute flipping-thru-cd sessions trying to find something.
My problem is - I've written a simple recursive method that takes two arguments. However, VB syntax checker yells when I specify these two arguments in func(arg1, arg2) fashion - it says, "expected '='". Why is this?
Here is where I am calling the function..
Code:
Dim tempInt As Integer
For Each subDir In currDir.SubFolders
tempInt = documentFolder(subDir, 0)
[COLOR=Red]process (subDir, 0)[/COLOR]
Next subDir
And here is the recursive function - see it requires a passed in int,
which is supplied literally initially as zero, then is found consequently
as a returned value from the documentFolder() func.
Code:
Function process(ByRef fld As Folder, ByVal par As Integer)
Dim subFile As File
Dim subDir As Folder
'document each file in the folder
For Each subFile In fld.Files
'document this file
[COLOR=Red]documentFile(subFile, par)[/COLOR]
Next subFile
'tempint contains parent ID
Dim tempInt As Integer
'document each folder in the folder, and then call process on it
For Each subDir In fld.SubFolders
'document, and return parent value to be fed into process
tempInt = documentFolder(subDir)
'recursively call process
[COLOR=Red]process(subDir, tempInt)[/COLOR]
Next subDir
End Function
Note that the documentFile(file, integer) function also goes red, and demands a '='.. but strangely the documentFolder(folder, integer) function doesn't spawn any complaints! It returns a value...
Ahh.. this should be an easy one guys.

Cheers, and hope to hear from you soon.
Hiero