Suggestion for dir()

new topic     » topic index » view thread      » older message » newer message

Instead of returning -1 if the file is not found,
isn't it better to return {} ?

I have had many errors, just because I forgot to check if it is an
atom or not, in such lines:

  dd = dir("c:\\*.bmp") --where no *.bmp files on c:\
  for i = 1 to length(dd) do
      something("c:\\" & dd[i][D_NAME])
  end for

and it will crash on length().

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu