2 Copyright © 1995-2001, 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
))
75 char buffer
[256], a
= 0;
77 SelectInput(cli
->cli_CurrentInput
);
84 status
= ReadItem(buffer
, sizeof(buffer
), NULL
);
86 if (status
== ITEM_ERROR
)
89 if (status
== ITEM_NOTHING
)
97 switch ((temp
= FindArg("IF,ENDIF", buffer
)))
114 /* Take care of long lines */
118 } while(a
!= '\n' && a
!= ENDSTREAMCH
);
124 PrintFault(ERROR_NO_MATCHING_ELSEENDIF
, "Else");
131 PrintFault(ERROR_SCRIPT_ONLY
, "Else");