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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intellisense when using With... EndWith structure ?

Status
Not open for further replies.
Apr 12, 2002
31
0
0
US
Hi,

Is there a way, using VFP 7, to configure Intellisense to work while using a With.. EndWith structure?

John
 
hoosier121 (MIS): Is there a way, using VFP 7, to configure Intellisense to work while using a With.. EndWith structure?

Depends on what you want to do. If it's just making Intellisense to convert it to uppercase upon printing - you can get it with no problem: at the bar menu Tools/IntelliSense Manager and select Custom tab.

If you want to complete it as the bracket operator, i.e. you type just "with " (with the space) and VFP finishes it off with
Code:
WITH
   <indent>
ENDWITH
I would recommend to use Macros (macrocommand) recorder/editor.
Keep in mind, though, the more macros and/or custom Intellisense settings you have - the slower VFP editor works: it has to check the Intellisense and macros' list upon keystroke, and it may have difficulty keeping up with your typing (mine already does).

Regards,

Ilya
 
i know exactly what you mean - but have no solutions.

e.g when using a thisformset.form1.text1.value
normally after each . you would get a drop down list of available properties but when using

with thisformset.form1.text1
.value
endwith

but when typing a . within the with statement none of the properties/methods of text1 are displayed.

mrF

 
IRABYY,

I would recommend to use Macros (macrocommand) recorder/editor.

That is a good tip to keep in mind. But what I had in mind was more like the following.
With ThisForm
.<<After a &quot;.&quot; I would like to see the Members List>>
EndWith




John
 
hoosier121 (MIS): what I had in mind was more like the following.
With ThisForm
.<<After a &quot;.&quot; I would like to see the Members List>>
EndWith



John

Sorry, John, for having to break it on you: the dot &quot;.&quot; operator and Intellisense do not work well together in VFP! It's not like in VB, y'know... (I wish it were!)

At least, I could not make it to work, whatever I tried.

Regards,

Ilya

 
John,

If there is a way of doing it, I'd love to know about it.

What I do (and I really hate this) is to move the insertion point to the WITH line, type the period, have Intellisense insert the property or method, then cut and paste the period and the PEM name to the acutal place in the code where I want it.

Sounds terrible, I know, but it is (sometimes) actually quicker than having to remember or look up the PEM name and type it in from scratch.

Mike


Mike Lewis
Edinburgh, Scotland
 
Microsoft suggests using the strong typing available since VFP 7 such as...

LOCAL xyz as textbox
WITH thisform
xyz.Value = &quot;HELLO WORLD&quot;
xyz.forecolor=16711680
endwith

...if you start typing &quot;xyz.&quot; inside the with structure you will see intellisense show up...then they say to do a find &quot;xyz&quot; and replace with &quot;&quot;. This isn't much better than Mike Lewis's workaround proposed above, but another possible workaround to speed your development. Leaving the &quot;Local xyz as textbox&quot; is the part that I'm not real thrilled about, doesn't produce errors but declared variables that are never initialized leaves me with a bad taste in my mouth. Microsoft endorses it though.


Slighthaze = NULL
 
An improvement on Slighthaze's suggestion. If you put in the lines

#IF .F.
LOCAL xyz as textbox
#ENDIF
#DEFINE xyz

what happens then is that Intellisense works while you are writing code. Then when you save the program/form the compiler will operate, removing the LOCAL statement from the compiled program/form and remove all the references to xyz, just leaving you with .Value = &quot;HELLO WORLD&quot;.

A word of warning - unlike it says in the help, a #DEFINE will operate on all methods in a form, NOT just the one it is written in. You can get around this by putting #UNDEF xyz at the end of the method it is in.

Hope that helps,

Stewart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top