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

Control name

Status
Not open for further replies.

bowlieu

Programmer
Joined
Nov 24, 2011
Messages
1
Location
CA
I need to know a control name or variable use in the current control.

I try FOCUS() but it return a number, a need a string like ?string1 or ?CUS:PHONE.

Thank

Clarion 6.3
 
Hi!

You cannot at runtime because ?String1 is a FEQ and is ALWAYS a number. But, you could create a template that create a queue containing all the control names. If you are using ABC template chain, you can copy-paste the below code into a TPL file, register it & add this extension to the procedure in question. At runtime, you could examine the ControlsQ to find out the name.

Code:
#!*****************************************************************************
#!*****************************************************************************
#TEMPLATE(SHANK_TPL, 'CUSTOM TEMPLATE OF SHANKAR'), FAMILY('ABC')
#!*****************************************************************************
##!*****************************************************************************
#!-----------------------------------------------------------------------------
#!-----------------------------------------------------------------------------
#EXTENSION(ShankGenControlQueue,'Generate Queue of Controls'),PROCEDURE
#!-----------------------------------------------------------------------------
#AT(%DataSectionAfterWindow), LAST
#!-----------------------------------------------------------------------------

ControlsQ         QUEUE,PRE(CtrlQ)
Name                STRING(60)
FEQ                 LONG           
                  END 

#ENDAT
#!---------------------------------------------------------------------
#AT(%WindowManagerMethodCodeSection,'Init','(),BYTE'),PRIORITY( 8001 )
#!---------------------------------------------------------------------
  DO BuildControlsQ
#ENDAT
#!---------------------------------------------------------------------
#AT(%ProcedureRoutines)
#!---------------------------------------------------------------------
BuildControlsQ  ROUTINE
  FREE(ControlsQ)

#FOR(%Control)
  CLEAR(ControlsQ)
  CtrlQ:Name = '%Control'
  CtrlQ:FEQ  = %Control
  
  ADD(ControlsQ, CtrlQ:FEQ)
  IF ERRORCODE() THEN MESSAGE('ControlsQ : ' & ERROR()).

#ENDFOR
#ENDAT

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top