Nesting statement if ()==() ( ) gives an error
Posted: 02 Nov 2020 02:36
These IF statements are suppose to compare strings.
As you will see we are comparing: literal "c" character with another literal "c" character.
And later on, adding another if statement that compare: literal "b" character with another literal "b" character.
Or at least I think so.
First test, everything is ok
Output:
Second test, there is an Error
Output:
As you will see we are comparing: literal "c" character with another literal "c" character.
And later on, adding another if statement that compare: literal "b" character with another literal "b" character.
Or at least I think so.
First test, everything is ok
Code: Select all
@ECHO OFF
IF (c)==(c) (
echo test
)
Code: Select all
test
Second test, there is an Error
Code: Select all
@ECHO OFF
IF (c)==(c) (
echo test
IF (b)==(b) (
echo yes
(
)
Code: Select all
) was unexpected at this time.