Page 1 of 1
If not %version%==%keyversion% goto new
Posted: 03 Apr 2016 02:27
by TheBads
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)
Re: If not %version%==%keyversion% goto new
Posted: 03 Apr 2016 07:59
by Squashman
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
Posted: 07 Apr 2016 15:12
by Hradschek
@Sqaushman: maybe he has no code yet.
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
Posted: 30 Apr 2016 03:02
by TheBads
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
Posted: 30 Apr 2016 03:15
by TheBads
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.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
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
Posted: 03 May 2016 09:57
by Squashman
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!
Re: If not %version%==%keyversion% goto new
Posted: 03 May 2016 10:28
by ShadowThief
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.
Re: If not %version%==%keyversion% goto new
Posted: 03 May 2016 12:37
by Squashman
Free code help is a two way street.
Re: If not %version%==%keyversion% goto new
Posted: 03 May 2016 14:46
by penpen
TheBads wrote:I don't want people to see my code.
You could remove all lines, that are not related with the error, change variable names and ... :
So noone could see your code Project (only <=10 lines in most cases).
penpen