PDA

View Full Version : error code 20 parentheses



sandyrepope
26-03-2007, 02:08
I've been trying to learn some more new stuff and have a problem with:
uses "CONSOLE"
USES "FILE"

dim MyList() as string 'an array for file names
dim Num_Names as long 'holds the total number of files found
dim gFile as string 'holds the path
dim A_Loop as long 'variable for/next loop

gFile = app_sourcepath 'path

Num_Names = dir_listarray (MyList, gFile, "*.*") 'get file names

console_writeline "Number of files found: " + Num_Names 'number of filenames we got


for A_Loop = 1 to Num_Names 'a for/next loop to see what
console_writeline (MyList(A_Loop)) 'filenames we got in the array
next


console_waitkey 'keeps window open so we can read results

In the line 'console_writeline(MyList(A_Loop))' it tells me that there is a missing close parens ')' but I don't see where one is missing.
Thanks
Sandy

Michael Hartlef
26-03-2007, 05:07
Looks like a bug to me. Eros?

ErosOlmi
26-03-2007, 07:09
Yes it is a bug.
Number of dimensions in array were not correctly set.
Fix will be present in next release.

A temp work-around is to add a REDIM PRESERVE just after DIR_LISTARRAY like in the following:


Num_Names = dir_listarray (MyList, gFile, "*.*") 'get file names
redim preserve mylist(Num_Names)


Let me know
Eros

sandyrepope
26-03-2007, 15:30
I tried it once and it worked.

Thanks
Sandy