safetycar wrote: ↑29 Oct 2021, 11:48
I'm not sure if I can follow where you're thoughts are coming from.
My thoughts on initialising a variable came from this post:
viewtopic.php?p=244113#p244113
When my initial attempts to make my code work failed I searched for help on variables which led me to that post so I added line 5. But it still didn’t do what I wanted which is why I posted here.
safetycar wrote:
I'll try with some general hints.
What you're accessing with IB.Value is not a normal variable. It's a property of IB, which is an object.
If anything it would make more sense to initialize IB (IB:={} I guess), but not so much here since anything you put is going to be overwritten later with IB := InputBox....
Sometimes you are required to initialize a variable when it's going to be passed as parameter, but not for the output.
I see. From what you have said it sounds like line 5 is not required then. Seems like I should have left that out to begin with.
The first part of the InputBox code seems fine (it would since it’s from the example in the documentation). It throws up an InputBox and I can put in a numerical value. The next part is where I’m falling down. Why is it not passing that numerical value onto the Loop to tell it to loop for the number I’ve entered?
(I found some old code that works under AHK v1 but I’m unable to run that as my work AV has blocked the software.)