PDA

Click to See Complete Forum and Search --> : dim statements


wildcat_2000
Nov 25th, 2004, 06:08 AM
hi,

can someone tell me whyDim myDir as DirectoryInfo = New DirectoryInfo(Server.MapPath(PATH_DEST))
Dim fileInfos() as FileInfo = myDir.GetFiles("*.hta")works whileDim myDir as DirectoryInfo
Dim fileInfos() as FileInfo

myDir = New DirectoryInfo(Server.MapPath(PATH_DEST))
fileInfos() = myDir.GetFiles("*.hta")not?

getting crazy on this one...

mendhak
Nov 25th, 2004, 06:22 AM
myDir = New DirectoryInfo(Server.MapPath(PATH_DEST))
fileInfos = myDir.GetFiles("*.hta")

wildcat_2000
Nov 26th, 2004, 03:54 AM
thank you mendhak,

my problem was if then i had to redefine new files, and you actually have to set to nothing the fileinfos object to do so.

for instance:Dim myDir As DirectoryInfo
Dim fileInfos() As FileInfo

myDir = New DirectoryInfo(Server.MapPath(PATH_DEST))
fileInfos() = myDir.GetFiles("*.hta")

'do some stuff here

fileinfos = nothing
fileInfos = myDir.GetFiles("*.mdb")

'do some stuff here this works, but if you comment out the fileinfos = nothing statement it will generate an error.

thank you, you showed me the way out,

cheers,

wc.

mendhak
Dec 1st, 2004, 11:45 AM
Originally posted by wildcat_2000


thank you, you showed me the way out,


I am the light, the truth... Sandpaper™ :afrog:

wildcat_2000
Dec 1st, 2004, 01:14 PM
lol :)