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

Please help me with FoxPro 2.6 for DOS

Status
Not open for further replies.

FoxStudent

Technical User
Feb 24, 2000
85
GB
I am currently working on a fox pro assignment and having the following two PROBLEMS:<br>
1. I am trying to use a password to log on to the application but can not get it to be disguised when entered. I have tried to use the function r and to set color to x. However, I am obivously not doing it right.<br>
2. I am having problems with popup menus. They are working but if I call a menu from a menu and then try to get back to the calling menu, I run into difficulties. I reliase that the bar() is a public function and that it thinks that I want to perform the operation corresponding to the bar selected in the calling menu on the called menu. P.S. I have wrote too much code to use the menu builder which I have only found out about, if I am to reach the deadline.<br>

 
1. The easiest way to do this in FPD is set the color to black on black: n/n.<br>
<br>
2. I'm not sure I completely follow you, but you can assign the value of BAR() to a variable at the top of the program, thus preserving its value even after another menu item is called.<br>
<br>
foxdev.com<br>

 
For Your Menu Problem, Have You Tried Push Menu and Pop Menu ?<br>
<br>
procedure CUSTMENU<br>
************************************************************************************<br>
push menu _msysmenu<br>
set sysmenu to<br>
do custaddr.mpr<br>
pop menu _msysmenu<br>
return<br>
<br>
<br>
<br>
<br>
For For Your password problem.<br>
<br>
*/***************************************************************************<br>
*/Program : Function Password<br>
*/System :<br>
*/Purpose : Checks a Entered String against a password and return a logical<br>
*/Syntax : lcPassword = Password(Row,Clm)<br>
*/Returns : string , password enrtered<br>
*/Parameter : Integer - Row - The screen row where the input is to be<br>
*/ : Integer - Clm - The screen column where the input is to be<br>
*/Defaults : Row = 0<br>
*/ : Clm = 0<br>
*/Requires : Nothing<br>
*/Changes : Nothing<br>
*/Calls :<br>
*/Version : 1.0<br>
*/Dated : 05/28/1989<br>
*/Written By: David W. Grewe<br>
*/***************************************************************************<br>
*& Utility - Security<br>
*/***************************************************************************<br>
*/ Record Of Change<br>
*/<br>
*/***************************************************************************<br>
parameters PnROW , PnCOL<br>
private PnROW , PnCOL , P_VER<br>
private L_PARA , LcMsg , LcCol , LcPassWord , LnKEY , LcDISPLAY<br>
L_PARA = parameters()<br>
if L_PARA &lt; 2 .or. type('PnROW') &lt;&gt; &quot;N&quot; .or. type('PnCOL') &lt;&gt; &quot;N&quot;<br>
PnCOL = int((scols()-40)/2)<br>
PnROW = int((srows()-4)/2)<br>
endif<br>
*****<br>
*****<br>
* Initialize the password variable so it can be retrieved.<br>
LcPassWord = &quot;&quot;<br>
LcMsg = &quot;Enter Password&quot;<br>
LcCol = len(LcMsg) + 25<br>
PnROW = iif(PnROW &lt; 0, int((srows()-4)/2), iif(PnROW &gt; srow(), srow()-4, PnROW))<br>
PnCOL = iif(PnCOL &lt; 0, int((scols()-40)/2),iif(PnCOL &gt; scol(), scol()-44, PnCOL))<br>
LnKEY = 0<br>
LcDISPLAY=&quot;&quot;<br>
set escape off<br>
set cursor off<br>
define window password from PnROW,PnCOL to PnROW+2,PnCOL+30 system noclose nogrow nofloat nozoom nomdi color scheme 8<br>
activate window password<br>
@ 0,0 say LcMsg<br>
do while len(LcPassWord) &lt; 10<br>
LnKEY=inkey()<br>
do case<br>
case LnKEY = 13 && Return key<br>
exit<br>
case LnKEY = 27 && Escape key<br>
LcDISPLAY = ''<br>
LcPassWord = ''<br>
case LnKEY = 127 && Backspace key<br>
LcPassWord = left(LcPassWord, len(LcPassWord)-1)<br>
LcDISPLAY = replicate(&quot;*&quot;,len(LcPassWord))<br>
case between(LnKEY,48,57) && a Number<br>
LcPassWord = LcPassWord + chr(LnKEY)<br>
LcDISPLAY = replicate(&quot;*&quot;,len(LcPassWord))<br>
case between(LnKEY,65,90) && a Upper Case Letter<br>
LcPassWord = LcPassWord + chr(LnKEY)<br>
LcDISPLAY = replicate(&quot;*&quot;,len(LcPassWord))<br>
case between(LnKEY,97,122) && a Lower Case Letter<br>
LcPassWord = LcPassWord + chr(LnKEY)<br>
LcDISPLAY = replicate(&quot;*&quot;,len(LcPassWord))<br>
endcase<br>
@ 0,len(LcMsg)+2 say LcDISPLAY<br>
enddo<br>
set escape on<br>
set cursor on<br>
release window password<br>
release PnROW , PnCOL , PcVER<br>
release L_PARA , LcMsg , LcCol , LnKEY , LcDISPLAY<br>
return LcPassWord<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top