Q&A

  • Re: RS232C 통신 소스인데 궁금한것이..2
<참고하세요>

1.

procedure Move(const Source; var Dest; Count: Integer);



Description



Move copies Count bytes from Source to Dest. No range checking is performed. Move compensates for overlaps between the source and destination blocks.



Whenever possible, use SizeOf to determine the count.



2.

function Pos(Substr: string; S: string): Integer;



Description



Pos searches for a substring, Substr, in a string, S. Substr and S are string-type expressions.



Pos searches for Substr within S and returns an integer value that is the index of the first character of Substr within S. Pos is case-sensitive. If Substr is not found, Pos returns zero.





간단 설명:

Move(DataPtr^, Buff, DataSize);

//DataPtr^의 내용을 Buff에 DataSize의 갯수만큼 복사 합니다.



if Pos(CR, StrReceive ) > 0 then

//CR의 내용이 StrReceive에 몇번째 위치에 있는지 값이 Return 됩니다.

//위문장에서는 StrReceive에 캐리지 리턴이 있으면? 하고 물어본 것입니다.



원하시는 내용인지...?

즐코하세요. 초보가...





델피언 wrote:

> begin

> Fillchar(Buff, Sizeof(Buff), 0);

> Move(DataPtr^, Buff, DataSize);

> StrReceive := StrReceive + Buff;

> if Pos(CR, StrReceive ) > 0 then

> Begin

> laReceive.Caption := StrReceive;

> StrReceive := '';

> End;

> end;

>

> move 라인과 pos 라인이 무슨 말인지 모르겠습니다..

0  COMMENTS