C18 String Reformat Tool

by Rolf Lear

Input must have the structure:

M_NULL=
M_MAIN=Main Menu
M_A=AAAA
M_B=BBBB
M_C=CCCC
M_SPACE=  SPACE
M_CRAZY=!@#$%
M_LONG=AbcdEfgHijkLmnopQrstUvwZyz
M_SUBSET=ACE
M_SUPERSET=CCAAAA
Note:
  1. Only lines with an '=' are processed
  2. All spaces are significant.
  3. Carriage Returns (\r) next to Newlines (\n) are ignored.
  4. All output is issued with just newlines (\n) which may or may not be appropriate for your development environment.
  5. The String Constant is split somewhere after 50 characters on to a new line. The C Continuation '\' must be the very last character on the line!


Paste your String config data in to the following area.

After Convert, copy then paste the following in to a header file e.g. StringConst.h

After Convert, copy then paste the following in to a C file e.g. StringConst.c

The following messages indicate "optimizations" that were made.

To use this code it becomes a "simple" case of:

void LCDPrintString(int pos)
{
    while (strings[pos])
        LCDWriteChar(strings[pos++]);
}

.....
LCDPrintString(M_MENU);
LCDPrintString(M_SUPERSET);
....
See also: