首页 > 解决方案 > 如何将字符串值与 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

我可以说这是一个有效的错误,但我想知道如何使用结构规则语言比较一个值。

标签: enumssrlblaze-advisor

解决方案


使用铸造

if(foo = (it as a string)) then { }

即使在此之后,您仍将面临另一个问题,即不支持的关键字。( break)

没有这样的东西break,删除它。


推荐阅读