SwitchActivity无法使用字符串 [英] SwitchActivity not working with strings
本文介绍了SwitchActivity无法使用字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
伙计们.
我是Workflow的新手,而我的默认"语言是c#:).可以进行切换操作来使用字符串吗?
我有一个字符串变量,它被分配了"2".我已添加了一个切换用例"2",但似乎总是在使用默认用例.我的切换表达式是: stringNum -其中"stringNum"为是我的字符串变量的名称.但是,我尝试使用整数开关,但一切正常.我是否缺少某些东西?
问候,
Night_dog
Hi, guys.
I'm new to Workflows and my "default" language is c# :). Is it possible to have a switch activity to work with strings?
I have a string variable, which is assigned with "2". I've added a switch case "2", but it seems it is always going to the default case. My switch expression is: stringNum - where "stringNum" is the name of my string variable. However, I've tried with integer switch and everything works fine. Am I missing something?
Regards,
Night_dog
推荐答案
如果我没记错的话,开关的大小写被定义为文字,而不是VB表达式,因此可能需要输入不带引号的 2 案例.
Tim
If I remember right, the switch cases are defined as literals, not as VB expressions, so it might be that you need to enter the case as 2 without any quotes.
Tim
这篇关于SwitchActivity无法使用字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文