Difference between revisions of "READVAR()"

From Recital Documentation Wiki
Jump to: navigation, search
Line 12: Line 12:
  
 
==See Also==
 
==See Also==
[[@...GET]], [[DEFINE TABLE]], [[PARAMETERS]], [[RECNO()]], [[SET VALIDATE]]
+
[[@...GET]], [[DEFINE TABLE]], [[GETNO()]], [[PARAMETERS]], [[READ]], [[RECNO()]], [[SET FIELDVAL]], [[SET VALIDATE]]
  
  
Line 25: Line 25:
 
// 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 51:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Screen Forms]]
 +
[[Category:Screen Forms Functions]]

Revision as of 11:57, 9 June 2009

Class

Screen Forms


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


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 Mirage Server, Recital Terminal Developer