2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 /*****************************************************************************
23 Separate the 'true' and 'false' blocks of an If statement. The block
24 following an Else command is executed if the condition in the previous
25 If statement was false.
36 Copy random.device Sys:Devs/
38 Echo "Cannot find Sys:Devs"
51 12.01.2000 SDuvan implemented
53 ******************************************************************************/
56 #include <dos/dosextens.h>
57 #include <dos/rdargs.h>
58 #include <dos/stdio.h>
59 #include <proto/dos.h>
60 #include "dos_commanderrors.h"
62 #include <aros/shcommands.h>
68 struct CommandLineInterface
*cli
= Cli();
71 if ((cli
!= NULL
) && (cli
->cli_CurrentInput
!= cli
->cli_StandardInput
))
78 SelectInput(cli
->cli_CurrentInput
);
85 status
= ReadItem(buffer
, sizeof(buffer
), NULL
);
87 if (status
== ITEM_ERROR
)
90 if (status
== ITEM_NOTHING
)
98 switch ((temp
= FindArg("IF,ENDIF", buffer
)))
116 /* Take care of long and empty lines */
120 } while(a
!= '\n' && a
!= ENDSTREAMCH
);
126 PrintFault(ERROR_NO_MATCHING_ELSEENDIF
, "Else");
133 PrintFault(ERROR_SCRIPT_ONLY
, "Else");