var
InputString: string;
begin
InputString:= InputBox('Input Box', 'Prompt', '');
if inputstring <> '' then
begin
//do your things
end;
end;
InputString: string;
begin
InputString:= InputBox('Input Box', 'Prompt', '');
if inputstring <> '' then
begin
//do your things
end;
end;
-----
delphi的文档说你这种情况用InputQuery。
var T:TINIfile;
begin
T.Create('c:\test.ini');
if InputBox('Input Box', 'Prompt', '1') <>'1' then
T.WriteString('Section','Key','string maybe get from inputbox');
end;
inputbox是一个调试函数,在帮助中也就:
function InputBox(const ACaption, APrompt, ADefault: string): string;
begin
Result := ADefault;
InputQuery(ACaption, APrompt, Result);
end;
根本没有判断返回的是yes还是no!
要不你自己做个dialog模块!/*************************************/
/*1、MY TOOL:*************************/
/*2、Delphi,Oracle,Sybase,C++/C*******/
/*3、PROJECT:*************************/
/*3、Boss*****************************/
/*4、为了五星的目标希望你早点结贴*****/
/*************************************/
mabey he must be uses default value
我在d6下刚调试,可以的呀,没有问题。如果d5不行的话,这样吧,你把最后一个参数设为' '
一个空格,如果用户按cancel,会反回这个空格
你在判断它是不是空格就行了。
begin
............................
end;
if inputadd<>'' then
begin
因为界面很普通,按钮上还是英文的。不爽
不如自己做一个
if InputQuery('Caption','ss',S) then
begin
//............................
end;
这样就可以了啊
还是根据你要得到的字符串做一些限制吧。