Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2023.1.0 - English


Variable

Generates the Scilab internal code representing a variable (without its content)

Syntax

var = Variable(name, infer)

Arguments

var

variable name (character string)

infer

inference data (a tlist of type "infer", see Infer help page)

var

a "variable" tlist

Description

This function create a tlist representing a variable when using M2SCI. All input parameters values are verified to be compatible with "M2SCI tlists".

Colon is a predefined Variable containing the pseudo-code representing a colon. It can be used as is as a "ALL" index, for instance in insertion or extraction operations.

Examples

Let's defined the pseudo-code representing a variable a aimed to be a 3x5 matrix of strings:

s.a_code = Variable("a", Infer(list(1,1),Type(String,Unknown)))
--> s.a_code = Variable("a", Infer(list(3,5),Type(String,Unknown)))
 s  =
  a_code: [variable] tlist with fields:
      name = "a"
      infer: [infer] tlist with fields:
          dims: list:
              (1) = 3
              (2) = 5
          type: [type] tlist with fields:
              vtype = 10
              property = -1
          contents: [contents] tlist with fields:
              index:  empty list()
              data:  empty list()

See also

  • Funcall — Create the converted pseudo-code representing a function call
  • Operation — Generates the Scilab pseudo-code representing an operation
  • Cste — Create a tree representing a constant
  • Infer — Create a tree containing inference data
  • Contents — Create a tree containing contents inference data
  • Type — Create a tree containing type inference data
  • Equal — Generates the Scilab internal code representing an instruction "LHS = RHS"

History

VersionDescription
6.1.1 Predefined variable Colon added.
Report an issue
<< Type internals get_contents_infer >>

Copyright (c) 2022-2023 (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:
Mon May 22 12:37:13 CEST 2023