Esempio n. 1
0
//////////
//
// Function: EMPTY()
// Determines whether an expression evaluates to empty.
//
//////
// Version 0.58
// Last update:
//     Mar.20.2015
//////
// Change log:
//     Mar.20.2015 - Refactoring by Stefano D'Amico
//     Mar.19.2015 - Refactoring by Rick C. Hodgin
//     Mar.19.2015 - Initial creation by Stefano D'Amico
//////
// Parameters:
//     p1	-- Specifies the expression that EMPTY( ) evaluates.
//
//////
// Returns:
//    EMPTY( ) returns True (.T.) if the expression eExpression evaluates to empty;
//    otherwise, EMPTY( ) returns False (.F.)
//////
// Example:
//    ? EMPTY("AA")	&& Display .F.
//    ? EMPTY("  ")	&& Display .T.
//    ? EMPTY(0.0)	&& Display .T.
//////
	void function_empty(SReturnsParams* rpar)
	{
		SVariable*	varExpr = rpar->ip[0];
		bool		llEmpty;
		SVariable*	result;


		//////////
		// Verify the expression is correct
		//////
			rpar->rp[0] = NULL;
			if (!iVariable_isValid(varExpr))
			{
				iError_report_byNumber(_ERROR_PARAMETER_IS_INCORRECT, iVariable_get_relatedComp(varExpr), false);
				return;
			}


		//////////
		// Create and populate the return variable
		//////
			llEmpty	= function_isempty_common(rpar, varExpr);
			result	= iVariable_createAndPopulate_byText(_VAR_TYPE_LOGICAL, iVariable_populate_byBool(llEmpty), 1, false);
			if (!result)
				iError_report_byNumber(_ERROR_INTERNAL_ERROR, iVariable_get_relatedComp(varExpr), false);


		//////////
		// Signify our result
		//////
			rpar->rp[0] = result;

	}
Esempio n. 2
0
//////////
//
// Function: ISNULL()
// Determines whether an expression evaluates to null.
//
//////
// Version 0.58
// Last update:
//     Apr.22.2015
//////
// Change log:
//     Apr.06.2015 - Initial creation by Hernan Cano M
//////
// Parameters:
//     p1	-- Specifies the expression that ISNULL() evaluates.
//
//////
// Returns:
//    ISNULL() returns True (.T.) if the expression eExpression evaluates to null;
//    otherwise, ISNULL() returns False (.F.)
//////
// Example:
//    ? ISNULL("AA")	&& Display .F.
//    ? ISNULL("  ")	&& Display .F.
//    ? ISNULL(0.0)  	&& Display .F.
//    ? ISNULL(.null.)  && Display .T.
//////
	void function_isnull(SReturnsParams* rpar)
	{
		SVariable*	varExpr = rpar->ip[0];

		bool		llIsNull;


		//////////
		// Verify the variable is of a valid format
		//////
			rpar->rp[0] = NULL;
			if (!iVariable_isValidType(varExpr))
			{
				iError_report_byNumber(_ERROR_PARAMETER_IS_INCORRECT, iVariable_get_relatedComp(varExpr), false);
				return;
			}


		//////////
		// Create and populate the return variable
		//////
			llIsNull	= ifunction_isnull_common(varExpr);
			rpar->rp[0]	= iVariable_createAndPopulate_byText(_VAR_TYPE_LOGICAL, iVariable_populate_byBool(llIsNull), 1, true);
			if (!rpar->rp[0])
				iError_report_byNumber(_ERROR_INTERNAL_ERROR, iVariable_get_relatedComp(varExpr), false);

	}
Esempio n. 3
0
//////////
//
// Function: EMPTY()
// Determines whether an expression evaluates to empty.
//
//////
// Version 0.57
// Last update:
//     Mar.20.2015
//////
// Change log:
//     Mar.20.2015 - Refactoring by Stefano D'Amico
//     Mar.19.2015 - Refactoring by Rick C. Hodgin
//     Mar.19.2015 - Initial creation by Stefano D'Amico
//////
// Parameters:
//     p1	-- Specifies the expression that EMPTY( ) evaluates.
//
//////
// Returns:
//    EMPTY( ) returns True (.T.) if the expression eExpression evaluates to empty;
//    otherwise, EMPTY( ) returns False (.F.)
//////
// Example:
//    ? EMPTY("AA")	&& Display .F.
//    ? EMPTY("  ")	&& Display .T.
//    ? EMPTY(0.0)	&& Display .T.
//////
	void function_empty(SThisCode* thisCode, SFunctionParms* rpar)
	{
		SVariable*	varExpr = rpar->params[0];
		bool		llEmpty;
		SVariable*	result;


		//////////
		// Verify the expression is correct
		//////
			rpar->returns[0] = NULL;
			if (!iVariable_isValid(varExpr))
			{
				iError_reportByNumber(thisCode, _ERROR_PARAMETER_IS_INCORRECT, iVariable_getRelatedComp(thisCode, varExpr), false);
				return;
			}


		//////////
		// Create and populate the return variable
		//////
			llEmpty	= function_isempty_common(thisCode, rpar, varExpr);
			result	= iVariable_createAndPopulate_byText(thisCode, _VAR_TYPE_LOGICAL, (cs8*)((llEmpty) ? &_LOGICAL_TRUE : &_LOGICAL_FALSE), 1, false);
			if (!result)
				iError_reportByNumber(thisCode, _ERROR_INTERNAL_ERROR, iVariable_getRelatedComp(thisCode, varExpr), false);


		//////////
		// Signify our result
		//////
			rpar->returns[0] = result;

	}
Esempio n. 4
0
SProperty* iProperty_allocateAs_s32(SDatum* name, s32 tnValue)
{
    SProperty*	p;
    SVariable*	value;


    // Make sure our environment is sane
    p = NULL;
    if (name)
    {
        // Create a variable
        value = iVariable_createAndPopulate_byText(iiVariable_getType_s32(), (cs8*)&tnValue, 4, false);
        if (value)
        {
            // Create the property
            p = iiProperty_allocate(name, value);
            if (p)
                p->value_allocated = true;

        }
    }

    // Indicate our property
    return(p);
}
Esempio n. 5
0
//////////
//
// Function: ISUPPER()
// Determines whether the first character in a character expression is an uppercase alphabetic character.
//
//////
// Version 0.58
// Last update:
//     Sep.15.2015
//////
// Change log:
//     Sep.15.2015 - Initial creation by Stefano D'Amico
//////
// Parameters:
//     p1	-- Specifies the character expression that ISUPPER( ) evaluates.
//     p2	-- Optional, if true evaluates all string
//
//////
// Returns:
//    ISUPPER( ) returns true (.T.) if the first character in a character expression is an uppercase alphabetic character;
//    otherwise, ISUPPER( ) returns false (.F.).
//////
// Example:
//    ? ISUPPER("Aa")		&& Display .T.
//    ? ISUPPER("Aa")		&& Display .T.
//    ? ISUPPER("Aa", .T.) 	&& Display .F.
//    ? ISUPPER("AA", .T.)	&& Display .T.
//////
	void function_isupper(SReturnsParams* rpar)
	{
		SVariable*	varStr				= rpar->ip[0];
		SVariable*	varTestWholeString	= rpar->ip[1];

		bool		llTestWholeString, llIsUpper;
		bool		error;
		u32			errorNum;


		//////////
		// Parameters 1 must be present and character
		//////
			rpar->rp[0] = NULL;
			if (!iVariable_isValid(varStr) || !iVariable_isTypeCharacter(varStr))
			{
				iError_report_byNumber(_ERROR_P1_IS_INCORRECT, iVariable_get_relatedComp(varStr), false);
				return;
			}


		//////////
		// If present, parameter 2 must be bool
		//////
			if (varTestWholeString)
			{
				if (!iVariable_isFundamentalTypeLogical(varTestWholeString))
				{
					iError_report_byNumber(_ERROR_P2_IS_INCORRECT, iVariable_get_relatedComp(varTestWholeString), false);
					return;
				}

				// Grab the value
				llTestWholeString = iiVariable_getAs_bool(varTestWholeString, false, &error, &errorNum);
				if (error)
				{
					iError_report_byNumber(errorNum, iVariable_get_relatedComp(varTestWholeString), false);
					return;
				}

			} else {
				// Just testing the first character
				llTestWholeString = false;
			}


		//////////
		// Create and populate the return variable
		//////
			llIsUpper	= ifunction_iscommon(varStr, llTestWholeString, _isUpper);
			rpar->rp[0]	= iVariable_createAndPopulate_byText(_VAR_TYPE_LOGICAL, iVariable_populate_byBool(llIsUpper), 1, true);
			if (!rpar->rp[0])
				iError_report_byNumber(_ERROR_INTERNAL_ERROR, iVariable_get_relatedComp(varStr), false);

	}
Esempio n. 6
0
	void iiVjr_init_createGlobalSystemVariable(SVariable** var, s32 tnType, cu8* tcName, cs8* tcInitValue, u32 tnInitValueLength)
	{
		// Create it
		if (!tcInitValue)		*var = iVariable_create(NULL, tnType, NULL, true);
		else					*var = iVariable_createAndPopulate_byText(NULL, tnType, tcInitValue, tnInitValueLength, false);

		// Name it
		iDatum_duplicate(&(*var)->name, tcName, -1);

		// Mark it as a system variable
		(*var)->isSysVar = true;

		// Append it to global variables
		iLl_appendExistingNodeAtEnd((SLL**)&varGlobals, (SLL*)*var);
	}
Esempio n. 7
0
//////////
//
// Function: _VJRSYS()
// Internal function.  Not published.  Used to access VJr system variables.
//
//////
// Version 0.58
// Last update:
//     Oct.28.2015
//////
// Change log:
//     Oct.28.2015 - Initial creation by Rick C. Hodgin
//////
// Parameters:
//     varIndex			-- Index function to access the variable
//
//////
// Returns:
//     Varies			-- Based on index, returns the VJr system variable
//////
	void function__vjrsys(SReturnsParams* rpar)
	{
		SVariable* varIndex		= rpar->ip[0];

		s32			lnIndex;
		u32			errorNum;
		bool		error;


		//////////
		// Parameter 1 must be valid and numeric
		//////
			rpar->rp[0] = NULL;
			if (!iVariable_isValid(varIndex) || !iVariable_isTypeNumeric(varIndex))
			{
				iError_report_byNumber(_ERROR_P1_IS_INCORRECT, iVariable_get_relatedComp(varIndex), false);
				return;
			}

			// Grab the index value
			lnIndex = iiVariable_getAs_s32(varIndex, false, &error, &errorNum);
			if (error)
			{
				iError_report_byNumber(errorNum, iVariable_get_relatedComp(varIndex), false);
				return;
			}


		//////////
		// Dispatch based on operation
		//////
			switch (lnIndex)
			{
				case 1:
					rpar->rp[0] = iVariable_createAndPopulate_byText(_VAR_TYPE_LOGICAL, iVariable_populate_byBool(glShuttingDown), 1, false);
					break;

				default:
					iError_report_byNumber(_ERROR_FEATURE_NOT_AVAILABLE, iVariable_get_relatedComp(varIndex), false);
					break;
			}

	}
Esempio n. 8
0
SProperty* iProperty_allocateAs_character(cu8* tcName, s32 tnNameLength, cu8* tcValue, s32 tnValueLength)
{
    SDatum*		name;
    SVariable*	value;
    SProperty*	p;


    // Make sure our environment is sane
    p = NULL;
    if (tcName)
    {
        // Allocate a name
        name = iDatum_allocate(tcName, tnNameLength);
        if (name)
        {
            // Allocate the value
            value = iVariable_createAndPopulate_byText(iiVariable_getType_character(), tcValue, tnValueLength, false);
            if (value)
            {
                // Allocate a property
                p = iiProperty_allocate(name, value);
                if (p)
                {
                    // Both were allocated
                    p->name_allocated	= true;
                    p->value_allocated	= true;

                } else {
                    // Failure on creating the property
                    iDatum_delete(&name);
                    iVariable_delete(&value);
                }

            } else {
                // Failure on creating the variable
                iDatum_delete(&name);
            }
        }
    }

    // Indicate our property
    return(p);
}
Esempio n. 9
0
//////////
//
// Function: INLIST()
// A test if the value is in the list.
//
//////
// Version 0.58
// Last update:
//     Mar.22.2015
//////
// Change log:
//     Mar.22.2015 - Initial creation
//////
// Parameters:
//     varValue		-- The value to compare
//     varList1		-- A value in the list
//     varList2		-- A value in the list
//     ..
//     varList9		-- A value in the list
//
//////
// Returns:
//    Logical		-- .t. if the item is found in the list, .f. otherwise
//////
	void function_inlist(SReturnsParams* rpar)
	{
		SVariable*	varValue = rpar->ip[0];
		SVariable*	varList1 = rpar->ip[1];
		bool		llResult;
		s32			lnI, lnType;
		SVariable*	result;
		u32			errorNum;
        bool		error;


		//////////
		// Parameters 1 and 2 must be present, and of equal types
		//////
			rpar->rp[0] = NULL;
			if (!iVariable_isValid(varValue))
			{
				iError_report_byNumber(_ERROR_MISSING_PARAMETER, iVariable_get_relatedComp(varValue), false);
				return;
			}
			if (!iVariable_isValid(varList1))
			{
				iError_report_byNumber(_ERROR_MISSING_PARAMETER, iVariable_get_relatedComp(varList1), false);
				return;
			}


		//////////
		// Each type must be fundamentally the same type
		//////
			for (lnI = 1, lnType = iVariable_get_fundamentalType(varValue); lnI < (s32)_MAX_PARAMS_COUNT && rpar->ip[lnI]; lnI++)
			{

				//////////
				// Make sure this variable type matches the test value
				//////
					if (iVariable_get_fundamentalType(rpar->ip[lnI]) != lnType)
					{
						// The types do not match
						iError_report_byNumber(_ERROR_DATA_TYPE_MISMATCH, iVariable_get_relatedComp(rpar->ip[lnI]), false);
						return;
					}

			}


		//////////
		// Iterate through to see if the parameters are equal
		//////
			for (lnI = 1, llResult = false; lnI < (s32)_MAX_PARAMS_COUNT && rpar->ip[lnI]; lnI++)
			{

				//////////
				// Compare the value with each list item
				//////
					if (iVariable_compare(varValue, rpar->ip[lnI], false, &error, &errorNum) == 0 && !error)
					{
						// We found a match
						llResult = true;
						break;
					}


				//////////
				// Report on errors
				//////
					if (error)
					{
						iError_report_byNumber(errorNum, iVariable_get_relatedComp(rpar->ip[lnI]), false);
						return;
					}

			}


		//////////
		// Based on the result, create the return(result)
		//////
			result = iVariable_createAndPopulate_byText(_VAR_TYPE_LOGICAL, iVariable_populate_byBool(llResult), 1, false);
			if (!result)
				iError_report_byNumber(_ERROR_INTERNAL_ERROR, iVariable_get_relatedComp(varValue), false);


		//////////
		// Indicate our result
		//////
			rpar->rp[0] = result;

	}
Esempio n. 10
0
//////////
//
// Function: WEEK()
// Returns a number representing the week of the year from a Date or DateTime expression.
//
//////
// Version 0.58
// Last update:
//     May.01.2015
//////
// Change log:
//     May.01.2015 - Initial creation by Stefano D'Amico
//////
// Parameters:
//     p1			-- Date or DateTime
//     p2			-- Numeric [nMinDaysOfWeek] Minimum number of days in first week of year (1..7)
//     p3			-- Numeric [nFirstDayOfWeek] 
//
//////
// Returns:
//    WEEK() returns a number representing the week of the year.
//////
// Example:
//	  dt = datetime()	&& May.01.2015
//    ? WEEK(dt)		&& Displays 18
//////
	void function_week(SReturnsParams* rpar)
	{
		SVariable*	varParam			= rpar->ip[0];
		SVariable*	varFirstWeek		= rpar->ip[1];
		SVariable*	varFirstDayOfWeek	= rpar->ip[2];

		u32			lnYear, lnMonth, lnDay;
		s32			lnWeek, lnMinDaysInWeek, lnFirstDayOfWeek;
		SYSTEMTIME	lst;
		bool		error;
		u32			errorNum;
		SVariable*	result;


		//////////
		// If provided, parameter 1 must be date or datetime
		//////
			rpar->rp[0] = NULL;
			if (varParam)
			{
				if (!iVariable_isValid(varParam) || !(iVariable_isTypeDate(varParam) || iVariable_isTypeDatetime(varParam) || iVariable_isTypeDatetimeX(varParam)))
				{
					iError_report_byNumber(_ERROR_INVALID_ARGUMENT_TYPE_COUNT, iVariable_get_relatedComp(varParam), false);
					return;
				}

			//////////
			// Grab year, month, day from datetime or date
			//////
				     if (iVariable_isTypeDatetime(varParam))		iiDateMath_get_YyyyMmDd_from_julian					(varParam->value.data_dt->julian,			&lnYear, &lnMonth, &lnDay);
				else if (iVariable_isTypeDatetimeX(varParam))		iiDateMath_get_YyyyMmDdHhMmSsMssNss_from_jseconds	(varParam->value.data_dtx->jseconds, NULL,	&lnYear, &lnMonth, &lnDay, NULL, NULL, NULL, NULL, NULL);
				else /* date */										iiDateMath_get_YyyyMmDd_from_YYYYMMDD				(varParam->value.data_u8,					&lnYear, &lnMonth, &lnDay);

			} else {
				// Use the current date
				if (_settings)		iTime_getLocalOrSystem(&lst, propGet_settings_TimeLocal(_settings));
				else				GetLocalTime(&lst);

				lnYear	= lst.wYear;
				lnMonth	= lst.wMonth;
				lnDay	= lst.wDay;
			}


		//////////
		// Parameter 2 must be numeric
		//////
			if (varFirstWeek)
			{
				if (!iVariable_isValid(varFirstWeek) || !iVariable_isTypeNumeric(varFirstWeek))
				{
					iError_report_byNumber(_ERROR_P2_IS_INCORRECT, iVariable_get_relatedComp(varFirstWeek), false);
					return;
				}

				// Grab the minimum number of days in week
				lnMinDaysInWeek = iiVariable_getAs_s32(varFirstWeek, false, &error, &errorNum);
				if (error)
				{
					// An error extracting the value (should never happen)
					iError_report_byNumber(errorNum, iVariable_get_relatedComp(varFirstWeek), false);
					return;
				}

				if (lnMinDaysInWeek < 1 || 7 < lnMinDaysInWeek)
				{
					iError_report_byNumber(_ERROR_OUT_OF_RANGE, iVariable_get_relatedComp(varFirstWeek), false);
					return;				
				}

			} else {
				// First week contains January 1st.
				lnMinDaysInWeek = 1;
			}


		//////////
		// Parameter 3 must be numeric
		//////
			if (varFirstDayOfWeek)
			{
				if (!iVariable_isValid(varFirstDayOfWeek) || !iVariable_isTypeNumeric(varFirstDayOfWeek))
				{
					iError_report_byNumber(_ERROR_P3_IS_INCORRECT, iVariable_get_relatedComp(varFirstDayOfWeek), false);
					return;
				}

				// Grab the first day of week
				lnFirstDayOfWeek = iiVariable_getAs_s32(varFirstDayOfWeek, false, &error, &errorNum);
				if (error)
				{
					// An error extracting the value (should never happen)
					iError_report_byNumber(errorNum, iVariable_get_relatedComp(varFirstDayOfWeek), false);
					return;
				}

				if (lnFirstDayOfWeek < 0 || 6 < lnFirstDayOfWeek)
				{
					iError_report_byNumber(_ERROR_OUT_OF_RANGE, iVariable_get_relatedComp(varFirstWeek), false);
					return;				
				}

			} else {
				// Sunday
				lnFirstDayOfWeek = 0;
			}


		/////////
		// Grab week
		//////
			lnWeek = ifunction_week_common(rpar, lnYear, lnMonth, lnDay, lnMinDaysInWeek, lnFirstDayOfWeek);


		//////////
		// Create and populate our output variable
		//////
			result = iVariable_createAndPopulate_byText(_VAR_TYPE_S32, (cs8*)&lnWeek, 4, false);
			if (!result)
				iError_report_byNumber(_ERROR_INTERNAL_ERROR, iVariable_get_relatedComp(varParam), false);


		//////////
		// Indicate our result
		//////
			rpar->rp[0] = result;

	}
Esempio n. 11
0
	void ifunction_hhmmss_common(SReturnsParams* rpar, SVariable* varParam, u32 tnFunctionType)
	{

		s32			lnMillisecond, lnMicrosecond;
		u32			lnResult, lnHour, lnMinute, lnSecond;
		SYSTEMTIME	lst;
		SVariable*	result;


		//////////
		// If Parameter 1 is provided, it must be datetime or datetimex
		//////
			rpar->rp[0] = NULL;
			if (varParam)
			{
				if (!iVariable_isValid(varParam))
				{
					iError_report_byNumber(_ERROR_INVALID_ARGUMENT_TYPE_COUNT, iVariable_get_relatedComp(varParam), false);
					return;

				} else if (!iVariable_isTypeDatetime(varParam)) {
					// Grab hour, minute, second, millisecond from datetime
					iiDateMath_get_HhMmSsMss_from_seconds(varParam->value.data_dt->seconds, &lnHour, &lnMinute, &lnSecond, &lnMillisecond);
					lnMicrosecond = lnMillisecond * 1000;

				} else if (!iVariable_isTypeDatetimeX(varParam)) {
					// Grab hour, minute, second, millisecond from datetime
					iiDateMath_get_julian_and_YyyyMmDdHhMmSsMssNss_from_jseconds(varParam->value.data_dtx->jseconds, NULL, NULL, NULL, NULL, NULL, &lnHour, &lnMinute, &lnSecond, &lnMillisecond, &lnMicrosecond);

				} else {
					iError_report_byNumber(_ERROR_INVALID_ARGUMENT_TYPE_COUNT, iVariable_get_relatedComp(varParam), false);
					return;
				}

			} else {
				// Use the current datetimex
				if (_settings)		iTime_getLocalOrSystem(&lst, propGet_settings_TimeLocal(_settings));
				else				GetLocalTime(&lst);

				lnHour			= lst.wHour;
				lnMinute		= lst.wMinute;
				lnSecond		= lst.wSecond;
				lnMillisecond	= lst.wMilliseconds;
				lnMicrosecond	= iiDateMath_get_currentMicrosecond();
			}


		//////////
		// Create output variable
		//////
			switch (tnFunctionType)
			{
				case _HMS_COMMON_HOUR:			lnResult = lnHour;			break;
				case _HMS_COMMON_MINUTE:		lnResult = lnMinute;		break;
				case _HMS_COMMON_SECOND:		lnResult = lnSecond;		break;
				case _HMS_COMMON_MILLISECOND:	lnResult = lnMillisecond;	break;
				case _HMS_COMMON_MICROSECOND:	lnResult = lnMicrosecond;	break;

				// Should never happen
				default:
					iError_report_byNumber(_ERROR_INTERNAL_ERROR, iVariable_get_relatedComp(varParam), false);
					return;
			}


		//////////
		// Create the value
		//////
			result = iVariable_createAndPopulate_byText(_VAR_TYPE_U32, (cs8*)&lnResult, sizeof(lnResult), false);
			if (!result)
				iError_report_byNumber(_ERROR_INTERNAL_ERROR, iVariable_get_relatedComp(varParam), false);


		//////////
		// Return the result
		//////
			rpar->rp[0] = result;

	}
Esempio n. 12
0
	void iVjr_init_createConstants(void)
	{
		s32 lnValue;
		f32 lfValue;


		// System constants used internally
		cvarSpace1				= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, cgc_spaceText, 1,	false);
		cvarEmptyString			= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, (cu8*)NULL, 0,		false);
		cvarSpace2000			= iVariable_create(NULL, _VAR_TYPE_CHARACTER, NULL, true);
		cvarTrue				= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_LOGICAL, (cu8*)NULL, 0,		false);
		cvarFalse				= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_LOGICAL, (cu8*)NULL, 0,		false);
		cvarZero				= iVariable_create(NULL, _VAR_TYPE_S64, NULL, true);

		lnValue	= 6;
		cvarSix					= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_S32, (cu8*)&lnValue, 4, false);
		lnValue	= 8;
		cvarEight				= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_S32, (cu8*)&lnValue, 4, false);
		lnValue	= 16;
		cvarSixteen				= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_S32, (cu8*)&lnValue, 4, false);
		lnValue	= 32;
		cvarThirtyTwo			= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_S32, (cu8*)&lnValue, 4, false);
		lnValue	= 64;
		cvarSixtyFour			= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_S32, (cu8*)&lnValue, 4, false);
		lnValue	= 255;
		cvarTwoFiftyFive		= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_S32, (cu8*)&lnValue, 4, false);

		lfValue	= 0.5f;
		cvarFiftyPercent		= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_F32, (cu8*)&lfValue, 4, false);
		lfValue	= 0.5f;
		cvarOneHundredPercent	= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_F32, (cu8*)&lfValue, 4, false);

		// 2000 blank spaces
		iDatum_allocateSpace(&cvarSpace2000->value, 2000);
		memset(cvarSpace2000->value.data, 32, 2000);

		// Constant logical
		*cvarTrue->value.data_s8	= (s8)_LOGICAL_TRUE;
		*cvarFalse->value.data_s8	= (s8)_LOGICAL_FALSE;

		// Datetime constants for parsing
		cvarSetDateAmerican	= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "11/22/3333 12:34:56.000 AP", -1, true);
		cvarSetDateAnsi		= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "3333.22.11 12:34:56.000 AP", -1, true);
		cvarSetDateBritish	= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "22/11/3333 12:34:56.000 AP", -1, true);
		cvarSetDateFrench	= cvarSetDateBritish;
		cvarSetDateGerman	= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "22.11.3333 12:34:56.000 AP", -1, true);
		cvarSetDateItalian	= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "22-11-3333 12:34:56.000 AP", -1, true);
		cvarSetDateJapan		= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "3333/11/22 12:34:56.000 AP", -1, true);
		cvarSetDateTaiwan	= cvarSetDateJapan;
		cvarSetDateLong		= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "Dow, Mon 22, 3333 12:34:56.000 AP", -1, true);
		cvarSetDateShort		= cvarSetDateAmerican;
		cvarSetDateUsa		= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "11-22-33333 12:34:56.000 AP", -1, true);
		cvarSetDateDmy		= cvarSetDateBritish;
		cvarSetDateMdy		= cvarSetDateAmerican;
		cvarSetDateYmd		= cvarSetDateJapan;

		// Other datetime constants for fixed date types
		varSetDateYyyyMmDdTHhMmSsMss	= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "3333-11-22 12:34:56.000 AP", -1, true);
		varSetDateYyyyMmDdTHhMmSs		= iVariable_createAndPopulate_byText(NULL, _VAR_TYPE_CHARACTER, "3333-11-22 12:34:56 AP", -1, true);
	}