OptoScript colors?

What happened to the color coding in OptoScript? I am pretty sure it had blue and green color coding in recent past versions…

There’s a file that sometimes goes missing when you install-uninstall (as I recall). We’ve since fixed the install, but the file to look for is “Optoscript.ini” (just text).

It should be in C:\ProgramData\Opto 22\PAC Project
but it used to just be in the dir where pac project was installed.

If you don’t have it at all, and don’t want to re-install, let me know and I’ll attach one…

1 Like

Yep. My file is missing. If you could forward one, that would be great. nickvATnewleafproduceDOTcom.

Thanks,
Nick

Here’s mine, I’ll email it to you also…
Optoscript.zip (1017 Bytes)

1 Like

I never knew this file existed, awesome! Besides editing the existing values is there any other documentation on how the configuration file gets processed? Just wondering if we would be able to highlight things in our code for our own review purposes, for instances, variable names that conform to a certain format.

I didn’t say you could EDIT it. (Just kidding.) While we don’t officially support/document such wild and crazy customization stuff, here on the forums we can get pretty wild and crazy with un-official tricks.

So I’d be interested in any use case you might dream up. This message will self-destruct in 3… 2… 1…

1 Like

Off the top of my head I was just thinking internally we might use it to set off specific comment sections in a different color (if we can define our own keywords / tags, which it looks like might be possible) or even just make certain elements pop a bit more (subroutine calls for example) when glancing over large blocks of OptoScript.

I’d recommend not having TOO large a block of OptoScript, and also not get TOO fancy with the undocumented ini files that are NOT included as part of your strategy. (I’d hate to have you win the lotto and run off to Hawaii and have your co-workers calling in to our support team who has no idea why some of your comments are pink.) Also, if you change PCs or send the strategy to someone else, that ini file won’t be in the archive.

But you can get fancy with commends and colors and even using blocks like post-in note like this:

Mary opened a can of worms here… I went out to the PDF of all OptoScript built in function names and added a color group for them so that my code now highlights all the built-in Opto function names. It’s fantastic. I also wrote a script that runs nightly that adds my own subroutine names to another color group so that they’re highlighted as well. I’m so glad this option is out there.

2 Likes

Wow! And what lovely, colorful worms you’ve unleashed! Beautiful!!

This should be the default.

If anybody is interested, here’s my config file:

The very bottom of the file is where you would define custom subroutine names if you’re interested.

2 Likes

Possible to get an update of the now-dead DropBox link? This looks useful to me!

I have a copy of it, attached.Optoscript.zip (4.6 KB)

1 Like