User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Computer Science and Software Design section within the Software Development category of DaniWeb, a massive community of 391,581 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,675 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Computer Science and Software Design advertiser:
Views: 2978 | Replies: 3
Reply
Join Date: Jul 2004
Posts: 17
Reputation: Kimmi is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Kimmi Kimmi is offline Offline
Newbie Poster

NEQ not working for IF command?!

  #1  
Sep 30th, 2004
hopefully any of the experts out there could help clear my suspicion...the 2 IF statements in my .bat file seem logiclly correct but it deosn't seem to work as I expected :

1) IF /I %varX% NEQ %varY%
2) IF NOT %varX%==%varY%

whereby the %varX% and %varY% are actually numeric digits extracted from a file (but numeric digits or not shouldn't matter as the /I should be taking care of it so the least case 1 should work...too bad it doesn't also :cry: )

looks so simple yet so complicated to code :mad: HELP :eek:
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,333
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Rep Power: 11
Solved Threads: 101
Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: NEQ not working for IF command?!

  #2  
Sep 30th, 2004
Hi,

This might show my ignorance to your situation, but what language are you programming in? I'm sure it might help somebody help you out here.
Alex Cavnar, aka alc6379
Reply With Quote  
Join Date: Aug 2004
Posts: 49
Reputation: felgall is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
felgall felgall is offline Offline
Light Poster

Re: NEQ not working for IF command?!

  #3  
Sep 30th, 2004
Have you tried:

IF NOT "%varX%" == "%varY%"
Reply With Quote  
Join Date: Jul 2004
Posts: 17
Reputation: Kimmi is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Kimmi Kimmi is offline Offline
Newbie Poster

Solution Re: NEQ not working for IF command?!

  #4  
Sep 30th, 2004
Originally Posted by felgall
Have you tried:

IF NOT "%varX%" == "%varY%"


Hiya, yeah, i h've tried it too but doesn't seem to work either....i suspect it's unable to take care of the condition if say %varX% is blank. Cos' my .bat file is actually in this sequence :

FIND "Counter" d:\local.dat > d:\read.txt
FOR /F "tokens=3* delims=" %%i in (d:\read.txt) do set varX=%%i
IF NOT "%varX%" == "%varY%" echo Diff

whereby the IF statement doesn't work only when the %varX% is found to be blank due to the word "Counter" is not exist in d:\local.dat file. How can I handle this situation then? :o
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Computer Science and Software Design Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Computer Science and Software Design Forum

All times are GMT -4. The time now is 10:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC