Edited:// I supose this shoulda went in da other forum ... Software that supports CF Displays.
I must be missing something ?
My code can detect and replace only the chars under 127. Any thing over that blanks the rest of the line out.
AnsiString TParserForm::ChangeBumCharacters(AnsiString inString)
{
AnsiString outString;
int inStringLength = inString.Length();
for(int i = 0; i < inStringLength; i++)
{
if(inString.IsDelimiter("{}|[]\\~@$^`", i))
{
AnsiString inSubString = inString.SubString(i,1);
char *a = inSubString.c_str();
AnsiString a2(a);
if(a2 =='`' )
{
char b = '\x027';
inString.Delete(i,1);
inString.Insert(b,i);
}
if(inSubString == '@')
{
char b = '\x07F';
//replaced with 127 as 160 dont work
inString.Delete(i,1);
inString.Insert(b,i);
}
}
}
outString = inString;
return outString;
}
void __fastcall TParserForm::Button1Click(TObject *Sender)
{
//testing the delimiters
AnsiString s = "test {}|[]\\~@$^` string";
AnsiString sShowThis = ChangeBumCharacters(s);
Label1->Caption = sShowThis;
lcdClearDisplay();
//shows chars up to 127 . after that the screen is blank
lcdSetCursorPos(0,0);
if(lcdSendString(sShowThis.c_str(),sShowThis.Length()));
//shows all windows chars even if wrong (original string)
lcdSetCursorPos(0,1);
if(lcdSendString(s.c_str(),s.Length()));
}