我想在备忘录,列表框或其他任何内容中显示某些整数.我已经尝试过备忘录,列表框和showmessage(),但每个都会抛出字符串和整数之间的不兼容错误.
这是它开始出错的地方:
Memo1.Lines.Add('Physical Functioning: '+PhysFunc div PhysCount);
Run Code Online (Sandbox Code Playgroud)
PhysFunc和PhysCount是进一步计算的整数.我试过了,例如:
Memo1.Lines.Add('Physical Functioning: '+IntToStr(PhysFunc div PhysCount));
Run Code Online (Sandbox Code Playgroud)
和:
Memo1.Lines.Add(IntToStr('Physical Functioning: '+PhysFunc div PhysCount));
Run Code Online (Sandbox Code Playgroud)
和:
Memo1.Lines.Add(('Physical Functioning: '+PhysFunc div PhysCount).AsString);
Run Code Online (Sandbox Code Playgroud)
与ListBox和showmessage()相同的东西.但没有工作.IntToStr返回E2003未声明的标识符,而.AsString返回错误,整数不包含成员'AsString'.还有其他选择吗?
我在Delphi中使用SDI应用程序 - 这可能是问题吗?
谢谢
我在Delphi 6表单上有一个DateTimePicker,默认日期为30/12/1899.我希望用户能够点击它或打开下拉日历并选择当前日期.使用OnClick过程:
DateTimePicker.Date:=日期
将可编辑部分中的日期设置为用户单击日期或日历下拉按钮时的日期,但不会强制日历自动选择今天的日期.如果我在DateTimePicker的OnDropDown过程中使用此代码,结果是相同的.
我是否需要使用此帖中的内容来操作日历?还是有一个我错过的简单财产?
谢谢马特
我有以下代码,它基于许多变量构造一个SQL语句:
SQL.Add('SELECT CDbl(Answer) as An FROM v_Outcomes_FirstLastOneYear ' +
'WHERE ' + GetTool(ReportGrid.Cells[col, 0]) + ' ' +
'AND (Collector = ' + QuotedStr('Patient') + ') ' +
'AND (Question=' + GetQuestion(ReportGrid.Cells[col, 0]) + ') ' +
'AND (Answer is not null) ' +
'AND (Answer <> ''null '') ');
if Copy(ReportGrid.Cells[col, 0], Length(ReportGrid.Cells[col, 0]), 1) = '1' then
SQL.Add('AND ('+GetTPoint(first)+') ')
else
SQL.Add('AND ('+GetTPoint(second)+') ');
SQL.Add('ORDER BY CDbl(Answer)');
Run Code Online (Sandbox Code Playgroud)
ReportGrid
(a TStringGrid
)的第一行已经填充了一系列字符串,如'Peds phys 1'
,或'Peds phys 2' …