You are here: PSPad forum > English discussion forum > Clips and user variables?

Clips and user variables?

#1 Clips and user variables?

Posted by: rgr | Date: 2006-10-28 14:17 | IP: IP Logged

Hi,
I tried creating user-defined clip templates, for example
[now | current date]
time is: %RFCTime%|

But it doesn't work, when I use that clip I see only:
time is:
What am I doing wrong?

Options: Reply | Quote | Up ^


#2 Re: Clips and user variables?

Posted by: pspad | Date: 2006-10-28 18:25 | IP: IP Logged

I tried it now in the latest 4.5.2 version and it works.

Options: Reply | Quote | Up ^


#3 Re: Clips and user variables?

Posted by: DonQuichote | Date: 2012-10-19 11:45 | IP: IP Logged

I have the same problem in PSPad 4.5.7 (2432). Has the format changed for variables?

Options: Reply | Quote | Up ^


#4 Re: Clips and user variables?

Posted by: pspad | Date: 2012-10-19 13:06 | IP: IP Logged

I didn't change anything.
I tested your clip and it works for me.
Check the Clip file (edit it) and look for section:

Quote:
[Clip Settings]
CursorChar=|
SelectionChar=§

In case you changed any settings to % character, it will stop work.

Options: Reply | Quote | Up ^


#5 Re: Clips and user variables?

Posted by: DonQuichote | Date: 2012-10-19 15:47 | IP: IP Logged

It now works as well. My clip was:

[ToDo | ToDo comment]*CTRL+ALT+SHIFT+T
// ToDo: §| (%UserName%, %RFCTime%)

When I added some spaces between the brackets and the % signs, it started working and when I removed them, it still worked. Strange.

Options: Reply | Quote | Up ^


#6 Documentation about clips and user variables?

Posted by: DonQuichote | Date: 2015-02-11 12:37 | IP: IP Logged

I searched the help help files, but I could not find anything about user variables and clips. However, you can use user variables in clips. For example, if you want to include the file name in a piece of code, you can use something like:

[SET AUTOCOMMIT section | speed up a bunch of INSERT or UPDATE statements]
SET @%FileName2%_§| = @@SESSION.AUTOCOMMIT;
SET SESSION AUTOCOMMIT=0;
-- Other code here
SET SESSION AUTOCOMMIT=@%FileName2%_§;

In the above section, the filename (without extension) would be part of the name of the variable holding the old AUTOCOMMIT value.

It might be good to add this feature to the "clip file format" section of the help file.

Options: Reply | Quote | Up ^


#7 Re: Documentation about clips and user variables?

Posted by: pspad | Date: 2015-02-11 12:51 | IP: IP Logged

I will include it in help.
I updated help, cause it was very old - I hadn't sources. I was forced to decompile it and fully reformat. New full version will contains updated help

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