Difference between revisions of "READVAR()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=READVAR()=
 
 
 
==Class==
 
Screen Forms
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to name the @...GET variable being processed by a READ
 
Function to name the @...GET variable being processed by a READ
Line 15: Line 8:
  
 
==See Also==
 
==See Also==
[[@...GET]], [[DEFINE TABLE]], [[RECNO()]], [[PARAMETER]], [[SET VALIDATE]]
+
[[@...GET]], [[DEFINE TABLE]], [[GETNO()]], [[PARAMETERS]], [[READ]], [[RECNO()]], [[SET FIELDVAL]], [[SET VALIDATE]], [[VARREAD()]]
  
  
Line 21: Line 14:
 
The READVAR() function returns the name of the current @...GET variable being processed by a READ command.  The name of the variable is returned as an uppercase string.  When used with table fields, the READVAR() function returns a blank when the table field is displayed, and the table name when it is activated.  The READVAR() function can also be used to return the <variable> of the current MENU TO <variable> command.
 
The READVAR() function returns the name of the current @...GET variable being processed by a READ command.  The name of the variable is returned as an uppercase string.  When used with table fields, the READVAR() function returns a blank when the table field is displayed, and the table name when it is activated.  The READVAR() function can also be used to return the <variable> of the current MENU TO <variable> command.
  
If the optional <expN> is specified and is greater than zero (0) and if the current @…GET being processed is an object property, then the name of that object will be returned.
+
If the optional <expN> is specified and is greater than zero (0) and if the current @...GET being processed is an object property, then the name of that object will be returned.
  
  
Line 28: Line 21:
 
// Pop-up choice list called from a field validation
 
// Pop-up choice list called from a field validation
 
procedure choices
 
procedure choices
parameters m_input
+
  parameters m_input
// If the help key is pressed
+
  // If the help key is pressed
if lastkey()=ctrl('c')
+
  if lastkey()=ctrl('c')
m_exp = iif(readvar()="ACC_NO","account","supplier")
+
      m_exp = iif(readvar()="ACC_NO","account","supplier")
select codes
+
      select codes
save screen
+
      save screen
set message to "Select code, press  ^C to abandon."
+
      set message to "Select code, press  ^C to abandon."
menu browse &m_exp at 5,30 to 15,40;
+
      menu browse &m_exp at 5,30 to 15,40;
quit;
+
        quit;
clear
+
        clear
restore screen
+
      restore screen
// If a selection was made
+
      // If a selection was made
if not empty(menuitem())  
+
      if not empty(menuitem())  
set fieldval to left(menuitem(),3)
+
          set fieldval to left(menuitem(),3)
set validate on
+
          set validate on
endif
+
      endif
select accounts
+
      select accounts
endif
+
  endif
 
return
 
return
 
</code>
 
</code>
Line 51: Line 44:
  
 
==Products==
 
==Products==
Recital Mirage Server, Recital Terminal Developer
+
Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Screen Forms]]
 +
[[Category:Screen Forms Functions]]

Latest revision as of 15:10, 7 December 2009

Purpose

Function to name the @...GET variable being processed by a READ


Syntax

READVAR([<expN>])


See Also

@...GET, DEFINE TABLE, GETNO(), PARAMETERS, READ, RECNO(), SET FIELDVAL, SET VALIDATE, VARREAD()


Description

The READVAR() function returns the name of the current @...GET variable being processed by a READ command. The name of the variable is returned as an uppercase string. When used with table fields, the READVAR() function returns a blank when the table field is displayed, and the table name when it is activated. The READVAR() function can also be used to return the <variable> of the current MENU TO <variable> command.

If the optional <expN> is specified and is greater than zero (0) and if the current @...GET being processed is an object property, then the name of that object will be returned.


Example

// Pop-up choice list called from a field validation
procedure choices
  parameters m_input
  // If the help key is pressed
  if lastkey()=ctrl('c')
      m_exp = iif(readvar()="ACC_NO","account","supplier")
      select codes
      save screen
      set message to "Select code, press  ^C to abandon."
      menu browse &m_exp at 5,30 to 15,40;
        quit;
        clear
      restore screen
      // If a selection was made
      if not empty(menuitem()) 
          set fieldval to left(menuitem(),3)
          set validate on
      endif
      select accounts
  endif
return


Products

Recital