WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Arrays
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Arrayize and Redimensioning Already Dimensioned Arrays

Keywords:   arrayize drop arrays  1638

Question:

I'm trying to use Arrayize to read an INI file, the contents of which include:
myfiles=filename1,filename2
and I want to grab everything after the equals sign, and break the filenames into an array.

I'm doing this in a loop, and it reads the first file OK, and the 2nd file OK, but then I get the error 1638 on the Arrayize statement.

Answer:

You're getting the error because once you dimensionalize an array, you can't redimensionalize it, unless you release it with the Drop function. In other words, you can't arrayize a variable that's already arrayed. Do a Drop to blank out the array, and then Re-Arrayize it.


Related Question:

Error 1638: Array Variable Assingment Error
on line: array=Arrayize(f1,@tab)
Hi: I am new to WinBatch! When running someone else script while he is away, I got above message! I reviewed the script and can't find what the problem is - Can you please help! Script is:
f1 = FileItemize("%drive%\pbms.%ver2%\%mod_long%\AOTFiles\*.*")
.... 
FileAppend("%templatedrv%\%mod_short%\axt3.axt","%drive%\pbms.%ver2%\%mod_long%\AOTFiles\pbms%mod_long%%ver2%_%lang%.axt")
array=Arrayize(f1,@tab)
elements = ArrInfo (array, "1")
handle =
FileOpen("%drive%\pbms.%ver2%\%mod_long%\AOTFiles\pbms%mod_long%%ver2%_%lang%.axt",
"APPEND")
.....
Thanks for your help!

Answer:

Maybe before this line:
array=Arrayize(f1,@tab)
change it to:
Drop(array)
array=Arrayize(f1,@tab)
If you are incredibly unlucky (I don't think so, but maybe)
If IsDefined(array) then Drop(array)
array=Arrayize(f1,@tab)

Article ID:   W14819
File Created: 2001:11:20:11:57:04
Last Updated: 2001:11:20:11:57:04