Another issue, it's simple, but its not working for me, must be missing something
All this code does is parse each character looking for the "Key" (of the chord) which is located toward the top of the text,
Finding the text works fine.
My problem is, if there is an invalid character, I raise a message box.
However, all I want to do is display that invalid char in the message box string, but it don't like me.
I get this error....
Error: Incompatible type for arg no. 1: Got "AnsiString", expected "PChar"I have tried lots of ways to convert the PChar to a String,, but can't seem to get it right.
Can somebody see something I am missing??
There may be an easier way to do this, but this is what my basic knowledge came up with, albeit it may be wrong

CODE:
procedure TForm1.getKey(Sender: TObject);
const
n = ['1'..'9','C','D','E','F','G','A','B','a','b','d','f','g','i','j','l','m','s','t','u','/','#','?']; //valid chord characters
var
C: Char;
i: integer;
bStart: Boolean = False;
extractstr: String;
p: String;
begin
for i := 1 to length(synEdit.text) do
If synEdit.text[i] = '[' Then
{skip}
bStart:=True
else If synEdit.text[i] = ']' Then
begin
Break;
end
else
begin
if bStart=True Then
begin
c:=synEdit.text[i];
p:=c;
if c in n Then
extractstr := extractstr + c
else
begin
Application.MessageBox('There is an invalid character ( ' + p + ' ) in the "Key:" signature. Please correct the key to a valid key character.', 'Invalid Key Character', MB_ICONERROR);
end
end
else
{skip}
end;
lbKey.Caption:=extractstr;
end;
Like I said, everything works except the PChar to String issue in the message box string.