0

I have created a variable of type array but both the variable name and indexes are variables, And I would like to read them as a loop FOR: This is the code snippet that I can't solve

set /p dato=dato:
set /a indice+=1
for %%a in (%dato%) do (set %campo[%indice%]%=%%a)
for %%b in (%campo[%?%]%) do echo %%b

I can't understand How to tell the command to search all elements of that array.

julio
  • 1
  • isnt this what you're telling it to do `set %campo[%indice%]%=%%a` – t q Jul 06 '20 at 03:34
  • What I need is to tell the FOR command to use that array to search for the elements – julio Jul 06 '20 at 03:37
  • Please add question tag of the language in question. – iAmOren Jul 06 '20 at 06:18
  • Does this answer your question? [Arrays, linked lists and other data structures in cmd.exe (batch) script](https://stackoverflow.com/questions/10166386/arrays-linked-lists-and-other-data-structures-in-cmd-exe-batch-script) – T3RR0R Jul 06 '20 at 20:11

0 Answers0