You are here: PSPad forum > English discussion forum > set user variable from script.

set user variable from script.

#1 set user variable from script.

Posted by: DonQuichote | Date: 2015-06-16 09:17 | IP: IP Logged

Dear all,

Does anyone know if it is possible to set a user variable from script?

I have a clip where I want the current date in compact ISO style (YYYYMMDD), like

DROP PROCEDURE IF EXISTS Upgrade§;
DELIMITER //
CREATE PROCEDURE Upgrade§()
MODIFIES SQL DATA
COMMENT 'Last updated ' -- I want the current date here, like 20150616
BEGIN
|
END//
DELIMITER ;
CALL Upgrade§();
DROP PROCEDURE IF EXISTS Upgrade§;

I could do that with a user variable, but it would need to be set. That could be done by a JavaScript file at start-up. However, I could not find a JavaScript function to set a PSPad variable, only to read it. Is there a way to set a user variable from script so I can use it in a clip?

Options: Reply | Quote | Up ^


#2 Re: set user variable from script.

Posted by: pspad | Date: 2015-06-16 10:46 | IP: IP Logged

1. set forma for DATE variable to YYYYMMDD
2. use %date% (variable name) in clip on palce you want to insert date

Options: Reply | Quote | Up ^


#3 Re: set user variable from script.

Posted by: DonQuichote | Date: 2015-06-16 17:07 | IP: IP Logged

Thanks! It works like a charm!

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