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

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.xdnf.cn/news/11934.html

相关文章:

  • Java对象创建过程
  • 操作系统入门:核心概念与设计逻辑
  • 数字孪生在智能制造中的实践:某汽车总装车间的全流程仿真优化
  • https和http有什么区别-http各个版本有什么区别
  • DINO-R1
  • 商务合同范本智能审核系统 AI 大模型处理方案
  • 探索分布式存储与通信:去中心化共享及通訊(DSAC)
  • 区块链跨链通信:使用 Cosmos SDK 实现链间互操作
  • 手动清理C盘文件的一些方法
  • 共聚焦显微镜—赋能光学元件精密质控
  • C语言获取数组长度方法大全(附带实例)
  • gateway 网关 路由新增 (已亲测)
  • Python训练营打卡 Day44
  • linux shell脚本硬件定时检测通过邮箱警告管理人员
  • LLM之RAG实战(五十四)| 复杂文档处理RAG框架:Ragflow
  • 振动力学:弹性杆的纵向振动(固有振动和固有频率的概念)
  • [蓝桥杯]填字母游戏
  • 短视频矩阵系统源码新发布技术方案有那几种?
  • 2025.6.4总结
  • 霍夫曼编码详解
  • qiankun模式下 主应用严格模式,子应用el-popover 点击无效不显示
  • STM32L0看门狗设置LL库
  • ABP-Book Store Application中文讲解 - Part 9: Authors: User Interface
  • 代码随想录刷题day29
  • 【免费】酒店布草洗涤厂自动统计管理系统(1)——智能编程——仙盟创梦IDE
  • Redis中的过期策略与内存淘汰策略
  • 剩余类和完全剩余系
  • 【Linux】Linux程序地址基础
  • ‘utf-8‘ codec can‘t decode byte 0xc9 in position 18:
  • css-塞贝尔曲线