You are here: PSPad forum > English discussion forum > Using user defined variables in Macro Definition

Using user defined variables in Macro Definition

#1 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?

Options: Reply | Quote | Up ^


#2 Re: Using user defined variables in 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, ...)

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR