×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Manipulating the Tools>>Editor>>Syntax color settings in compiled programs
2

Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

(OP)
I have created a VFP program which allows me to code VFP as if I was in the VFP IDE. The principal feature lies in the use of the command:

CODE --> vfp

MODIFY COMMAND file.prg 

This command is most likely connected to the resource file foxuser.dbf, where in one of the records the color code from Tools>>Editor>>Syntax color settings is residing.

A few days ago, however, the colors which I set in Tools>>Editor>>Syntax suddenly reverted to the default settings in the Compiled version of my application. Now I get that Blue on Black silly combination which I simply cannot tolerate.

This is the color setting in my Tools>>Editor>>Syntax color settings:



This is what it looks like when I run my application directly from the VFP IDE:



This is what it looks like when I run the compiled EXE application.



I know that most people just live with the default, but I am not that guy.

In my start.prg, however I did specify the resource from which I assume the Editor Color Settings come from:



It does not help at all. I still get the same blue and black...

Any help would be appreciated

TIA


Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

I share your view, my major change is red for strings. The colors are in the registry.
See https://myvfpblog.blogspot.de/2008/03/vfp-editor-c...

AFAIK you can even set more colors as the Options tab allows to change and I'm not sure how the alpha channel affects the looks.

Bye, Olaf.

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

(OP)
Olaf,

That was a very interesting topic. I really enjoyed reading it. And this is what came up. My EXE file does not have listings in the registry where I can make changes for it in the Registry to accommodate my MODIFY COMMAND "File.prg" window. That article was useful for this fellow to parse through the Editor color settings in the Registry and generate an HTML look alike color settings environment, I suppose in VFP or elsewhere.

I need to do that adjustment in a compiled EXE application, which is no longer wired into the VFP IDE. There are no Editor color settings in the registry for my exe file.

Any ideas, Olaf?

Thanks nevertheless. That article cleared up many cobwebs!

Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

Even if you edit in the compiled exe, you use the VFP editor, that takes it's color from these registry keys. I'm pretty sure it does.

Bye, Olaf.

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

(OP)
Hmmm... But I looked at them all and they all are correct as how it is shown in my VFP Tools>>Options>>Editor color Settings.

But it is not being picked up with my compiled app.

Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

Dennis,

I'm not sure about this, as I haven't read Burkhard's article in detail, but is there any reason why you can't simply store your own choice of colours in HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\9.0\Options - including creating the entries if they don't already exist?

The fact that the relevant Registry settings "belong to" Microsoft shouldn't deter you.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

Mike, testing a compiled EXE on the same machine as VFP is installed and editor colors are set up, the registry keys exist and are really not rea, I was too sure about that.
Knowing the registry keys, you can change colors to anything the editor options don't offer, so it's still nice to know, but the editor started via MODIFY COMMAND doesn't make use of the registry settings.

If that doesn't work, then that's a runtime vs IDE difference.

Help about the edit options tell this:

Quote (Help)

Run-time applications display only the default color settings because run-time applications do not check the Windows registry for settings that you change in the Options dialog box, which specifies the default settings for color syntax.

I think your only chance is to use another text editor and use the config.fpw TEDIT option to specify it. There are editors allowing syntax coloring extensions, but I don't know of any VFP specific coloring extension.

Bye, Olaf.

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

Quote:

There are editors allowing syntax coloring extensions, but I don't know of any VFP specific coloring extension.

Nor do I. But many programmers' editors allow you to define your own language-specific syntax colours and highlighting. For example, Notepad++ has a feature called "user-defined language" which you could use to define VFP-specific syntax.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

Actually, Notepad++ does support VFP.

I've just found a user-contributed language definition file for it (contributed by José Guillermo Ortiz Hernández). The file is listed at http://docs.notepad-plus-plus.org/index.php/User_D... (scroll down to VFP). There is some information about how to use it in VFP here: http://yousfi.over-blog.com/2016/02/using-notepad-... (written by Yousfi Benameur).

From what Mr Benameur says, it seems that using TEDIT to point to Notepad++ as your external editor should work - although it is not clear if that applies to a compiled EXE rather than just the IDE. It would be worth a try.

(By the way, I found Yousfi's web page very hard to read because of his choice of text and background colours. Fortunately, I have a useful Firefox add-in called Zap Colours, which changes everything to black on white.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

There are serious downsides, though, as the context menu of the native VFP editor has many options I (and surely you, too) regularly use, as beautify or commenting/uncommenting sections of code. Beautify can be called, but you'll have a hard time integrating that into an editor. You might live with the fact, that such features are generally similarly available in editors, but VFPs way to comment with * as first char is unusual.

Bye, Olaf.

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

(OP)
Thank you for your contributions, Mike and Olaf. The next thing I was thinking of doing is to set up the colors for the window. But like Olaf said, the Editor Syntax coloring is probably not available to manipulate all the Editor related features expressed in colors. So, I will have to shed a few tears and go on.

To answer your question, Mike: My choice of colors is embedded already in the registry. Everything is correctly entered in each entry as soon as an adjustment is made in the tools>>Options>>Editor Color Settings. So, that is not the problem.

Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

I take your point about the settings in the Registry, Dennis. Sorry I couldn't come up with anything else.

Regarding the user of an external editor, I appreciate the shortcomings of the TEDIT approach. However, I hope that what I posted (above) about using Notepadd++ for VFP will be of interest to others. Although I don't use it myself for Foxpro programming, it's interesting that someone has gone to the trouble of creating a VFP language definition file for it. I'll give it a try sometime to see how effective it is.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Manipulating the Tools>>Editor>>Syntax color settings in compiled programs

(OP)
Yes, Mike, I intend to look into that. It does seem quite interesting. Possibly better than just having 2 colors. So, thank you kindly for that option. It does seem like the best option. And I am somewhat familiar with the Notepad++. I will give that a try as soon as I get out of another quagmire, which I will post shortly.

Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close