I have a program written in Delphi 4 and trying to convert it to delphi xe10. One part i do not understand is this.
Cmd[0] := 2; // Number of equipment to talk to
Cmd[1] := 22; // My device address
Cmd[2] := 0;
MResults.Lines.Add('Reciving...');
Refresh();
Srlen := High(RecBuff);
Ret := GpListen(@Cmd, @Srlen, @RecBuff); // gets returned value
if CheckRet('GpListen', (Ret and $FF), csBuf) = 0 then
begin
RecBuff[Srlen] := Chr(0); // ??
MResults.Lines.Add(RecBuff); // returned
//csBuf := Format('????', [Srlen]); ////?some error??
end;
The issue is RecBuff (RecBuff:array[0..9999] of Char;) It starts off full of #0 like so:
but as soon as
Ret := gpListen(@cmd, @srlen, @recbuff);
is ran recbuff now looks like this:
alot of japan char. how do i get this to encode onto the memopad correctly.