430 likes | 438 Views
Beginner course teaching how to create loop patterns using notifications. Build diagrams and display loop indexes in VPL. Learn to use Min/Max numbers with loops. Includes adding data and variables, connecting activities, and executing results. Get hands-on practice with calculating and displaying Min/Max values.
E N D
VPL Patterns – Loop Pattern using Notification VPL Beginner Course – 05 Young Joon Kim http://www.helloapps.com
Topics • Simple loop pattern using notification • Get Min/Max numberusing Loop Pattern
Scenario for target sample • Build simple loop diagram • Display loop index Call “Activity” Notification of “Activity” Display Loop Index Loop Call “Activity”
Simple loop pattern using notification • Add “Data” and “Variable” • Click “Variables” icon Click
Simple loop pattern using notification • Add “loopIndex” variable (int)
Simple loop pattern using notification • Initialize “loopIndex” with value “0”
Simple loop pattern using notification • Add “Activity”
Simple loop pattern using notification • Change the name of “Activity” Click
Simple loop pattern using notification Double-click
Simple loop pattern using notification • Connect input point and notification point
Simple loop pattern using notification • Connected result
Simple loop pattern using notification • Connect “Variable” and “Jump” • Copy & paste “Jump”
Simple loop pattern using notification • Add “If” and “Calculate” activities • Copy & paste “Variable” activity • Connect the notification point of “Jump” and “If”
Simple loop pattern using notification • Connect each activities
Simple loop pattern using notification • Add “HelloApps (Util) ListBoxDialog” service • Copy & paste “Jump”
Simple loop pattern using notification • Connect “Variable” and “ListBoxDialog” service
Simple loop pattern using notification • Completed diagram
Simple loop pattern using notification • Executed result
Scenario for target sample • Calculate Min/Max number from the array Input numbers Call “Activity” Notification of “Activity” Compare Min/Max Loop Call “Activity” If last item Display Min/Max
Initialize variables • Add “Data” and “Variable” • Click “Variables” icon Click
Initialize variables • Add variables as follows • maxValue (double), minValue (double) • arrayList (list of double) • loopIndex (int)
Initialize variables • Add another two “Data” activities • Copy & paste “Variable” • Connect them as follows
Input numbers • Add “HelloApps (Util) ArrayInput” service • Add “Calculate” and “Variable” activities • Connect the notification point of “ArrayInput” and “Calculate”
Input numbers • Select “NotifyArrayList” • Connect activities as follows
Build Loop Pattern • Add “Activity”
Build Loop Pattern • Change name as “Jump” • Double-click “Jump” activity
Build Loop Pattern • Connect the input point and the notification point
Build Loop Pattern • Copy & paste two “Jump” activities
Get Min/Max numbers • Add “If”, “Calculate”, and “Variable” activities as follows
Get Min/Max numbers • Set “If” activities as follows
Get Min/Max numbers • Set “Calculate” as follows • Connect “Calculate” and “Variable” activities
Get Min/Max numbers • Add “Calculate” and “Variable” activity
Get Min/Max numbers • Connect “Calculate” and “Variable”
Get Min/Max numbers • Add “Display” diagram as follows
Get Min/Max numbers • Completed diagram
Get Min/Max numbers • Run diagram • Add numbers by clicking “Add” button
Get Min/Max numbers • Click “Submit as List” as follows