You are here: PSPad forum > English discussion forum > Re: adding 3 KeyWord sections and 1 Variable section

Re: adding 3 KeyWord sections and 1 Variable section

Goto Page: Previous1 2 3 Next

#11 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: Professor Bernd | Date: 2020-03-02 09:10 | IP: IP Logged

All variables start with "$" and may contain one or more underscores "_". Examples:

Variables


$_iCounter
$sStringVar1
$s_String_Var_1
$g__sStringVar1
$g_sStringVar_1

MsgBox Constants

$MB_SYSTEMMODAL
$MB_ICONWARNING

Here is a code snippet, with common variable constellations.

--------------------------------------------------------
Global $g_sFilePath = @ScriptDir & '\Testdateien'
Global $g_iKeepFiles = 5
Global $g_aFileList[0]

DeleteOldestFiles($g_sFilePath, $g_iKeepFiles, "*.zip")

Func DeleteOldestFiles($_sFolderPath, $_iNumberOfFilesToKeep, $_sFileMask = "*")

Local $iDateMode = $FT_MODIFIED ; 0 = $FT_MODIFIED (Standard), 1 = $FT_CREATED, 2 = $FT_ACCESSED
Local $iFileCount = 0
Local $sFileList = ""
Local $hFiles = 0
Local $iIdx = 0
Local $iRet = 0

If Not FileExists($_sFolderPath) Then
MsgBox($MB_SYSTEMMODAL + $MB_ICONWARNING, "FileQuantityLimit Error", _
"Folder does not exist: ''" & $_sFolderPath & "'' ")
Exit
EndIf
--------------------------------------------------------

If you meant an example script, I would be happy to send you one. smiling smiley

Bernd.

Edited 1 time(s). Last edit at 2020-03-02 09:14 by Professor Bernd.

Options: Reply | Quote | Up ^


#12 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: Professor Bernd | Date: 2020-03-02 09:48 | IP: IP Logged

Here is another example _GUICtrlRichEdit_GetSel

Options: Reply | Quote | Up ^


#13 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: Professor Bernd | Date: 2020-03-17 09:39 | IP: IP Logged

Were those source samples okay for you? smiling smiley

Options: Reply | Quote | Up ^


#14 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: pspad | Date: 2020-03-17 10:28 | IP: IP Logged

Yes, files are ok. But please be patient. Hectic time now.

Options: Reply | Quote | Up ^


#15 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: Professor Bernd | Date: 2020-03-17 15:23 | IP: IP Logged

No problem, this feature is not urgent. tongue sticking out smiley

Options: Reply | Quote | Up ^


#16 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: Professor Bernd | Date: 2020-03-30 08:18 | IP: IP Logged

Hello Jan.

In the new version you have added the "_" to 'PHP style variable' in the user highlighter. Many thanks for that! smiling smiley

Now only the "$" is missing. It works if I remove the "$" character from the autoit keyword chars. But, as I wrote in posting #9, I can't remove '$' from the autoit keyword char. This would prevent variable detection in all functions that use the %Word% variable, e.g. the Language Help and some of my VBScripts. Another example is when I double-click a varialbe, it is not completely marked for copying, deleting, etc. sad smiley

Is there a way to add the "$" to variable highlighting without removing it from the keyword chars? The "_" is also in the keyword chars, and highlighting works perfectly for this character.

Bernd. smiling smiley

Options: Reply | Quote | Up ^


#17 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: pspad | Date: 2020-03-30 08:37 | IP: IP Logged

Now I underdstand. This is separate problem.
The right solution is:
remove $ from keyword char
correctly handle word selection when highlighting of variable is available.

Options: Reply | Quote | Up ^


#18 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: Professor Bernd | Date: 2020-03-30 08:53 | IP: IP Logged

Please excuse me, my English is not so good. Could you explain more precisely how I could do it? smiling smiley

pspad:
remove $ from keyword char

That's clear. winking smiley

pspad:
correctly handle word selection when highlighting of variable is available.

How exactly can I do that?

Bernd.

Options: Reply | Quote | Up ^


#19 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: pspad | Date: 2020-03-30 09:07 | IP: IP Logged

The second part is up to me, I must change program winking smiley
When change will be done, you can remove $ from keywords, but word selection will correctly mark whole word include '$' char

Options: Reply | Quote | Up ^


#20 Re: adding 3 KeyWord sections and 1 Variable section

Posted by: Professor Bernd | Date: 2020-03-30 09:17 | IP: IP Logged

Oh, very well. Thank you very much. smiling smiley

Bernd.

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 Next





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