On Thursday 17 September 2009, Rolf-Werner Eilert wrote:
> Benoît Minisini schrieb:
> >> Rolf-Werner Eilert wrote:
> >>> Just stumbled over this when trying to implement a small copying
> >>> function:
> >>>
> >>>    FOR EACH datei IN Dir(opfad, odatei & ".*")
> >>>      IF NOT file.Ext(opfad &/ datei) = "lock" THEN
> >>>        COPY opfad &/ datei TO ziel &/ datei
> >>>        SELECT CASE file.Ext(ziel &/ datei)
> >>>        CASE "fehl", "feldbak", "felder", "notizen"
> >>>          SHELL "chgrp kartei " & ziel &/ datei WAIT
> >>>          SHELL "chmod 660 " & ziel &/ datei WAIT
> >>>        CASE "konto", "kontobak", "ktx", "ktxbak"
> >>>          SHELL "chgrp konto " & ziel &/ datei WAIT
> >>>          SHELL "chmod 660 " & ziel &/ datei WAIT
> >>>        END SELECT
> >>>      END IF
> >>>    NEXT
> >>>
> >>> IF NOT ... = ... THEN
> >>>
> >>> wouldn't copy anything, although only one file has the given extension.
> >>> When I change this line into
> >>>
> >>> IF file.Ext(opfad &/ datei) <> "lock" THEN
> >>>
> >>> everything runs as expected. Doesn't make sense to me as both ways
> >>> should mean the same in my understanding of logical NOT (which doesn't
> >>> mean too much... :-) )
> >>>
> >>> Regards
> >>>
> >>> Rolf
> >>  From the docs, NOT is an operator that makes a boolean it's opposite
> >> (TRUE turns to FALSE and vice versa) and will also invert each bit in an
> >> integer.  NOT(11) = -12 because that's what you get when you change
> >> every bit from on to off and vice versa.
> >>
> >>  From other examples in the docs, if you NOT a string with something in
> >> it, you will get FALSE.  However, if you NOT an empty string, you will
> >> get TRUE.
> >>
> > 
> > In other words, try to use brackets: IF NOT (...) = ... THEN
> > 
> > 
> 
> Aaah - ok, now it's clear to me, too ;-)
> 
> Regards
> 
> Rolf

Funny isn't it ?? :) :)

Best regards,

Ron_1st

-- 


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to