Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Last active September 30, 2022 16:21
Show Gist options
  • Save JoeGlines/42d0c36344edc59c1b4aefff7913dbf6 to your computer and use it in GitHub Desktop.
Save JoeGlines/42d0c36344edc59c1b4aefff7913dbf6 to your computer and use it in GitHub Desktop.
var=
(
Email First_Name Last_Name
[email protected] Joe King
[email protected] Joseph GLines
)
;*********Use For loop over Var going line by line*********************
for i, row in Loopobj:=StrSplit(var,"`n","`r`n") { ;Parse Var on each new line
IfEqual, i,1,continue ;Skip header row
IfLessOrEqual,i,4382,continue
IfEqual, row,,continue ;Skip loop if blank
IfEqual, row,Stop,break ;Break if stop (not case sensitive)
IfEqual, row,%var%,continue ;Note- need to use percents if variable
IfEqual, row,1,SetEnv,Data,Region SBE MonthCalYear ;set header row in loop
Menu , tray, tip, % round((i-1)/(Loopobj.Count()-1)*100) "% done. " i-1 " of " Loopobj.Count()-1 " : email is " StrSplit(row,"`t").1 ;Show progress on icon in system tray
MsgBox % StrSplit(row,"`t").1 a_tab StrSplit(row,"`t").2 a_tab StrSplit(row,"`t").3 ;demonstrate values
if(mod(i,10)=0) ;Use this if want to step every 10th item
msgbox % i a_tab "10th step"
}
@mathematics333
Copy link

Thanks, @JoeGlines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment