- Ajuda Scilab
- Scilab
- Scilab palavra-chave
- abort
- add_demo
- argn
- banner
- boolean
- break
- clear
- clearfun
- clearglobal
- comp
- continue
- debug
- delbpt
- dispbpt
- edit
- errcatch
- errclear
- error
- error_table
- exists
- exit
- external
- extraction
- format
- funcprot
- funptr
- getdebuginfo
- getmd5
- getmemory
- getmodules
- getos
- getscilabmode
- getshell
- getvariablesonstack
- getversion
- gstacksize
- ieee
- insertion
- intppty
- inv_coeff
- iserror
- isglobal
- lasterror
- macr2lst
- macr2tree
- matrices
- matrix
- mode
- mtlb_mode
- names
- newfun
- null
- pause
- perl
- poly
- predef
- quit
- rational
- readgateway
- resume
- sciargs
- scilab
- setbpt
- stacksize
- startup
- symbols
- testmatrix
- type
- typename
- user
- varn
- ver
- warning
- what
- where
- whereami
- who
- who_user
- whos
- with_atlas
- with_javasci
- with_macros_source
- with_module
- with_pvm
- with_texmacs
- with_tk
- TMPDIR
exists
verifica existência de variáveis
Seqüência de Chamamento
exists(name [,where])
Parâmetros
- name
string
- where
um caractere opcional com possíveis valores:
'l'(local),'n'(nolocal) and'a'(all). O valor padrão é'all'.
Descrição
exists(name) retorna 1 se a
variável chamada name existe e 0, em
caso contrário.
Aviso: uma função que utiliza exists pode
retornar um resultado que depende do ambiente!
exists(name,'local') retorna 1
se a variável chamada name existe no ambiente local da
função corrente e 0 , em caso contrário.
exists(name,'nolocal') retorna
1 se a variável chamada name existe
em qualquer nível do ambiente de chamamento (incluindo o nível principal
do shell do Scilab) da função corrente e 0 , em caso
contrário.
Aviso: a função exists não verifica se a variável existe no espaço de nomes global.
Exemplos
deff('foo(x)',.. ['disp([exists(''a12''),exists(''a12'',''local'')])' 'disp([exists(''x''),exists(''x'',''local'')])']) foo(1) a12=[];foo(1) function level1() function level2() disp(exists("a","all")); disp(exists("a","local")); disp(exists("a","nolocal")); endfunction level2() endfunction function go() a=1; level1() endfunction go()
| << error_table | Scilab | exit >> |