I am tring to connect to BNLS via Delphi. I am tring to send the verbyte request
procedure TfrmMain.BNLSConnect(Sender: TObject);
begin
AddC(clWhite,'Connected To BNLS');
Buffer := #1;
SendBNLS($10);
end;
procedure TfrmMain.SendBNLS(PacketID : Byte);
//(WORD) Message Length, including this header
//(BYTE) Message ID
//(VOID) Message Data
var
Len: Word;
begin
Len := Length(Buffer) + 1;
frmMain.BNLS.SendStream(Chr(Len) + PacketID + Buffer);
end;
When ever I try to compile I get an error telling me
[Error] UMain.pas(86): E2008 Incompatible types and highlights frmMain.BNLS.SendStream(Chr(Len) + PacketID + Buffer);
The declares are
Len: Word;
PacketID : Byte;
Buffer: WideString;
Any1 know how I can get this to work?
Edit: Spelling
Out of curiousity, are you the one using Delphi 2005? Isn't that developed for .NET?
Yea I am using 2005 and you dont need to develop for .Net
A word is 2 bytes *cough*. You are trying to make an ASCII char out of a 2 byte value. :X
that isnt my problem I dont think. SendStream() wants a TString
Quote from: rabbit on August 04, 2005, 11:45 PMA word is 2 bytes *cough*. You are trying to make an ASCII char out of a 2 byte value. :X
Actually, a word's size depends on the host architecture. On an x86, a word is 4 bytes. No one wants to go back to the days of 2byte words, because those were the days of real mode.
Okay, let's just say a word is half a double word? Mmk.
Quote from: Warrior on August 05, 2005, 10:50 PM
Okay, let's just say a word is half a double word? Mmk.
Short