TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: THE NATURAL PHILOSOPHER
from: ANDY BURNS
date: 2018-02-21 07:42:00
subject: Re: How to use while loop

The Natural Philosopher wrote:

> print(last==readpin()?((last=readpin()==OPENED)?"Opened":"Closed"):"");
>
> I knew one line was possible!

Apart from the case when the pin changes state between your two reads ..

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.