views:

26

answers:

1
+2  A: 

Use

Set readProperties = dicProps

You alway have to use Set when working with objects.

Tester101
The function name is `readProperties`. Setting `[functionName] = [value]` in vbscript is specifying the return value.
KP
@KP: True, and whenever you assign an object reference to a variable you have to use Set.
Tester101
Wouldn't you agree it may not be a good idea to set an object within function 'myfunction', to the variable name 'myfunction', when the name is used to pass back a value?? That's smells of bad design IMO lol
KP
The only reason I was assigning the return value in the middle of the function is because I was trying to figure out what was wrong. The last part (For Each statement) is actually not part of the function.
tou
@KP: Looks to me as though the intention is to return a value, after all if there is no intention to return a value `Sub` should be used. The code at the bottom looks like some diagnostics to be deleted once the function is considered working. The true objective is to have a function create and return a Dictionary.
AnthonyWJones
fair enough....
KP