Re: Dir() problem....

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

EU>Hy,

EU>(Happy new year.)

EU>I have a problem with dir() (from file.e) .
EU>If I want the index of files for example :
EU>dir("*.exe")
EU>It returns a sequence when there are files.
EU>It returns -1 when there is no file with .exe .
EU>So if I check for -1 at the return it works when
EU>I have no files with .exe.
EU>But if there is a file with .exe .
EU>It gives an error message for the line I
EU>check for -1.

EU>Can someone help me ??

EU>Bye,

EU>PQ
EU>QC

EU>(quistnet at yahoo.com)

EU>______________________________________________________
EU>Get Your Private, Free Email at http://www.hotmail.com

If you are using something like:
object x
x = dir("*.exe")
if x = -1 then
        -- do something
end if
-- do something

You need to change it to one of the following:
if compare(x,-1) = 0 then

or

if integer(x) then

Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu