Page 1 of 1

[HELP] How to read a variable with a for

Posted: 21 Feb 2020 10:31
by .:Xx4NG3LxX:.
Hello guys, I'm new in the forum, I'm 14 years old. I'm Venezuelan. I don't speak English very well but...

Ok, I would like know How to read a variable with a for.

Example:

Code: Select all

Set "abc=abcdefghijklmnopqrstuvwxyz"
For %%a in (::I don't know) do (::I don't know)
::More code
Thanks!

Re: [HELP] How to read a variable with a for

Posted: 21 Feb 2020 10:36
by Squashman
You really have not defined the scope of what you are trying to accomplish.

In the simplest form, to access the contents of a variable you reference the variable with percent symbols.

Code: Select all

Set "abc=abcdefghijklmnopqrstuvwxyz"
echo %abc%
If you want to read that variable with the FOR command, again just reference the variable with percent symbols.

Code: Select all

Set "abc=abcdefghijklmnopqrstuvwxyz"
For %%a in ("%abc%") do echo %%~a

Re: [HELP] How to read a variable with a for

Posted: 21 Feb 2020 10:56
by Squashman
I saw your reply before you decided to delete it. I am not going to provide an answer to your question now since you may have decided on changing the scope of your question.

Re: [HELP] How to read a variable with a for

Posted: 21 Feb 2020 11:08
by .:Xx4NG3LxX:.
Could you translate that please? Thanks!

Re: [HELP] How to read a variable with a for

Posted: 21 Feb 2020 11:15
by Squashman
.:Xx4NG3LxX:. wrote:
21 Feb 2020 11:08
Could you translate that please? Thanks!
I don't speak your language but feel free to use Google Translate yourself.

Re: [HELP] How to read a variable with a for

Posted: 21 Feb 2020 11:21
by Squashman
If you are having a difficult time getting help in English, may I suggest you post your question on a technical forum that speaks your language.

Stack Overflow en español

Re: [HELP] How to read a variable with a for

Posted: 21 Feb 2020 11:35
by .:Xx4NG3LxX:.
Good idea. But I'll follow visiting the forum. Thank you so much!

There are too many forums. I usually visite elhacker.net, is very good. But it's in Spanish.