Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
IF TYPE("ALEN(m.SomeVariable")
IF X2IsArray(@m.SomeVariable)
*
* X2IsArray.PRG
* RETURNs a logical value indicating whether the
* variable PASSED BY REFERENCE or the passed Object.Property
* is an array.
*
* Copyright (c) 2004-2005 Visionpace All Rights Reserved
* 17501 East 40 Hwy., Suite 218
* Independence, MO 64055
* 816-350-7900
* http://www.visionpace.com
* http://vmpdiscussion.visionpace.com
* Author: Drew Speedie
* Special thanks to Mike Yearwood and Chris Bohling
*
* USAGE
* =====================================
* IF X2IsArray(@m.SomeVariable)
* ...
* ENDIF
* IF X2IsArray(SomeObject,"SomeProperty")
* ...
* ENDIF
*
*
* lParameters
* tuVariable (R) Memory variable to be checked,
* passed here BY REFERENCE
* -OR-
* Object whose tcProperty is to be
* checked
* tcProperty (O) If tuVariable is passed as an object
* reference, this parameter is REQUIRED,
* and indicates the property of the
* tuVariable object that is checked for
* being an array
* If tuVariable is passed as a memory
* variable, DO NOT PASS THIS PARAMETER,
* or this routine will RETURN .F.
*
LPARAMETERS tuVariable, tcProperty
LOCAL llRetVal
DO CASE
******************************************************
CASE PCOUNT() = 1 AND NOT VARTYPE(m.tuVariable) = "O"
******************************************************
llRetVal = TYPE("ALEN(m.tuVariable)") = "N"
******************************************************
CASE PCOUNT() = 1 AND TYPE("ALEN(m.tuVariable)") = "N"
******************************************************
llRetVal = .t.
******************************************************
CASE VARTYPE(m.tuVariable) = "O" ;
AND VARTYPE(m.tcProperty) = "C" ;
AND NOT EMPTY(m.tcProperty)
******************************************************
llRetVal = TYPE("ALEN(m.tuVariable." + m.tcProperty + ")") = "N"
******************************************************
OTHERWISE
******************************************************
*
* you apparently haven't passed the parameters
* properly -- we could have RETURNed .NULL. here,
* but then every time you call X2IsArray(), you
* would have to check for .NULL, .T., and .F.
* rather than just .T. or .F., so it's up to you
* to pass the parameters correctly
* Roses are red
* Violets are blue
* To pass parms correctly
* Is all up to you
*
llRetVal = .f.
ENDCASE
RETURN m.llRetVal