For Loop Syntax

Christie Widget Designer Version 6 - Q&A

Moderator: Moderator Group

Forum rules
When asking make sure to include the operating system and the revision of Widget Designer you are using.

For Loop Syntax

Postby chrisr » Tue Jan 03, 2017 5:28 pm

Hey all,
I wanted to post this, as it took me a bit to figure out the new syntax for the For Loop.

OLD WAY:
Code: Select all
For 1 to 10
WDControlShow,Labelfor.index               // Example 1
WDCustomScriptTint,for.index,255,0,0       // Example 2
Next



NEW WAY:
Code: Select all
For i = 1 to 10
   {
   WDControlShow("Label"+i)                // Example 1
   WDCustomScriptTint(i,255,0,0)         // Example2
   }


There is also a new step feature. It looks like this

Code: Select all
For i = 1 to 10 Step 2

This allows you to select every other item in the loop. this would run 1,3,5,7,9 inside of the 10 steps of the for loop.
Thank You

ChrisR
SurfacePro3 - 2GHz i5 - 4GB ram - Windows 10 Pro - WD Pro 4.7 Rev2500 and WD v6
Sager Laptop - Intel 2.4GHz i7 3630QM - 16GB ram - Windows 7 Pro Svc Pack1 - Offline Manager v6
chrisr
 
Posts: 143
Joined: Tue Jan 26, 2016 10:50 pm

Return to Widget Designer V6

Who is online

Users browsing this forum: No registered users and 13 guests

cron