Custom Colors for script syntax

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
huginson
Posts: 5
Last visit: Wed Dec 20, 2023 7:13 pm

Custom Colors for script syntax

Post by huginson »

Product, version and build: PrimalScript 2016 - Version 7.2.94
64 bit version of product
Operating system: 64bit , Windows 10

I am working on some rather large batch scripts. The default settings of PrimalScript is to have every part of the known syntax to be dark blue.

This can, when the scripts are getting large be rather annoying. Since every line has a dos batch syntax, almost all lines will start with dark blue color.

How can i change keywords aka setlocal - endlocal - f:functions goto:eof etc with my custom colors ?

The only thing i have found is in options - Text Editor - Colors - Batch/CMD Keywords , however this only let me change colors for all keywords to another color.

I have tried to browse the support pages and google, however i could not find anything on this.

and btw I cannot get the help function inside Options to work. nothing happens when i click it so could not find anything helpfull there either.


..
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Custom Colors for script syntax

Post by Alexander Riedel »

You can put a file called CMD.EXT in the PrimalScript installation folder. List one keyword per line.
These keywords show up with the "Custom keyword" color.
I am not certain at the moment if that will let you override existing keywords.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
huginson
Posts: 5
Last visit: Wed Dec 20, 2023 7:13 pm

Re: Custom Colors for script syntax

Post by huginson »

Thank you Alexander

This does however as you say only create the already blue color on the extra codewords i put in, but do not seem to give me the possibility to set up custom colors for the syntax and so it does not add to readabiliity of the scripts.

i love the sapien Products, however my opinion is that this is a downside to an otherwise excellent Product, if customization of codeword colors is not possible. After all this is offered by most of the free Products in the market like notepad++. I am surprised if it is not a feature I actually expected it :-)


aka: code ; foregroundcolor ; backgroundcolor

something like

echo;blue; white
set;red;white
:main;Orange;yellow
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Custom Colors for script syntax

Post by Alexander Riedel »

You can of course change the color of batch keywords as well as that of custom keywords in the color settings dialog.
If you cannot find that I'd be happy to post a screenshot.

Syntax coloring is a visual aid while reading code to distinguish different classes of text from one another. Code, comments, strings etc.
It also serves as a visual indicator while typing code. Once you press space (or any other terminating character) a keyword will change color
while a misspelled word will not. To what actual color it changes is not really relevant for this as long as it is sufficiently different
from normal, non-command text.
In more complex languages there may be more than one class of keywords, but batch files have a rather small keyword set.

Customization to allow each keyword having a different color and even a different background would actually completely negate the
advantages of syntax coloring. If your script looks like all colors of the rainbow it would be very hard to distinguish what is what.
But of course everyone has a different taste :D
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 7 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.