Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show line/column position in VFP 9.0 PRG editing window

Status
Not open for further replies.

dmusicant

Programmer
Mar 29, 2005
253
US
I used to be able to get this at the bottom left of the standard VFP 9 (and lesser versions) editing window. I know that many VFP programmers prefer other PRG editing options (a 3rd party editor, I suppose), and I would like to hear some suggestions, but I have always just used the one provided by Microsoft with FoxPro and managed with it.

Well, I have some pretty huge PRGs and I like to know the line number, e.g. 2021, just so I have an idea where I am in the PRG. Am I near the top? Near the middle, near the end, that sort of thing.

Right now, I'm editing a pretty big PRG (how big I don't know because I can't see the line position at all!). I went into Tools/Options, selected the IDE tab. In Specify file/window I selected "Program files." Then I checked the checkbox labeled Show line/column position. I even checked Override individual settings, in case that was the issue, but that didn't seem to do anything. I clicked the button [Set As Default]. Still, I don't see my line/column position of my cursor in the VFP PRG editing window when looking at the PRG that I want to edit.

Now, in the past I was able to get the line/column position in the editing window after messing with the setting. However, I found that for some reason the setting would go away and I'd have to set it again. That was an annoyance, but at least I could reset it.

Demystifications, explanations very much appreciated!
 
if the .prg window is maximized the line number disappears - only shows when the window is 'normal'

Never noticed that before.


hth

n

edit: spoke too soon..... now it is staying when i maximize the window. Seems a bit flakey but maximise and normal seems to reset it.
 
Well, I did a search and came upon an MSDN thread where it was suggested to enter this command in the command window in an effort to resolve this complaint:

SET MESSAGE TO

Doing that has resolved the behavior. However, I don't know why I had to do that. I am pretty sure I've never used that command. What's at play here? Thanks for insights.
- - -
A related post points to the FOXUSER.DBF file and nuances:
- -
VFP uses the foxuser.dbf to hold most of these sorts of configuration items at an item by item levvel. So say you open a prg and it doesn't have lineno set on and close it, foxuser remembers this. Open another prg and realize you the lineno feature is available and you turn it on and even check on Apply to PRG files so now this PRG and all future ones will have lineno on. But reopen the first prg and you'll see it's not displaying linenos, this is because the foxuser record for this particular prg has it set off.

While you are getting used to VFP you may have different things in different states. To get everything back to ground zero you can just delete the foxuser files and VFP will reconstruct them from scratch.

? sys(2005)

will tell you where your foxuser table is stored.
 
Try this:

1. Open the progam editor.

2. Right-click in the editing window and choose Properties.

3. Tick the "Show line/column position" box.

I don't see why [tt]SET MESSAGE TO[/tt] should make any difference, but if it works for you, that's fine.

Edit: But of course you do have to have [tt]SET STATUS BAR ON[/tt].

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
SET MESSAGE TO: I have to do that all the time, yes. I think it's by design. It seems VFP thinks it has to persist the status bar message it has, only SET MESSAGE TO then reveals the line/col position.

It has become a habit for me when I don't see the position I SET MESSAGE TO.

I don't see how you could automate that. The override is just about showing position or not, override means in PRGs you have it off it is on, but any message already existing in the status bar seems to have priority to VFP.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf, don't you have a start.prg which runs from CONFIG.FPW where you can SET MESSAGE TO?
Here is mine for comparison:

PATH = D:\PROGRAM\VFP9,D:\PROGRAM\VFP9\DEV,D:\PROGRAM\VFP9\DEV\ADR
TMPFILES = C:\TEMP
PROGWORK = C:\TEMP
EDITWORK = C:\TEMP
SORTWORK = C:\TEMP
AUTOSAVE = ON
BELL = 512,1
CATMAN = OFF
CLOCK = STATUS
CODEPAGE = AUTO
COLLATE = SWEFIN
DATE = ANSI
DELETED = ON
*ESCAPE = OFF
*EXCLUSIVE = ON
HOURS = 24
MEMLIMIT = 30,1024,16384
MVCOUNT = 8192
NEAR = ON
RESOURCE = VFP9USER
SAFETY = OFF
STICKY = OFF
TALK = WINDOW
TALK = ON
TIME = 1000000
TITLE = VFP 9
REPROCESS = AUTOMATIC
COMMAND = DO dev\start
COMMAND = ?SetMemory(20)
 
It happens over and over again.

I have some reset.prg in many projects, but you don't always want to reset everything.

Besides that, I rarely need line numbers, I use the document view to rent myself in files with many definitions/declarations.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf said:
SET MESSAGE TO: I have to do that all the time,

That's odd. I have never needed to do it. I can always see the line and column numbers, as well as all the other status bar stuff like record numbers and lock status (but not at the same of course).

Just been experimenting. I see the line/col numbers and nothing else when the editing window has focus. I see the record numbers, etc. at other times. I assume that's the intended behaviour?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
On mine, I do not normally have the positions shown, having read this I was thirsty to have them!

Set Message to did nothing, Mike's solution worked - but only if I modified a file and then saved it after
changing the properties - and survived exiting VFP.

I edit a lot of .ASP files and when I did, I had to change the properties to do it for .ASP files as well
changing the specific file type option to be ticked as well before it would survive an exit and return.

Interesting


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
SET MESSAGE TO alone does nothing, eitherr the general option or the option per PRG/method must be set.

Mike, I especially have this when I have set status bar messages myself with SET MESSSAGE TO 'well, a message'.

This overrides the line/ccl position display for me. Maybe you never make use of status bar messages.

Bye, Olaf.

Olaf Doschke Software Engineering
 
I especially have this when I have set status bar messages myself with SET MESSSAGE TO 'well, a message'. ...Maybe you never make use of status bar messages.

That is correct. In fact, I always hide the status bar at run time. I don't know why. It's just what I have always done.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top