Created
April 3, 2019 21:17
-
-
Save JamoCA/e9fd556c3f7c01c5c4a23c44555ba411 to your computer and use it in GitHub Desktop.
Pass a variable name to determine if it exists and has len/arraylen/structcount/recordcount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
/* 11/28/2017 Checks to see if item exists and has len/arraylen/structcount/recordcount */ | |
function ExistsLEN(theVariable){ | |
var tempVal = ""; | |
if (LEN(TRIM(theVariable)) AND isDefined(theVariable) AND isSimpleValue(theVariable)){ | |
tempVal = evaluate(theVariable); | |
if (isSimpleValue(tempVal) AND LEN(trim(tempVal))){ | |
return true; | |
} else if (isArray(tempVal) AND ArrayLen(tempVal)){ | |
return true; | |
} else if (isStruct(tempVal) AND StructCount(tempVal)){ | |
return true; | |
} else if (isQuery(tempVal) AND tempval.recordCount){ | |
return true; | |
} | |
} | |
return false; | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment