Dir() problem....

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

Patrick wrote:
>Hy,

>(Happy new year.)
Happy new year too, to all Euphorians!

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

>Can someone help me ??

>Bye,

>PQ
>QC

>(quistnet at yahoo.com)

---- example:
object Directory        -- an object can hold an atom OR a sequence

Directory =3D dir("*.exe")

if atom(Directory) then
    -- no sequence, so no exe files found
    puts("Nothing found")
else
    -- there is a sequence
    -- rest of your routine
end if
---- end example ----

Ad Rienks
kwibus at dolfijn.nl

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

Search



Quick Links

User menu

Not signed in.

Misc Menu