|
![](/i/fill.gif) |
hello.
i am trying to read colors (as defined in colors.inc) from a file. code
part here :
#declare fileName = "datas.txt";
#declare infos = array[20][3];
#set index=0;
#fopen FILE fileName read
#while (defined(FILE))
#read (FILE,pourcentage,decalage,couleur)
#declare infos[index][0] = pourcentage;
#declare infos[index][1] = decalage;
#declare infos[index][2] = couleur;
#set index=index+1;
#end
#fclose FILE
if "datas.txt" contains :
2, 0, Red
12, 1, Green
...
...
i get a parse error : expected 'float, vetor or string literal', colour
identifier found instead for the first line of the file.
if "datas.txt" contains :
2, 0, "Red"
12, 1, "Green"
...
...
i get a parse error for the line "#declare infos[index][2] = couleur" :
attempted to redefine float identifier as string identifier.
any chance to read a "named color" from a file an put it in an array ?
+
--
klp
Post a reply to this message
|
![](/i/fill.gif) |