Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Issue With Being Stuck In Loop

$
0
0
I have a bit of code in a script that I need to loop x number of times based on what number is entered into a specific input box.  The number that is put in that input box also determines how many times I need to replace a string of characters in a specific input box as well.

I'm trying to replace a sting in this fashion:

"input box NumberofProjects"= 7 Projects
"input box Project Name= Testing-01A-Q01-2013

so in this scenario I would need it to be when you click "nextprojectbutton" the first time it would rename the data in the project name box to "Testing-01B-Q01-2013" and C the next time and D the next time etc. The issue is at the moment i'm getting stuck in a loop and its not incrementing past 1. I think its because the first letter is A that its searching for and when it does increment the next letter to B that it doesn't know that the string to replace is B instead of A.  Please let me know if anyone has any questions.

[ autoit ]      
Case $RDCNextProjectButton Local $ProjectNameRead = GUICtrlRead ($ProjectNameInputBox) $RDCNumberOfProjectsRead = GUICtrlRead ($RDCNumberOfProjectsInput) For $I = $RDCNumberOfProjectsInput to 1 Step -1 $sFirst = "A" $iASCII = Asc($sFirst) $iASCII += 1 $sNext = Chr($iASCII) Local $sinput = $ProjectNameRead Local $soutput =StringRegExpReplace($sinput, "\-01A-" & "Q", "-01"& $sNext &"-Q") guictrlsetdata ($ProjectNameInputBox,$soutput) _GUICtrlComboBox_SetCurSel($RDCRouterNameCombo, 0) _GUICtrlComboBox_SetCurSel($RDCOtherRouterNameCombo, 0) guictrlsetdata ($ASideFPCInstallInput,"") guictrlsetdata ($ZSideFPCInstallInput,"") guictrlsetdata ($RDCASideOpticsInstall,"") guictrlsetdata ($RDCZSideOpticsInstall,"") Next

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>