변수 선언하기 /// 너무 기본적인 것이라 ㅠㅠ
기본 UNIT 생성하면 나오는 소스입니다.
unit Unit1;
interface
implementation
end.
여기에다
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, ComCtrls,
StdCtrls, Buttons, ADODB, Db,
BubbleCh, Mask, imm, Grids, Chart, Series, ArrowCha;
const
ch_SelfPLC_ID = $FF;
ch_MnetPLC_ID = $0;
ch_Terminater = $0;
SMC = 4;
CODE = 7;
implementation
end.
이런식으로 추가하시면 상수 변수도 등록하실수 있고
여기에다
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, ComCtrls,
StdCtrls, Buttons, ADODB, Db,
BubbleCh, Mask, imm, Grids, Chart, Series, ArrowCha;
const
ch_SelfPLC_ID = $FF;
ch_MnetPLC_ID = $0;
ch_Terminater = $0;
SMC = 4;
CODE = 7;
type
Float = Single;
PTFloat = ^Single;
PTSingle = ^Single;
TPByte = ^Byte;
T1ChnBuffType = Array[0..FFTSize - INX_MIN_NUM] of Single;
PT1ChnBuffType = ^T1ChnBuffType;
TFrame = Record
SMC : String[SMC];
CODE : String[CODE];
RH ,
LH : array[1..6] of string[7];//= 6;
end;
implementation
end.
이런식으로 변수도 설정하고 RECORD도 선언하고
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, ComCtrls,
StdCtrls, Buttons, ADODB, Db,
BubbleCh, Mask, imm, Grids, Chart, Series, ArrowCha;
const
ch_SelfPLC_ID = $FF;
ch_MnetPLC_ID = $0;
ch_Terminater = $0;
SMC = 4;
CODE = 7;
type
Float = Single;
PTFloat = ^Single;
PTSingle = ^Single;
TPByte = ^Byte;
T1ChnBuffType = Array[0..FFTSize - INX_MIN_NUM] of Single;
PT1ChnBuffType = ^T1ChnBuffType;
TFFrame = Record
SMC : String[SMC];
CODE : String[CODE];
RH ,
LH : array[1..6] of string[7];//= 6;
end;
var
FFrame : TFFrame; //레코더 상속
bTimerLogPass_DAQ : Boolean;
bFunPass, bFormActivPass : Boolean;
implementation
end.
이런식으로 변수도 선언하고 레코드 상속받고
메인폼에 가서
unit UFM_Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, UNIT1;
USES 절에 추가해서 사용하시면 변수 추가나 수정시 UNIT1 파일안에서만 수정,추가하시면
프로그램 안에서 사용 가능합니다.
'Delphi' 카테고리의 다른 글
일반 스크링 그리드에 Database 파일 내용으로 콤보박스 보이기 (0) | 2014.07.29 |
---|---|
OPC 통신 데이터 읽기 Delphi 버전 (0) | 2014.05.09 |
통신데이터 STX,ETX 체크 (0) | 2013.12.11 |
외부 프로그램 찾아서 현재 프로그램의 판넬 안으로 넣어버리기 (0) | 2013.12.11 |
현재 프로그램에서 외부 프로그램 찾아서 이벤트 실행하기 (0) | 2013.12.11 |