tags:

views:

69

answers:

4

for example:

variable1=Dir$(some_path)

vs.

variable1=Dir(some_path)

what is the difference?

why not just do:

variable1=string(Dir(some_path))
+4  A: 

Hi there.

I think that the $ version returns a String, and the non $ version returns a variant.

http://stackoverflow.com/questions/519579/mid-vs-mid

http://forums.devarticles.com/microsoft-access-development-49/mid-function-vs-mid-26315.html

Cheers. Jas.

Jason Evans
why not just do:variable1=string(Dir(some_path))
I__
+4  A: 

The dollar sign indicates a string will be returned instead of a variant.

LittleBobbyTables
why not just do:variable1=string(Dir(some_path))
I__
Why do the extra work when the function does it for you?
LittleBobbyTables
+2  A: 

Dir() returns the result as the variant data type. Dir$() returns the result as the string data type.

Dylan West
+1  A: 

some uses $ version for its purported efficiency(as it accepts and outputs statically-typed variables only). I don't know how much is the speed difference between statically-typed and variant type, just benchmark

Michael Buen