|
var
Data1,Data2: PImageData;
위와같은 선언이
C++Builder에서는 다음과 같이 되겠네요
ImageData *Data1,*Data2;
델파이에서 변수형 맺 앞에 P가 붙은것은 거의 대부분 포인터라고 보시면 됩니다.
Integer 의 포인터형은 PInteger가 되죠
아래는 기타 델파이와 빌더의 표현차이점 몇가지 기술합니다.
델파이 빌더
================
:= => = //대입연산자
<> => != //비교연산자(같지않다)
if => if( //if구문
then => ) //if구문 닫기
begin => { //블럭 열기
end => } //블럭 닫기
end; => } //블럭 닫기
. => -> //클래스 멤버
----------------------------------
그럼..
Janus 님이 쓰신 글 :
: 데이터 Sorting을 하려 합니다. 메뉴얼의 내용은 델파이 소스로 되어져 있어서... C++ Builder에 어떻게 적용해야 될지를 모르겠습니다. 아래 샘플 부분을 C++ Builder 용으로 변환이 필요한데 도움을 부탁 드립니다.
:
: 제가 이해가 안가는 부분은
: [Data1 := Sender.GetNodeData(Node1);] ==> 이부분입니다.
:
: Data1, Data2의 선언부와 위의 한줄을 어떻게 표현해야 될지.. 도움 부탁 드립니다.
:
:
:
:
:
:
: procedure TMainForm.VDT1CompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column:
: Integer; var Result: Integer);
: // used to sort the image draw tree
: var
: Data1, Data2: PImageData;
: begin
: Data1 := Sender.GetNodeData(Node1);
: Data2 := Sender.GetNodeData(Node2);
: // folder are always before files
: if Data1.IsFolder <> Data2.IsFolder then
: begin
: // one of both is a folder the other a file
: if Data1.IsFolder then
: Result := -1
: else
: Result := 1;
: end
: else // both are of same type (folder or file)
: Result := CompareText(Data1.FullPath, Data2.FullPath);
: end;
|