Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Computing > Alt Msdos Batch Nt > Evaluate string...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 12 Topic 3322 of 3392
Post > Topic >>

Evaluate string position and use this value for substring

by "Andreas Eibach" <aeibach@[EMAIL PROTECTED] > Jun 30, 2008 at 10:17 PM

Hi there,

I'm trying to crack a big nut atm...

Supposed I have a string

SET xx=Andreas

Now I can echo the first 5 characters

echo %xx:~0,5%

You get "Andre".
Now I want to calculate the target position by a constant, say

SET upto=5

But

 echo %xx:~0,%upto%%

does not work, since DOS batch does not seem to sup****t nested variables.
Is there any way I can accomplish this anyway?

TIA, Andreas
 




 12 Posts in Topic:
Evaluate string position and use this value for substring
"Andreas Eibach"  2008-06-30 22:17:40 
Re: Evaluate string position and use this value for substring
Tom Lavedas <tglbatch@  2008-06-30 13:41:14 
Re: Evaluate string position and use this value for substring
"Andreas Eibach"  2008-07-01 01:44:16 
Re: Evaluate string position and use this value for substring
"Andreas Eibach"  2008-07-01 01:52:31 
Re: Evaluate string position and use this value for substring
Tom Lavedas <tglbatch@  2008-06-30 18:52:02 
Re: Evaluate string position and use this value for substring
"Andreas Eibach"  2008-07-01 18:54:46 
Re: Evaluate string position and use this value for substring
"billious" <  2008-07-01 09:55:15 
Re: Evaluate string position and use this value for substring
"Andreas Eibach"  2008-07-01 18:52:32 
Re: Evaluate string position and use this value for substring
foxidrive <gotcha@[EMA  2008-07-02 07:10:42 
Re: Evaluate string position and use this value for substring
"billious" <  2008-07-02 13:07:46 
Re: Evaluate string position and use this value for substring
foxidrive <gotcha@[EMA  2008-07-02 21:51:08 
Re: Evaluate string position and use this value for substring
Timo Salmi <ts@[EMAIL   2008-07-02 19:37:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 27 19:19:03 CDT 2008.