INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Control name

Control name

(OP)
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

RE: Control name

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
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close