You are here: PSPad forum > English discussion forum > Using user defined variables in Macro Definition
Posted by: clanman | Date: 2020-06-25 12:11 | IP: IP Logged
I am writing a macro to create script/procedure header to look something like this:
# ############################
# Procedure: FooBar
# Author: John Smith
# Written Thursday, 25 June 2020
# description: Create foobar object
#
Function FooBar {
[CmdletBinding]
Param ()
[Switch]
$Name
}
The clip I have looks like:
[Function Builder | Build parameters for new functions]
# ############################
# Procedure: %name%
# Author: %autor%
# Written %date%
# description: %desc%
#
Function %name% {
[CmdletBinding]
Param ([%man1%])
%type1%
%Param1%%Def1%
}
The problem variable %author% is created with this line:
%autor%=@E Author name:,,%UserName%
What I actually get is:
# Author: %UserName%
Is there a way to use user defined variables (Settings->User Variables...) as the default value in a macro definition?
Posted by: pspad | Date: 2020-06-25 15:19 | IP: IP Logged
I will take a look at code if I will be available recognize clip name from arguments.
If yes, I can will evaluate variables (user defined, system variables, ...)
Editor PSPad - freeware editor, © 2001 - 2023 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR