Lookup Table - help needed
computer guy
Posts: 1,113
Hi there,
I want to read 2 strings from a text file and store them in a form of lookup table.
I can already read the strings in but need help with the lookup table.
e.g
Text file:
lookup:
Gives output:
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
I want to read 2 strings from a text file and store them in a form of lookup table.
I can already read the strings in but need help with the lookup table.
e.g
Text file:
Temp, Foo Hello, Temp2
lookup:
v1 := lookup("Temp") print(v1)
Gives output:
Foo
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
Comments
you have to reserve memory for the strings in RAM.
You can do this definining a byte-array or defining an "empty string"
= memory filled up with zeros
then you have to store the string bytewise into the array or the DAT-memorysection
"printing" strings (with FullDuplexSerial, TV_text etc.) works via a pointer which contains the memoryadress of the RAM where the string begins and has to be ALWAYS terminated with a zero
best regards
Stefan
I think I have enough information to complete the project now.
The information I needed was right under my nose.
Thank you for pointing it out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE