Search notes:

vim script: get

" ..\run_ get

redir > get.out

let s:abc = ['foo', 'bar', 'baz']

for i in range (0, 3)
  echo i . ': ' . get(s:abc, i)
endfor
" 0: foo
" 1: bar
" 2: baz
" 3: 0

echo ' '
echo "With default argument"
echo ' '

for i in range (0, 3)
  echo i . ': ' . get(s:abc, i, 'def')
endfor
" 0: foo
" 1: bar
" 2: baz
" 3: def


" get to access values of variables whose name is
" stored in another variable

let g:SomeVar    = 'One'
let g:AnotherVar = 'Two'

let s:VarName = 'SomeVar'
echo get(g:, s:VarName)
" One

let s:VarName = 'AnotherVar'
echo get(g:, s:VarName)
" Two

redir END
q
Github repository about-vim, path: /vimscript/functions/get.vim

See also

Vim: built in functions
VIM script

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:51 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(51): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(67): id_of(Object(PDO), 'ua', 'rssamplifier.co...') #2 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1788232118, '152.55.176.99', 'rssamplifier.co...', NULL) #3 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/vim/script/vimscript/functions/get(83): insert_webrequest() #4 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 51