Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How to make a variable number with two positions

$
0
0
I have a variable called $sequence that I would like to find out how to output it with two positions in the file name on the filecopy line.

[ autoit ]      
Dim $sequence = 00 ; $Folder="C:\Program Files\PMAIL\MAIL\Docfxit\" ; Live $Folder = "C:\Scratch\Scratch11\" ; Test $File = InputBox("Find and replace", "Name and/or path of the file", "Hierarch.pm", "", 500, 100) MsgBox(48, "Path\File", $Folder & $File) $FileContent = FileRead($Folder & $File, FileGetSize($File)) $Find = InputBox("Find and replace", "What to find?", "FindThisText", "", 500, 100) $Replace = InputBox("Find and replace", "What to write instead?", "ReplaceWithThisText", "", 500, 100) $Confirm = MsgBox(65, "Find and replace", "You are about to change every instance of " & $Find & " by " & $Replace & " in the file " & $File & @LF & "Are you sure? ") If $Confirm = 1 Then     $sequence = $sequence + 1     FileCopy($Folder & $File, $Folder & $File & $sequence)     $FileContent = StringReplace($FileContent, $Find, $Replace)     FileDelete($File)     FileWrite($File, $FileContent) EndIf

Thanks,

Docfxit

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>