nkormanik Posted December 24, 2023 Report Share Posted December 24, 2023 Suppose I want to count down in a text file, starting with X, as follows, for example: 100 99 98 Please see the following: <VARIABLE SET INTEGER Option="\x00" Destination="%Initial%" Value="100"/> I think I use the above. It designates where to start. 100. How, then, do I get the 99, and 98? Can I set up some math? Say, %Initial% minus (-) 1, to get the 99? And %Initial% minus (-) 2, to get the 98? Any help appreciated. Nicholas Kormanik Quote Link to comment Share on other sites More sharing options...
acantor Posted December 24, 2023 Report Share Posted December 24, 2023 This is not a "bullet-proof" solution, but the code might give you ideas of how to solve it. Variable Set Integer %Value%: Prompt Variable Set Integer %Interval%: Prompt Repeat Until %Value% Is Less Than "1" Text Type (Simulate Keystrokes): %Value% Variable Modify Integer: %Value% = %Value% - %Interval% End Repeat <VARIABLE SET INTEGER Option="\x01" Destination="%Value%" Prompt="What is the highest value?" Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0" Lines="\x00"/> <VARIABLE SET INTEGER Option="\x01" Destination="%Interval%" Prompt="Count down by what value?" Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0" Lines="\x00"/> <COMMENT/> <REPEAT UNTIL Variable="%Value%" Condition="\x02" Value="1"/> <TEXT TYPE Action="0" Text="%Value%\r\n"/> <VARIABLE MODIFY INTEGER Option="\x01" Destination="%Value%" Value1="%Value%" Value2="%Interval%"/> <END REPEAT/> Quote Link to comment Share on other sites More sharing options...
nkormanik Posted December 24, 2023 Author Report Share Posted December 24, 2023 Indeed it does, acantor. I love your 'Prompt' suggestion. That would mean I wouldn't have to manually edit the macro files, which has been a pain. The rest I'll have to study more. Maybe the first step would be to just try it out, eh? Like in a plain text page, editor. Thanks for stepping forward. Quote Link to comment Share on other sites More sharing options...
acantor Posted December 24, 2023 Report Share Posted December 24, 2023 Quote Like in a plain text page, editor. For testing purposes, it's preferable to use NotePad or another "vanilla" text editor. If you use Word, its auto-formatting of numbered lists feature might cause mischief. Quote Link to comment Share on other sites More sharing options...
Cory Posted December 24, 2023 Report Share Posted December 24, 2023 Repeat Start command. Start on 100 or use a variable. Then set the increment to -1. Store the counter into a variable. Quote Link to comment Share on other sites More sharing options...
nkormanik Posted December 24, 2023 Author Report Share Posted December 24, 2023 Can you show an example that any of us can try out? Quote Link to comment Share on other sites More sharing options...
Cory Posted December 24, 2023 Report Share Posted December 24, 2023 My description is that bad? LOL. OK. Quote Link to comment Share on other sites More sharing options...
nkormanik Posted December 26, 2023 Author Report Share Posted December 26, 2023 Yes, Cory, clear now.... Quote Link to comment Share on other sites More sharing options...
Cory Posted December 26, 2023 Report Share Posted December 26, 2023 Great. I hope it helps. Have a good one. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.