Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.1 - Português

Change language to:
English - Français - 日本語 -

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.

Ajuda Scilab >> API Scilab > Scilab Gateway API > CreateVar

CreateVar

a C gateway function which allows to create a new Scilab parameter

Calling Sequence

CreateVar(StackPos, Type, &m_rows, &n_cols, &l_stack_pos);

Arguments

StackPos

The rank of the parameter to be created (input argument)

Type

The Scilab C Type of the parameter to be created (input argument).

  • STRING_DATATYPE "c"

  • MATRIX_OF_STRING_DATATYPE "S"

  • MATRIX_OF_DOUBLE_DATATYPE "d"

  • MATRIX_OF_RATIONAL_DATATYPE "r"

  • MATRIX_OF_VARIABLE_SIZE_INTEGER_DATATYPE "I"

  • MATRIX_OF_INTEGER_DATATYPE "i"

  • MATRIX_OF_BOOLEAN_DATATYPE "b"

  • MATRIX_OF_COMPLEX_DATATYPE "z"

  • SPARSE_MATRIX_DATATYPE "s"

  • TYPED_LIST_DATATYPE "t"

  • MATRIX_ORIENTED_TYPED_LIST_DATATYPE "m"

  • SCILAB_POINTER_DATATYPE "p"

  • GRAPHICAL_HANDLE_DATATYPE "h"

  • EXTERNAL_DATATYPE "f"

  • MATRIX_OF_POLYNOMIAL_DATATYPE "x"

m_rows

the number of lines of the matrix to be created (input argument)

n_cols

the number of columns of the matrix to be created (input argument)

l_stack_pos

the position in the Scilab memory of the created parameter (output argument)

Description

A C gateway function which allows to create a new Scilab parameter

WARNING: This API is deprecated from Scilab 5.2.0 and is going to be removed with Scilab 6.0. Please use API Scilab (the new Scilab API).

Examples

#include <stack-c.h>

int sci_myones(char * fname)
{
  int m_row, n_col, l_pos;
  
  m_row = 1; n_col = 1; // We create a scalar
  CreateVar(1, MATRIX_OF_INTEGER_DATATYPE, &m_row, &n_col, &l_pos);

  *istk(l_pos) = 1;

  LhsVar(1) = 1;

  return 0;
}

See Also

  • Scilab C Type — the C types available in a C gateway
  • istk — Return a pointer to an integer to access data stored at a given position in the Scilab memory
  • LhsVar — a C gateway function which specifies which parameters created inside the C gateway will be returned as an output argument into Scilab.
<< CreateListVarFromPtr Scilab Gateway API FindOpt >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Mar 03 11:00:37 CET 2011