Weird Syntax Error

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ranguna173
Posts: 104
Joined: 28 Jul 2011 17:32

Weird Syntax Error

#1 Post by Ranguna173 » 28 Jul 2011 19:00

I've created an account on this website because i was having a problem with the game I'm writing...
A friend of mine told me of this website, he said if i had any question a could post it here.. I dunno his username but if you want i can ask him...
Anyways...
Here is my question:
I've been make this game in batch and i came across some weird errors, i figured out some of them except one..
Here is a Paint made image:
Image

The variable "CRED" equals 1000
The variables "ROXDIS1" "ROXDIS2" "ROXDIS3" "ROXDIS4" "ROXDIS5" "ROXDIS6" all equal 0

So i think that is all...
If you need more information or a bigger image just ask!

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Weird Syntax Error

#2 Post by dbenham » 28 Jul 2011 21:57

If you run with ECHO ON you should be able to determine the line with the syntax error yourself.

In this case, the line

Code: Select all

if %CRED% LSS 200
is to blame. You have your test condition, but you don't specify a command to execute if it evaluates to TRUE.

When posting on this site you should paste code as text, not images. You can use the Code button at the top of the submission editor to paste in the tags needed to specify a code block.

Dave Benham

Ranguna173
Posts: 104
Joined: 28 Jul 2011 17:32

Re: Weird Syntax Error

#3 Post by Ranguna173 » 01 Aug 2011 17:38

dbenham wrote:If you run with ECHO ON you should be able to determine the line with the syntax error yourself.

In this case, the line

Code: Select all

if %CRED% LSS 200
is to blame. You have your test condition, but you don't specify a command to execute if it evaluates to TRUE.

When posting on this site you should paste code as text, not images. You can use the Code button at the top of the submission editor to paste in the tags needed to specify a code block.

Dave Benham


Oh!
How couldn't i notice that?!

Ok, I'll post the code next time!
I'm gonna test it, and...
Done, it worked!!

Thx for the "run echo on ON" tip, it's realy helped!

(If you want to try the game just PM me :wink: , I'm stealing some ideas from "Uplink" a "Trace Hacker" games hehehe... :lol: )

Thx for the reply!!
And again..

Thx for the reply :D

Post Reply