一、学习进度:
官方教程网址:https://academy.uipath.com
学习进度:(14课)
学习内容:
二、实例练习
1.控制流—If/Else语句
1)Flowchart方式实现:
2)Sequence-If/Else语句实现:
2.控制流—循环
1)基于FlowDecision的循环,直到找到闰年
2)Sequence的循环:
–While与Do While的区别:While是满足条件再执行;Do While是直接执行,直到满足条件。 以Do While实现:
–For each实现:
<1>Select Folder:
<2>Assign,将获取到的值存到数组中:
<3>for each进行遍历数组中的item及索引index。注意item及index要tostring。
<4>Run执行:选择kaoshi文件夹
查看输出结果:
3.控制流-高级
示例:随机出-1000之间的数子,用户猜测:猜对直接停止程序;猜错,则根据用户猜测的数据进行更高或更低的说明,重复整个过程。
1)随机获得0-1000的数字:
2)请输入自己猜测数字:
3)进行random=guess的验证,若不等于,则进一步进行random<guess的验证,然后进行循环:
执行结果:
4.第2课练习1简单流程决策-问数学问题
1)先问数学问题,设置button按钮为yes/no,设置输出变量为answer:
2)如果Yes,分配“正确的”;如果No,分配“错误的”:
3)再建一个sequence。并在其内部加上open application 和attach windows控件
–添加Sequence:
– open Application
找到“ open Application”活动并将其拖到Sequence中。现在我们必须指出要打开的应用程序。最简单的方法是在桌面上打开记事本,单击 “ open Application”活动中的“ 在屏幕上指示窗口Indicate window on screen”按钮,然后单击“记事本”窗口。
– attach window
4)找到一个Type Into活动并将其拖到Attach Window活动的Do容器中,键入活动的输入文本是resultText变量
5.在Sequence末尾添加“ close Application”活动以退出记事本
运行工作流程,应该看到“记事本”被打开,然后在 在关闭过程中弹出窗口出现时,单击“不保存 ”。
执行结果:
–选择Yes:
–选择No:
5.第2课练习2:在序列中创建四个GenericValue类型的变量,将其各种操作打印出来,看结果如何?
1)定义变量:
2)各种操作:
执行结果:
总结:
UiPath Studio有3个主要区域:活动面板、工作流设计器和属性面板。
有两种方法可以组织操作:简单的Sequence工作流,以及用于更复杂工作流和高级组织的Flowchart。
变量的主要类型有:整数、字符串、日期时间、布尔值、泛型、数组…
Generic变量可以保存任何类型的数据。
任何变量都有定义其生存期的作用域(scope)。