I am trying to make a chat application that will post a message in a memo in a form similar to this:
USERNAME-> Message
but it goes to my note as follows:
USERNAME
Here is my code:
const cnMaxUserNameLen = 254; var sUserName: string; dwUserNameLen: DWORD; text : string; begin dwUserNameLen := cnMaxUserNameLen - 1; SetLength(sUserName, cnMaxUserNameLen); GetUserName(PChar(sUserName), dwUserNameLen); SetLength(sUserName, dwUserNameLen); text:= sUserName + '-> ' + edit1.Text; memo1.Lines.Add(text);
Any suggestions for fixing it?
source share