Scilab 6.0.1
- Scilab Help
- API Scilab
- legacy
- Low level functions
- AssignOutputVariable
- CallOverloadFunction
- CheckInputArgument
- CheckOutputArgument
- ReturnArguments
- UpdateStack
- Boolean reading (Scilab gateway)
- Boolean writing (Scilab gateway)
- Boolean sparse reading (Scilab gateway)
- Boolean sparse writing (Scilab gateway)
- Check variable dimensions (Scilab gateway)
- Variable Reference (Scilab gateway)
- Variable dimension (Scilab gateway)
- Variable Type (Scilab gateway)
- Variable Complexity (Scilab gateway)
- Matrix Type (Scilab gateway)
- deleteNamedVariable
- Double reading (Scilab gateway)
- Double writing (Scilab gateway)
- getNbInputArgument (Scilab gateway)
- getNbOutputArgument (Scilab gateway)
- Handle reading (Scilab gateway)
- Handle writing (Scilab gateway)
- Integer Precision (Scilab gateway)
- Integer reading (Scilab gateway)
- Integer writing (Scilab gateway)
- nbInputArgument (Scilab gateway)
- Pointer reading (Scilab gateway)
- Pointer writing (Scilab gateway)
- Polynomial Symbolic Variable (Scilab gateway)
- Polynomial reading (Scilab gateway)
- Polynomial writing (Scilab gateway)
- Sparse matrix reading (Scilab gateway)
- Sparse writing (Scilab gateway)
- String reading (Scilab gateway)
- String writing (Scilab gateway)
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.
deleteNamedVariable
a C gateway function uses to delete a variable from name
Syntax
int deleteNamedVariable(void* _pvCtx, const char* _pstName)
Arguments
- _pvCtx
Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h.
- _pstName
Name of the variable.
Description
a C gateway function uses to delete a variable from name
Examples
Scilab test script
fileData = ['#include ""api_scilab.h""' '#include ""MALLOC.h""' '' 'int sci_deleteNamedVariable(char *fname, void* pvApiCtx)' '{' ' SciErr sciErr;' ' int iRet = 0;' ' int* piAddr = NULL;' ' char* pstVarName = NULL;' '' ' CheckRhs(1,1);' ' CheckLhs(1,1);' '' ' sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);' ' if(sciErr.iErr)' ' {' ' printError(&sciErr, 0);' ' return 1;' ' }' '' ' if(getAllocatedSingleString(pvApiCtx, piAddr, &pstVarName))' ' {' ' //error' ' return 1;' ' }' '' ' if(isNamedVarExist(pvApiCtx, pstVarName))' ' {' ' iRet = deleteNamedVariable(pvApiCtx, pstVarName);' ' }' '' ' createScalarBoolean(pvApiCtx, Rhs + 1, iRet);' ' AssignOutputVariable(pvApiCtx, 1) = Rhs + 1;' ' return 0;' '}']; currentPath = pwd(); mkdir(TMPDIR + "/deleteNamedVariable"); cd(TMPDIR + "/deleteNamedVariable"); mputl(fileData, "deleteNamedVariable.c"); ilib_verbose(0); files = ['deleteNamedVariable.c']; ilib_build('libdeleteNamedVariable', ['deleteNamedVariable', 'sci_deleteNamedVariable'], files, []); exec loader.sce; function test() assert_checkequal(exists("a"), 1); assert_checkequal(a, 1); a = 2; assert_checkequal(a, 2); assert_checktrue(deleteNamedVariable("a")); assert_checkequal(exists("a"), 1); assert_checkequal(a, 1); endfunction a = 1; test(); assert_checkequal(a, 1); deleteNamedVariable("a"); assert_checkequal(exists("a"), 0);
Report an issue | ||
<< Matrix Type (Scilab gateway) | Low level functions | Double reading (Scilab gateway) >> |