Asked by:
VB script macro Loop?

General discussion
-
I wish to create at macro loop in VBscript.
The loop must repeat until a designated number is reached and skip
every other number or (step 2) Example: 11 to 273 or 10 to 272
In the ten digit line of code, only the three digit part of the number must change each time; 61106(011-273)AA
There is more to the macro before and after but, all would be repeated each time the above is the only number I need to be variable.
Any help in creating a working for next/loop in VBscript would be appreciated.
I have already researched tried and failed to get this to work.
If necessary I will include the full code so you can pin point what I'm doing wrong.
Although i'm fairly sure it's a matter of proper placement or punctuation.?
- Moved by Reed KimbleMVP Saturday, May 26, 2018 1:29 PM vb script in vb.net language
- Changed type Bill_Stewart Friday, July 27, 2018 8:43 PM
- Moved by Bill_Stewart Friday, July 27, 2018 8:45 PM This is not "teach me basics of cmd.exe batch scripting" forum
Saturday, May 26, 2018 1:12 AM
All replies
-
Questions relating to V Script should be asked here: VBScript
Be sure to post the code that you have already tried so that someone can point out the problem with the punctuation.
Saturday, May 26, 2018 1:18 AM -
Also post code in a Code Block, when you post in the correct Forum, which makes the code legible and more easily understood.
La vida loca
Saturday, May 26, 2018 3:01 AM -
I'll move this to the forum indicated.
Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
Saturday, May 26, 2018 1:28 PM -
for each x in 200 step 2
nextYou should not be learning VBScrript as it is obsolete. If you want to learn how to script start learning PowerShell.
Please carefully review the following links to set your expectation for posting in technical forums.
This Forum is for Scripting Question Rather than script requests
Script requests
PowerShell Documentation- Posting guidelines
- Handy tips for posting to this forum
- How to ask questions in a technical forum
- Rubber duck problem solving
- How to write a bad forum post
- Help Vampires: A Spotter's Guide
- This forum is for scripting questions rather than script requests
\_(ツ)_/
Saturday, May 26, 2018 2:57 PM -
I will post code as soon as I can, unfortunately it is not as easy as copy and paste .Monday, May 28, 2018 2:54 PM
-
Thank YouMonday, May 28, 2018 2:55 PM
-
I am aware but, unfortunately that is what my employer is still working with.
So it is beneficial to me.
Monday, May 28, 2018 3:01 PM -
VBScript is also listed above and is here: https://technet.microsoft.com/en-us/scriptcenter/default.aspx?f=255&MSPPError=-2147217396
\_(ツ)_/
Monday, May 28, 2018 4:05 PM -
[PCOMM SCRIPT HEADER] LANGUAGE=VBSCRIPT DESCRIPTION= [PCOMM SCRIPT SOURCE] OPTION EXPLICIT autECLSession.SetConnectionByName(ThisSessionName) REM This line calls the macro subroutine subSub1_ sub subSub1_() autECLSession.autECLOIA. WaitForAppAvailable autECLSession.autECLPS.SendKeys "[pf6]" + autECLSession.autECLPS.SendKeys For XXX = 011 To 273 Step Two "61106XXXAA" autECLSession.autECLPS.SendKeys "[ENTER]" Next End Sub
Tuesday, May 29, 2018 7:09 PM -
Sorry but we don't support "PCOMM".
-- Bill Stewart [Bill_Stewart]
Tuesday, May 29, 2018 7:13 PM -
What is "PCOMM"? Why is it not supported? I really only need help with the one line of code that keeps giving me issues and how to properly write it to avoid error and achieve the result I'm looking for .
For XXX = 011 To 273 Step Two "61106XXXAA" Next
- Edited by CharlesBa Tuesday, May 29, 2018 8:48 PM
Tuesday, May 29, 2018 8:46 PM -
What is "PCOMM"? Why is it not supported? I really only need help with the one line of code that keeps giving me issues and how to properly write it to avoid error and achieve the result I'm looking for .
For XXX = 011 To 273 Step Two "61106XXXAA" Next
You are the one posting PCOMM scripts. Look at your post.
PCOMM is not a Microsoft product. It is an IBM product for writing PCOMM macros. It is not VBScript.
Also your question is ambiguous and does not match the script you posted. Post in an IBM forum for PCOMM.
\_(ツ)_/
Tuesday, May 29, 2018 8:53 PM -
I don't know what "PCOMM" is. It's at the top of your sample code.
Here's the documentation page about the For ... Next statement in VBScript.
If you don't understand the documentation, then unfortunately we won't be able to help. This is not a forum that teaches VBScript programming.
-- Bill Stewart [Bill_Stewart]
Tuesday, May 29, 2018 9:01 PM -
Thank YouTuesday, May 29, 2018 10:04 PM