Page 1 of 1

Possible store multi-line command as kind-of-variable to be used in different parts of the script?

Posted: 23 Jun 2019, 07:07
by cadudesun
Hi,

I'd appreciate help.

I have the following command I would like to used in different parts of the script:

Code: Select all

;COPY raw file NAME
            Send, ^c
            Sleep 50
            ClipBoard = %ClipBoard%     
            Splitpath, ClipBoard, fname, fdir, fext, fnamene, fdrv
            ClipBoard = %fnamene%            
Initially I thought about using variables (https://www.autohotkey.com/docs/Variables.htm), however AHK help states that a string or number can be stored in a variable.

What would be the method to store the multi-line command above as kind-of-variable to be used in different parts of the script?

Thank you very much!

Re: Possible store multi-line command as kind-of-variable to be used in different parts of the script?  Topic is solved

Posted: 23 Jun 2019, 08:36
by swagfag
no, what u need is a function.
study this https://www.autohotkey.com/docs/Functions.htm

Re: Possible store multi-line command as kind-of-variable to be used in different parts of the script?

Posted: 23 Jun 2019, 19:24
by cadudesun
Thank you for the direction!