![]() |
![]() |
We are currently migrating this forum over to our HelpSystems domain. Please post all new threads in our new HelpSystems Community Portal. |
![]() |
|
![]() |
AutoMate Discussion | ![]() |
help :
faq :
home
|
||
Latest News:
|
latest topics : statistics |
Topic Title: Loop through muliple variables and set values Topic Summary: Created On: 11/01/2016 03:35 PM Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: I found the following code works for my case. Thanks for your help Gijsberth! | ||||
![]() |
||||
I can't seem to figure out a simple way to loop through a set of variables and change the values as follows:
%Pointer1a%=(will have a value of 1, 2, or 3) %Pointer1b%=(will have a value of 1, 2, or 3) %Pointer2a%=(will have a value of 1, 2, or 3) etc... (Probably about 100 of these) What I would like to do is set any variables as follows: if the variable = 1, set same variable to A if the variable = 2, set same variable to B if the variable = 3, set same variable to C So, if %Pointer1a% = 1, then would like to change %Pointer1a% = A Seems simple, but I can't seem to find a way to loop through a list of variables and reset the values without writing if statements for each one of the variable. Any help will be greatly appreciated. Thanks, James
|
||||
|
||||
![]() |
||||
I'm not sure I understand your problem, but are you saying that you want to change the value of a variable from a number to a letter? like 1 = A?
------------------------- ![]() |
||||
|
||||
![]() |
||||
Exactly.
|
||||
|
||||
![]() |
||||
Hello James,
Unfortunately "if statements" will most likely be needed for this type of execution. This is in order to determine which letter to change the variable value to based on the number it is reading. You will need to write out the multiple if statements, then loop through the variables to change them. We apologize for the inconvenience.
------------------------- ![]() Alex Escalante | Support Analyst AutoMate | Division of HelpSystems HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665 |
||||
|
||||
![]() |
||||
Can you tell a bit more about the variable names? If you can use an array instead of a list of variables, it could become very simple....
------------------------- ![]() |
||||
|
||||
![]() |
||||
If I can loop through the variables, you can use %chr$(asc(variable)+16)% to change the value.
------------------------- ![]() |
||||
|
||||
![]() |
||||
Thank you Gijsberth, will try your formula tonight:-)
|
||||
|
||||
![]() |
||||
I found the following code works for my case. Thanks for your help Gijsberth!
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) |
||||
|
AutoMate Discussion
» AUTOMATE » AutoMate 9
»
Loop through muliple variables and set values
|
![]() |
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.