2.2.3.19.34 vectorbase::SetLabTalkVectorValue

Description

Assigns an Origin C vector to a LabTalk Object's vector type property.

Syntax

BOOL SetLabTalkVectorValue( LPCTSTR lpcszLabTalkVector )

Parameters

lpcszLabTalkVector
[input] name of the Labtalk Object's vector type property. For example, "FDlog.Type".

Return

Returns TRUE on success or FALSE on failure.

Examples

EX1

void vectorbase_SetLabTalkVectorValue_ex1()
{
    // Get current values of the LabTalk vector FDlog.Type and list them
    vector<string> vecSave;
    BOOL bSave = vecSave.GetLabTalkVectorValue("Fdlog.Type");
    if(bSave)
    {
        printf("Current contents of FDlog.Type:\n");
        for( int ii = 0; ii < vecSave.GetSize(); ii++ )
            printf("   %s\n", vecSave[ii]);
        // Change the contents of the LabTalk vector FDlog.Type
        vector<string> vecNew = {"*.OPJ", "*.TXT"}
        // Set new values to the LabTalk vector and check by reading back
        BOOL bSet = vecNew.SetLabTalkVectorValue("Fdlog.Type");
        if( bSet )
        {
            // Output contents of Fdlog.Type using LabTalk
            printf("New contents of Fdlog.Type:\n");
            for( int ii = 0; ii < vecNew.GetSize(); ii++ )
            {
                string str = LabTalk.FDlog.Type$(ii+1)$;
                printf("   FDLog Type (%d) : %s\n", ii, str);
            }
            // Now set Fdlog.Type back to original values
            BOOL bReset = vecSave.SetLabTalkVectorValue("Fdlog.Type");
            if( bReset )
                out_str("FdLog.Type contents set back to original values");
            else
                out_str("Failed to restore Fdlog.Type back to original values");
        }
        else
            out_str("Failed to set LabTalk vector Fdlog.type");
    }
    else
        out_str("Failed to read LabTalk vector Fdlog.Type");                
}

Remark

Set a LabTalk vector using contents of this vector.

See Also

vectorbase::GetLabTalkVectorValue

Header to Include

origin.h