有两个条件判断和ASCII码转换的问题,怎么编译通不过,哪位能解答?var ZoomClearDegree:Integer;
LicensePrefix:String; if ZoomClearDegree<-100 or ZoomClearDegree>200 then //此行出错,类型不匹配
begin
ShowMessage('合成清晰度必须在(-100,200)之间!');
Exit;
end; if asc(LicensePrefix)<65 or asc(LicensePrefix)>90 then //此行出错,类型不匹配,ASC函数是哪个?
begin
ShowMessage('号牌前缀必须在(A~Z)之间!');
Exit;
end;
LicensePrefix:String; if ZoomClearDegree<-100 or ZoomClearDegree>200 then //此行出错,类型不匹配
begin
ShowMessage('合成清晰度必须在(-100,200)之间!');
Exit;
end; if asc(LicensePrefix)<65 or asc(LicensePrefix)>90 then //此行出错,类型不匹配,ASC函数是哪个?
begin
ShowMessage('号牌前缀必须在(A~Z)之间!');
Exit;
end;
解决方案 »
- Delphi6 如何调用 C#的WebService
- access violation at address 00508B5E in module 'project.exe' Read of address 00000000
- delphi高手进来看看啊,有关图像缩放的问题!!!!
- 一个除法算式
- Delphi流的问题
- 怎么才能在form里插入word或html文档,希望大家都来不另赐教。3Q ~~~~~~
- 赶了两年半的程序员,感觉很不爽!有同感的兄弟们进来
- 小问题,老大们帮帮忙!
- 有兴趣的近来,帮帮我好了,有关SQL语句的写法,我没分了 ,所以分给的少
- 请问access数据库的boolean 转换成server2000数据库时 数据类型是什么??
- Timer使用时的怪问题,在线等待
- MyImage1: TImage与MyImage1: TMyImage有什么区别?
if (ZoomClearDegree<-100) or (ZoomClearDegree>200) then //此行出错,类型不匹配
begin
ShowMessage('合成清晰度必须在(-100,200)之间!');
Exit;
end;
ordord('A');
if (ord(LicensePrefix)<65) or (ord(LicensePrefix)>90) then
begin
ShowMessage('号牌前缀必须在(A~Z)之间!');
Exit;
end;编程思路是从编辑框里取字符,有可能是一位到几位,如果不在A~Z的范围内,提示出错。
for i:=1 to length(LicensePrefix) do begin
if (not LicensePrefix[i] in ['A'..'Z']) or
(not LicensePrefix[i] in ['a'..'z']) then //如果的第i个字不是A-Z或者a-z中的任一个
begin
ShowMessage('号牌前缀必须在(A~Z)之间!');
Exit;
end;
LicensePrefix:=EditPreLicense.Text;
if (ord(StrToInt(LicensePrefix))<65) or (ord(StrToInt(LicensePrefix))>90) then
begin
ShowMessage('号牌前缀必须在(A~Z)之间!');
Exit;
end;
将EditPreLicense的长度设为1 LicensePrefix:=EditPreLicense.Text;
if Not IsCharUpper(LicensePrefix[1]) and Not IsCharLower(LicensePrefix[1]) then
begin
ShowMessage('号牌前缀必须在(A~Z)或(a~z)之间!');
Exit;
end;