- Jul
- 81
- 0
TCC 10.00.41 Windows XP [Version 5.1.2600]
This batch file fills a small array
--
setlocal
echo setarray displays %@execstr[setarray]
setarray tablo[4,3]
set cnt=-1
do row = 0 to 3
do col = 0 to 2
set cnt=%@inc[%cnt]
set tablo[%row,%col]=%cnt
enddo
enddo
endlocal
--
and displays
TCC: C:\btm\test1.btm [2] No array variables defined
setarray displays
If I run the batch file again, it displays
setarray displays tablo[4,3]
TCC: C:\btm\test1.btm [3] Array variable is already defined "tablo"
Shouldn't "setlocal" have flushed the the array with the other local variables when the batch file ended? As it is, to clear it I have to "unsetarray tablo" either in the batch file or on the command line.
--
Peter
This batch file fills a small array
--
setlocal
echo setarray displays %@execstr[setarray]
setarray tablo[4,3]
set cnt=-1
do row = 0 to 3
do col = 0 to 2
set cnt=%@inc[%cnt]
set tablo[%row,%col]=%cnt
enddo
enddo
endlocal
--
and displays
TCC: C:\btm\test1.btm [2] No array variables defined
setarray displays
If I run the batch file again, it displays
setarray displays tablo[4,3]
TCC: C:\btm\test1.btm [3] Array variable is already defined "tablo"
Shouldn't "setlocal" have flushed the the array with the other local variables when the batch file ended? As it is, to clear it I have to "unsetarray tablo" either in the batch file or on the command line.
--
Peter