enums - 如何将字符串值与 SRL 中的枚举值进行比较
问题描述
因为我是 blaze advisor 和 SRL 的新手。我正在尝试通过迭代将值与枚举中的元素进行比较。下面是代码。
for each CompanyList do
{
if(anApplicant.employementDetail.organisation=it) then{ print("companies" it). 休息。
}
但我收到错误消息
Error: 'type' and 'string' are incompatible types. main.advprom /assignProject [New Repository]/assignProject Folder/Testing line 718 Blaze Advisor Compilation Problem
我可以说这是一个有效的错误,但我想知道如何使用结构规则语言比较一个值。
解决方案
使用铸造
if(foo = (it as a string)) then { }
即使在此之后,您仍将面临另一个问题,即不支持的关键字。( break
)
没有这样的东西break
,删除它。
推荐阅读
- php - 使用 PHP 将数据从 CSV 导入 MYSQL
- javascript - 从另一个按许多对象属性分组的对象返回数组
- qt - 为 Maya 插件创建没有调试 dll 的 VS 解决方案?
- python - 向用户询问他们的姓名和号码,显示他们的姓名该次数
- python - 从 xml 文件中提取列表或字典
- php - openid 连接以识别 php 中的服务器
- javascript - 如何在nodejs中将对象数组转换为字符串?
- jquery - 如何将日期时间选择器条目存储在可观察数组中?
- swift - 使用 Alamofire 快速上传带有参数的图像
- python-3.x - Python:根据for循环迭代更改变量