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

hide a @ get

Status
Not open for further replies.

rdipalmana

Programmer
Sep 16, 2013
1
Hi.
I have to change a program that was written a few years ago in VFP 2.6. I have to make some variables hidden fields when running a particular condition occurs. Here's an example:
@ 10,10 get w_MOV_DATA
I want to hide w_MOV_DATA when its value is zero.
the program is compiled with Visual FoxPro Visual Studio 6.
Many thanks
 
written a few years ago in VFP 2.6

First, if your application is written in Visual Foxpro 6, you should be posting your question to the Visual FOXPRO specific forum area ( Microsoft: Visual FoxPro Forum forum184 ) instead of to the OLD Foxpro specific area.

Having said that your VFP6 application is obviously NOT using VISUAL Foxpro programming methodology or else you would no longer have any @SAY, @GET, etc in it since that is hold-over from the non-Visual days.

I want to hide w_MOV_DATA when its value is zero.

Just wrap the un-wanted line(s) of code in an IF/ENDIF such that when the conditions are not what you want, the @GET is not executed.

BETTER YET, get rid of ALL of the @GET's and @SAY's by changing to the Visual Foxpro programming methodology.

Good Luck,
JRB-Bldr





 
Just out of curiosity, if you hide it when it's zero how does the user change it to something else?

This may be as trivial as SHOW GET with a color argument, although even that was dicey in FPW. It's not so much that SHOW GET is dicey or difficult, it's the color handling thing. It was incredibly robust/complex (and not overly-well documented) in FPD and some parts of that carried over to FPW. All of the commands still worked in FPW, but some no longer had relevance so they do nothing.

Finding that right combination can be a mess. This is just one reason we don't recommend using @...GET in VFP.

 
Maybe you don't really want to hide the @GET only let it display blank instead of 0.

Textbox.Format "Z" would do that in visual foxpro, in @GET that would be
@ 10,10 get w_MOV_DATA FUNCTION "Z"

Bye, Olaf.
 
To elaborate what JRB-Bldr said:

Code:
@ 8,10 get Data1
@ 9,10 get Data2
read

@ 10,10 get Data3

if Data2 <> 0
   read
else
   clear gets
endif

@ 11,10 get Data4
@ 12,10 get Data5
read
clear gets

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top