1) Write the syntax, example and use of the following commands.
(a) PRINT (b) INPUT (c) IF-THEN-ELSE (d) REM
Answers
PRINT:
/P - Sets the print mode. The preceding filename and all following filenames will be added to the print queue. You can also list files to cancel as part of the same PRINT command by entering the /C option followed by the filenames to cancel. /T - Deletes all files in the print queue (those waiting to be printed)
INPUT:
The INPUT statement has two syntaxes. The first syntax displays a prompt and assigns the input to variable. The second syntax specifies the location of the input field on the screen and lets you display the current value of variable. Both the current value and the displayed input can be formatted.
IF-THEN-ELSE:
If condition returns true then the statements inside the body of “if” are executed and the statements inside body of “else” are skipped. If condition returns false then the statements inside the body of “if” are skipped and the statements in “else” are executed.
REM:
REM must be followed by a space or tab character, then the comment. If ECHO is ON, the comment is displayed.