Help on read external data file
El Paisa
Posts: 375
I am using a tv mode, using the FILE keyword.
I need to read and display a external file which contains 10,000 pairs of x,y bytes.
I do not want to store all these data, only to read a pair of x,y bytes at the time.
I really appreciate any help on this.
I need to read and display a external file which contains 10,000 pairs of x,y bytes.
I do not want to store all these data, only to read a pair of x,y bytes at the time.
I really appreciate any help on this.
Comments
Read the page in the Propellor Manual on the FILE keyword. It effectively declares a BYTE array in the DAT section of a program. You have to name
it (as you would any DAT variable) and you can use that name as the name of a BYTE array and index it any way you like ... so:
I can not understand the usage of the FILE command.
For instance, the attached file reads an a external file but the results are very weird.
Please somebody help.
This is the txt file version.
Remember, the compiler has just copied your file into the EEPROM and
given you a name to access the contents. It's just the raw byte stream.
Post Edited (Mike Green) : 7/22/2006 3:10:43 AM GMT
I hope somebody from Parallax give me a better detailed explanation of the usage of the FILE command.
I know I am doing something wrong but I need some help.
Why the program does not read the first character of the file?
Why when I read a entry (data(0)) a bunch of characters shows up?
Can I insert delimiters in the file?
Probably the FILE command needs a better examples.
Parallax please help.
'
PUB GetData | Index, Temp
Index := 0
repeat
Temp := byte[noparse][[/noparse]Data][noparse][[/noparse]Index++] 'Read data into Temp 1 byte at a time
<do something with Temp> 'Perform task with value in Temp
while Temp > 0 'Loop until end found
This example will read the imported data, one byte at a time, until it finds a byte equal to 0.
'
I assume that temp will hold ONE byte for each Index++
This is not true.
If· I wrote·· temp:=data[noparse][[/noparse]0] and print temp, the result is a bunch of bytes NOT ONE.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
Where I can get more info about this?
hope this helps
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
Thanks a lot, I got it.
Your help really help.