Hello Everyone,
I am new in UiPath. I taken one input dialog & taken number 10 and I want to do print in write line as a output 12345678910 using while do loop. Please help
=> Use Input Dialog Box acitvity
Dialog Title: "Enter a number"
Input Label: "Please enter the number"
Input Type: Text Box
Value Entered: create a veriable usserInput
=> Use below syntax in Assign activity:
Assign -> counter = 1
Assign -> resultString = ""
=> Use While loop and give below condition:
While
counter <= CInt(userInput)
Assign -> resultString = resultString+counter.ToString
Assign -> counter = counter + 1
End While
=> Outside While loop use Write Line to print resultString
.
Ouptut:
Flow:
Variable DataTypes:
Xaml:
Sequence33.xaml (9.1 KB)
Regards
Welcome to the community
Just drag a while activity…
In max iteration property provide 10
In the index property provide a variable int_counter
Inside loop use assign with str_finalValue = str_finalValue +(int_counter+1).ToString
Thsi way no counter is needed and no invrementing is needed
Cheers
Welcome to the UiPath Community
You should be getting trained on this buddy. It’ very much basic.
Good luck
Thanks,
Ashok
Dear @vrdabberu thank you very much for giving solution with clear step with xaml file. But I am confused about 2 issue:
- Why usserInput variable type is string where I input only number
- In Condition (counter <= CInt(userInput)) What is meaning of CInt?
- Input Dialog output datatype is System.String
- Since we have taken a cojnter we are converting the userInput variable from string to integer datatype to match the condition.
Regards
@vrdabberu Thanks got it
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.