Difference between revisions of "VARREAD()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(Products)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=VARREAD()=
 
 
 
==Class==
 
Screen Forms
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to return name of the @...GET variable being processed by a READ
 
Function to return name of the @...GET variable being processed by a READ
Line 15: Line 8:
  
 
==See Also==
 
==See Also==
[[@...GET...VALIDATE]], [[RECNO()]], [[PCOUNT()]], [[READVAR()]]
+
[[@...GET]], [[DEFINE TABLE]], [[GETNO()]], [[PARAMETERS]], [[READ]], [[READVAR()]], [[RECNO()]], [[SET FIELDVAL]], [[SET VALIDATE]]
  
  
Line 26: Line 19:
 
// 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 m_input = "HELP"
+
  if m_input = "HELP"
m_exp = iif(varread()="acc_no","account", "supplier")
+
      m_exp = iif(varread()="acc_no","account", "supplier")
select codes
+
      select codes
save screen
+
      save screen
set message to "Select code.  ^C to abandon."
+
      set message to "Select code.  ^C to abandon."
menu browse &m_exp at 5,30 to 15,40 quit clear
+
      menu browse &m_exp at 5,30 to 15,40 quit clear
restore screen
+
      restore screen
// if a selection was made
+
      // if a selection was made
if not empty(menuitem(),3)
+
      if not empty(menuitem(),3)
set fieldval to left(menuitem(),3)
+
          set fieldval to left(menuitem(),3)
set validate on
+
          set validate on
endif
+
      endif
select accounts
+
      select accounts
else
+
  else
// validate as required
+
    // validate as required
endif
+
  endif
endif
+
 
return
 
return
 
</code>
 
</code>
Line 50: Line 42:
  
 
==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 16:50, 8 December 2009

Purpose

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


Syntax

VARREAD()


See Also

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


Description

The VARREAD() function is synonymous with the READVAR() function. The VARREAD() function returns the name of the current @...GET variable being processed by a READ command. The VARREAD() function is most useful if used in conjunction with the @...GET...VALIDATE command and a validation procedure used to validate more than one field/variable.


Example

// Pop-up choice list called from a field validation
procedure choices
  parameters m_input
  //if the [HELP] key is pressed
  if m_input = "HELP"
      m_exp = iif(varread()="acc_no","account", "supplier")
      select codes
      save screen
      set message to "Select code.  ^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(),3)
          set fieldval to left(menuitem(),3)
          set validate on
      endif
      select accounts
  else
    // validate as required
  endif
return


Products

Recital