xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

GetSecret()

Allows for hidden Get input for character strings.

Syntax

GetSecret( <cInit> , ;
          [<nRow>] , ;
          [<nCol>] , ;
          [<lSay>] , ;
          [<cSay>]   ) --> cString

Arguments

<cInit>
This is a character string serving as the initial value for editing.
<nRow>
This is a numeric value in the range of 0 to MaxRow(). It specifies the screen row position for the Get. The default value is Row().
<nCol>
This is a numeric value in the range of 0 to MaxCol(). It specifies the screen column position for the Get. The default value is Col().
<lSay>
This logical parameter defaults to .F. (false). When set to .T. (true), the edited value is displayed when the function returns.
<cSay>
This is an optional character string displayed as prompt in front of the Get field.

Return

The function returns the edited value as a character string.

Description

GetSecret() is a simplified Get routine for hidden input. The user can edit a character string as in a regular Get field, but the characters are not displayed on the screen. Instead, each character is represented by an aserisk (*). This allows for comfortable input of a password, for example.

Info

See also:@...GET
Category: CT:GetSys , Get system
Source:ct\getsecrt.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows a typical scenario for GetSecret().
// The user must enter a password which is not displayed on
// the screen

   PROCEDURE Main
      LOCAL cPassword := Space(20)
      CLS
      SET CONFIRM ON

      cPassWord := ;
        GetSecret( cPassword, 10, 10, .T., "Enter your password: ")

      IF cPassWord <> "xHarbour"
         Alert( "Access denied" )
         QUIT
      ENDIF

      Alert( "Access granted" )
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe