2016년 1월 14일 목요일

class function

메인폼에서 다른폼을 부를때 메인폼에서 생성시킨후 보여주고 끝나면 프리시켜주는게 이제까지 사용하던 방법이었습니다.

불려야 할 폼이

type
TForm6 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
public
class function YesNo(istr:string): string;
end;
implementation
{$R *.dfm}
class function TForm6.YesNo(iStr:string): string;
var f: TForm6;
begin
Result:= '';
f:= TForm6.Create(Application);
try
f.Edit1.Text:= iStr;
if f.ShowModal = mrOk then
Result:= f.Edit1.Text;
finally
f.Free;
end;
end;

과 같이 만들어 두고

메인폼에서

uses Unit6;
procedure TForm5.Button1Click(Sender: TObject);
var iText: string;
begin
iText:= TForm6.YesNo('하하하');
ShowMessage(iText);
end;

이렇게 불러쓰면 한방에...

tensorflow gpu 사용하기에서

 tensorflow 설치시 주의해야 한다. # Anything above 2.10 is not supported on the GPU on Windows Native python - m pip install "tensorflow<2.11...