IfThere


Contents


Introduction and Overview

Within command scripts it is often necessary to execute commands conditionally, based on the existance (or not) of a file. The IfThere command provides this facility, building on the conditional nature of the 'If' command.


*Commands


*IfThere

Execute commands based on the existance of a file
Syntax
*IfThere <file> Then <true-command> Else <false-command>
Parameters
<file>-File to check the existance of
<true-command>-Command to execute if the file specified exists
<false-command>-Command to execute if the file specified does not exist
Use

This command is used to check for the existance of a file. If the file exists, the 'true' clause will be executed. If the file does not exist, the 'false' clause will be executed.

Example
*IfThere app$dir.file Then Echo File Exists
Related * commands
*If

Document information

Maintainer(s): RISCOS Ltd <developer@riscos.com>
History:
RevisionDateAuthorChanges
1ROLInitial version
Disclaimer:

Copyright © Pace Micro Technolgy plc, 2002.
Portions copyright © RISCOS Ltd, 2002.
Published by RISCOS Limited.
No part of this publication may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, or stored in any retrieval system of any nature, without the written permission of the copyright holder and the publisher, application for which shall be made to the publisher.