home *** CD-ROM | disk | FTP | other *** search
EPOC OPL Source | 1998-08-30 | 1.6 KB | 57 lines |
-
-
- Rem Backlight, an addon command for Shell5
- Rem Control the backlight
- Rem
- Rem Copyright (C) 1998 Nick Murray
- Rem
- Rem This program is free software; you can redistribute it and/or
- Rem modify it under the terms of the GNU General Public License
- Rem as published by the Free Software Foundation; either version 2
- Rem of the License, or (at your option) any later version.
- Rem
- Rem This program is distributed in the hope that it will be useful,
- Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
- Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Rem See the GNU General Public License for more details.
- Rem
- Rem You should have received a copy of the GNU General Public License
- Rem along with this program; if not, write to the Free Software Foundation,
- Rem Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- Rem
- INCLUDE "System.oxh"
- PROC backlight%:(n%)
- LOCAL state%,buf$(255)
- ONERR ErrTrap::
- state%=BACKLIGHTON&:
- IF n%=1
- IF state%
- fprint%:("ON")
- ELSE
- fprint%:("OFF")
- ENDIF
- ELSEIF n%>2
- Usage::
- PRINT "Usage: backlight [on¦off¦toggle]"
- ELSE
- buf$=LOWER$(PEEK$(argv&(2)))
- IF buf$="on"
- state%=1
- ELSEIF buf$="off"
- state%=0
- ELSEIF buf$="toggle"
- state%=-(state%=0)
- ELSE
- GOTO Usage::
- ENDIF
- SETBACKLIGHTON:(state%)
- ENDIF
- RETURN BACKLIGHTON&: Rem so scripts can query $?
- ErrTrap::
- ONERR off
- PRINT err$:(ERR)
- RETURN ERR
- ENDP
-
-
-