Difference between revisions of "READVAR()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 1: Line 1:
=READVAR()=
 
 
 
 
==Class==
 
==Class==
 
Screen Forms
 
Screen Forms
Line 15: Line 12:
  
 
==See Also==
 
==See Also==
[[@...GET]], [[DEFINE TABLE]], [[RECNO()]], [[PARAMETER]], [[SET VALIDATE]]
+
[[@...GET]], [[DEFINE TABLE]], [[PARAMETERS]], [[RECNO()]], [[SET VALIDATE]]
  
  
Line 31: Line 28:
 
// 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

Revision as of 12:42, 24 March 2009

Class

Screen Forms


Purpose

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


Syntax

READVAR([<expN>])


See Also

@...GET, DEFINE TABLE, PARAMETERS, RECNO(), 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