function

deletectx . context . sncode

VERSIONlatest Delete an entry in a context.

DELETECTX

NAME

deletectx - Deletes an entry in a context.

SYNOPSIS

deletectx (variable, key…); deletectx (ctx:variable, key:key);

DESCRIPTION

This function is used to delete an entry in a context based on a key.

PARAMETERS

ctx
Specifies the context
key
Specifies the key

RETURN

Nothing.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{ a = {x:1,y:2,z:3,w:[4,5]}; deletectx(a,'w'); a; }}. return res={"x":1,"y":2,"z":3}.
res={_{ a = {x:1,y:2,z:3,w:[4,5]}; a.u; }}. return res=undefined.
res={_{ a = {x:1,y:2,z:3,w:[4,5]}; deletectx(a,'w', 'x'); a; }}. return res={"y":2,"z":3}.
res={_{ a = {x:1,y:2,z:3,w:[4,5]}; deletectx(ctx:a,'w', key:'x'); a; }}. return res={"y":2,"z":3}.
res={_{ a = 1; deletectx(ctx:a,'w', key:'x'); a; }}. return .*is not a context.*

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>