If not %version%==%keyversion% goto new
Moderator: DosItHelp
If not %version%==%keyversion% goto new
I'm making a program and I want to make check by using save.bat
In save.bat version=0.1 and in program it self is keyversion=0.2
And if version and keyversion would be same it will goto somewhere
And if version isn't same like keyversion (will be different) will go to New.
But I have problems.
(sorry for my English)
In save.bat version=0.1 and in program it self is keyversion=0.2
And if version and keyversion would be same it will goto somewhere
And if version isn't same like keyversion (will be different) will go to New.
But I have problems.
(sorry for my English)
Re: If not %version%==%keyversion% goto new
How do you expect anyone to help you when you have not provided any code for us to help you with?
Re: If not %version%==%keyversion% goto new
@Sqaushman: maybe he has no code yet.
Test this:
And
But you have to do:
That LSS will work correctly.
I hope i was able to help you.
Greetings,
Hradschek
Test this:
Code: Select all
if %version%==%keyversion% goto somewhere
:somewhere
rem Some code to execute here
And
Code: Select all
if %version% LSS %keyversion% goto new
:new
rem code....
But you have to do:
Code: Select all
set /a savegameversion=1
set /a keyversion=2
That LSS will work correctly.
I hope i was able to help you.
Greetings,
Hradschek
Re: If not %version%==%keyversion% goto new
Sorry for long time no reply. I don't want people to see my code. And BTW It's single line error. I get "Goto was unexpected"
Squashman wrote:How do you expect anyone to help you when you have not provided any code for us to help you with?
Re: If not %version%==%keyversion% goto new
Sorry for long time no reply. I don't want people to see my code. And BTW It's single line error. I get "Goto was unexpected"
In my code you first is completely same like i was trying before visiting this site and i get "Goto Unexpected" if started from cmd not double clicking .bat
Your Second code worked.
Thank you for help. I will credit you in my program (if you want) when i will release it.
In my code you first is completely same like i was trying before visiting this site and i get "Goto Unexpected" if started from cmd not double clicking .bat
Your Second code worked.
Thank you for help. I will credit you in my program (if you want) when i will release it.
Hradschek wrote:@Sqaushman: maybe he has no code yet.
Test this:Code: Select all
if %version%==%keyversion% goto somewhere
:somewhere
rem Some code to execute here
AndCode: Select all
if %version% LSS %keyversion% goto new
:new
rem code....
But you have to do:Code: Select all
set /a savegameversion=1
set /a keyversion=2
That LSS will work correctly.
I hope i was able to help you.
Greetings,
Hradschek
Re: If not %version%==%keyversion% goto new
TheBads wrote:Sorry for long time no reply. I don't want people to see my code. And BTW It's single line error. I get "Goto was unexpected"Squashman wrote:How do you expect anyone to help you when you have not provided any code for us to help you with?
Don't expect to get any help then. Trying to help someone without seeing all the relevant pieces of code is like playing Craps in Vegas!
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: If not %version%==%keyversion% goto new
TheBads wrote:Sorry for long time no reply. I don't want people to see my code. And BTW It's single line error. I get "Goto was unexpected"
In my code you first is completely same like i was trying before visiting this site and i get "Goto Unexpected" if started from cmd not double clicking .bat
Your Second code worked.
Thank you for help. I will credit you in my program (if you want) when i will release it.
When you're responding to somebody by quoting them, put your comments under the quote so that we know what you're responding to. If you write your post above the quote, that means it's unrelated.
Also, don't take this the wrong way, but literally everybody in this topic is better at writing code than you, so if you're worried about somebody stealing your code, don't be; we've already written our own versions of whatever it is you think you've invented.
Last edited by ShadowThief on 03 May 2016 15:48, edited 1 time in total.
Re: If not %version%==%keyversion% goto new
Free code help is a two way street.
Re: If not %version%==%keyversion% goto new
You could remove all lines, that are not related with the error, change variable names and ... :TheBads wrote:I don't want people to see my code.
So noone could see your code Project (only <=10 lines in most cases).
penpen