There are a variety of ways to do this. I have experimented with similar things in the past... You could use a bytetable to hold the characters for the messages. You could do one for all languages or one for each language.
Method 1. Put all of the messages in one bytetable. At the start of each message put a character count for how big the message is. Then in the display function. You pass in an index number for which message you wish to output. The display function simply walks through the messages by using the count until it gets to the start of the message you wish to output. If all of the languages are stored in one bytetable you could calculate the index number by lang*<Cnt per lang>+msg_num. For example in my phoenix program I had a bytetable that looked like:
Code:
_GATENAMES bytetable 8, "Ripple 6",|
9, "Ripple 12",|
12, "Quadripple 9",|
8, "Tripod 4",|
8, "Tripod 6",|
8, "Tripod 8",|
7, "Wave 12",|
7, "Wave 18"
The code to walk the list is not difficult. I usually end up writing it in assembly language, because I enjoy that. But in basic it might look something like:
Code:
index var word
index = 0
while msg_num > 0
index = index + _GATENAMES(index) + 1 ' point to the next item
msg_num = msg_num - 1
wend
' now output the message
serout 0, N9600, [str _GATENAMES(index+1)\_GATENAMES(index)]
...
Note: I have not tried or compiled this. Normally I would use the pointer class and generate a pointer in asm... but trying to keep it simple.
Next option would be store each of the messages separately and use a pointer table. Problem is that basic does not allow me to generate a table using pointers at compile time. I have hacked this in by tricking out compiler, but requires assembly language... Could build double indirection. That is you have all of the English messages. Then have a table with the addresses of the English messages. Likewise you could have a table of German messages. Then you could have a table with a pointer to the tables for each language... Easy in C but...
Another option, store each of the messages in EEPROM. Then you could store each message at a know offset in the EEPROM and write the code similar to what you have. Instead of choosing a page number you simple generate an offset per language into the EEPROM. Problem is no easy way to have compiler save these message out into the EEPROM. Probably need simple program the outputs them first...
Hopefully someone else will have a simpler solution for you.
Good Luck
Kurt