当前位置: 首页 > news >正文

Delphi用if else实现 select case、switch语句功能,实现case 以字符串为分类条件。

function  RetTextFromStr(inputstr:string):string;stdcall;
var
i:integer;
beginRetTextFromStr:='';if inputstr='9000' thenRetTextFromStr := '成功!'else if inputstr='9100' thenbeginpcdbeep(20);RetTextFromStr := '成功!';endelse if inputstr='6281' thenRetTextFromStr := '回送的数据可能错误!'else if inputstr='6283' thenRetTextFromStr := '选择文件无效,文件或密钥校验错误!'else if inputstr='6400' thenRetTextFromStr := '状态标志未改变!'else if inputstr='6581' thenRetTextFromStr := '写 EEPROM 不成功!'else if inputstr='6700' thenRetTextFromStr := '长度错误!'else if inputstr='6900' thenRetTextFromStr := 'CLA 与线路保护要求不匹配!'else if inputstr='6901' thenRetTextFromStr := '无效的状态!'else if inputstr='6981' thenRetTextFromStr := '命令与文件结构不相容!'else if inputstr='6982' thenRetTextFromStr := '不满足安全状态!'else if inputstr='6983' thenRetTextFromStr := '密钥被锁死!'else if inputstr='6984' thenRetTextFromStr := 'MAC格式不符合!'else if inputstr='6985' thenRetTextFromStr := '使用条件不满足!'else if inputstr='6986' thenRetTextFromStr := '请先选择文件!'else if inputstr='6987' thenRetTextFromStr := '无安全报文!'else if inputstr='6988' thenRetTextFromStr := '安全报文数据项不正确!'else if inputstr='6A80' thenRetTextFromStr := '数据域参数错误!'else if inputstr='6A81' thenRetTextFromStr := '功能不支持或卡中无MF 或卡片已锁定!'else if inputstr='6A82' thenRetTextFromStr := '文件未找到!'else if inputstr='6A83' thenRetTextFromStr := '记录未找到!'else if inputstr='6A84' thenRetTextFromStr := '文件无足够空间!'else if inputstr='6A86' thenRetTextFromStr := '参数P1 P2 错!'else if inputstr='6A88' thenRetTextFromStr := '密钥未找到!'else if inputstr='6B00' thenRetTextFromStr := '在达到Le/Lc 字节之前文件结束,偏移量错误!'else if inputstr='6E00' thenRetTextFromStr := '无效的CLA!'else if inputstr='6F00' thenRetTextFromStr := '数据无效!'else if inputstr='9302' thenRetTextFromStr := 'MAC 错误!'else if inputstr='9303' thenRetTextFromStr := '应用已被锁定!'else if inputstr='9401' thenRetTextFromStr := '金额不足!'else if inputstr='9403' thenRetTextFromStr := '密钥未找到!'else if inputstr='9406' thenRetTextFromStr := '所需的MAC 不可用!'else if inputstr='91AE' thenRetTextFromStr := '认证失败,请检查命行的参数和前期计算是否错误!'else if inputstr='91CA' thenRetTextFromStr := '上一个命令未完全完成!'else if inputstr='917E' thenRetTextFromStr := '指令长度错误!'else if inputstr='9140' thenRetTextFromStr := '当前目录或应用密钥不存在,请先选择正确的目录或应用!'else if inputstr='919D' thenRetTextFromStr := '处于未验证密码的状态,该指令无法操作!'else if inputstr='911E' thenRetTextFromStr := 'MAC错误!'else if inputstr='91F0' thenRetTextFromStr := '该文件号不存在!'else if inputstr='919E' thenRetTextFromStr := '参数无效!'else if inputstr='91BE' thenRetTextFromStr := '试图读取/写入的数据超出文件/记录的边界!'else if inputstr='91A0' thenRetTextFromStr := '请求的 AID 不存在!'elsebeginif midstr(inputstr,1,3)='63C' thenbegini:=strtoint('$'+midstr(inputstr,3,1));if i>0 thenRetTextFromStr :=  '再试 '+inttostr(i)+' 次错误密码将锁定!'elseRetTextFromStr := '密码已被锁定!' ;endelseRetTextFromStr:='未知的异常';end;
end;

NFC URI网址写入:https://item.taobao.com/item.htm?spm=a21dvs.23580594.0.0.52de2c1bJicRWj&ft=t&id=615391857885

http://www.lqws.cn/news/123733.html

相关文章:

  • AI IDE 正式上线!通义灵码开箱即用
  • (T/SAIAS 020-2024)《医疗大模型语料一体机应用指南》深度解读与实施分析
  • echarts使用graph、lines实现拓扑,可以拖动增加effect效果
  • Duix.HeyGem:以“离线+开源”重构数字人创作生态
  • 【运维实战】使用Nvm配置多Node.js环境!
  • Git安装与常用命令全攻略
  • C#编程过程中变量用中文有啥影响?
  • Zookeeper 集群部署与故障转移
  • C#和C++在编译过程中的文件区分
  • 【Web应用】若依框架:基础篇14 源码阅读-后端代码分析-课程管理模块前后端代码分析
  • ubuntu自定义服务自动启动
  • 全志A40i android7.1 调试信息打印串口由uart0改为uart3
  • 在Windows11上安装 Ubuntu WSL
  • Fréchet Inception Distance(FID)
  • es地理信息索引的类型以及geo_point‌和geo_hash的关系
  • 四元数:从理论基础到实际应用的深度探索
  • THUNDER:用“听回去”的方式让数字人说话更像真人
  • 一个小小的 flask app, 几个小工具,拼凑一下
  • BERT:让AI真正“读懂”语言的革命
  • 【Unity】R3 CSharp 响应式编程 - 使用篇(集合)(三)
  • Vue + Element Plus 实战:大文件切片上传 + 断点续传
  • 华为设备OSPF配置与实战指南
  • 【vue3学习】vue3入门
  • MySQL 事务深度解析:面试核心知识点与实战
  • 运维实施40-MGR高可用
  • Android 颜色百分比对照
  • 国产化Word处理控件Spire.Doc教程:Java实现HTML 转Word自动化
  • 四、函数调用包含单个参数之Double类型-mmword,movsd,mulsd,addsd指令,总结汇编的数据类型
  • 测试面试题总结一
  • Hive终极性能优化指南:从原理到实战