#[#; The sample TTM program which implements simple access to a ZZZ Base. Copyright (c) 2016 ZZZ Ltd. All rights reserved. 02.08.2016 - Created. ] #[#; -- Parameters default values -- ] #[=;_host_;localhost] #[=;_port_;80] #[=;_timeout_;1000000] #[=;_base_;docbases/zzzbase] #[=;_path_divider_;/] #[=;_user_and_password_;] #[=;_class_base_;docbases/classes.zzz] #[=;_class_;/MyClass] #[=;_object_base_;docbases/objects.zzz] #[=;_object_;/MyObject] #[=;_break_writing_;] #[#; -- Change parameters default values -- ] #[=; host ;[ #[==;;{host};[ ##[_host_] ];[ #[.=;_host_;{host}] ]] ]] #[=.; host ;{host}] #[=; port ;[ #[==;;{port};[ ##[_port_] ];[ #[.=;_port_;{port}] ]] ]] #[=.; port ;{port}] #[=; timeout ;[ #[==;;{timeout};[ ##[_timeout_] ];[ #[.=;_timeout_;{timeout}] ]] ]] #[=.; timeout ;{timeout}] #[=; base ;[ #[==;;{base};[ ##[_base_] ];[ #[.=;_base_;{base}] ]] ]] #[=.; base ;{base}] #[=; path divider ;[ #[==;;{divider};[ ##[_path_divider_] ];[ #[.=;_path_divider_;{divider}] ]] ]] #[=.; path divider ;{divider}] #[=; user and password ;[ #[==;;{user};[ ##[_user_and_password_] ];[ #[.=;_user_and_password_;[;{user};{password}]] ]] ]] #[=.; user and password ;{user};{password}] #[=; class base ;[ #[==;;{class base};[ ##[_class_base_] ];[ #[.=;_class_base_;{class base}] ]] ]] #[=.; class base ;{class base}] #[=; class ;[ #[==;;{class};[ ##[_class_] ];[ #[.=;_class_;{class}] ]] ]] #[=.; class ;{class}] #[=; object base ;[ #[==;;{object base};[ ##[_object_base_] ];[ #[.=;_object_base_;{object base}] ]] ]] #[=.; object base ;{object base}] #[=; object ;[ #[==;;{object};[ ##[_object_] ];[ #[.=;_object_;{object}] ]] ]] #[=.; object ;{object}] #[=; break writing ;[ #[==;;{break writing};[ #[.=;_break_writing_;true] ];[ #[.=;_break_writing_;{break writing}] ]] ]] #[=.; break writing ;{break writing}] #[#; -- Commands -- ] #[=; execute remotely ;[ #[~+;##[_host_];##[_port_]] ##[~>;##[_host_];##[_port_];##[_timeout_];[{program}]] #[~-;##[_host_];##[_port_]] ]] #[=.; execute remotely ;{program}] #[=; open the base for writing ;[ #[.+] #[~~+;##[_base_]] #[.=;_processId_;#[~~v;##[_base_];##[_timeout_]#[_user_and_password_]]] ]] #[=; open the base for writing? ;[ #[.+] #[~~+;##[_base_]] #[.=;_processId_;#[~~v;##[_base_];##[_timeout_]#[_user_and_password_]]] #[>=n;##[_processId_];0;;[ #[~~-;##[_base_]] ]] ##[_processId_] ]] #[=; open the base for writing. ;[ #[.+] #[~~+;##[_base_]] #[.=;_processId_;#[~~v;##[_base_];##[_timeout_]#[_user_and_password_]]] #[>=n;##[_processId_];0;[ {commands} #[ close the base ] ];[ #[~~-;##[_base_]] {else commands} #[.-] ]] ]] #[=.; open the base for writing. ;{commands};{else commands}] #[=; remove the base. ;[ #[.+] #[~~+;##[_base_]] #[.=;_processId_;#[~~v;##[_base_];##[_timeout_]#[_user_and_password_]]] #[==;;##[~~x;##[_base_];##[_processId_];{error}];[ {commands} ];[ {else commands} ]] #[.-] ]] #[=.; remove the base. ;{commands};{else commands}] #[=; open the base for reading ;[ #[.+] #[~~+;##[_base_]] #[.=;_processId_;#[~~^;##[_base_]#[_user_and_password_]]] ]] #[=; open the base for reading? ;[ #[.+] #[~~+;##[_base_]] #[.=;_processId_;#[~~^;##[_base_]#[_user_and_password_]]] #[>=n;##[_processId_];0;;[ #[~~-;##[_base_]] ]] ##[_processId_] ]] #[=; open the base for reading. ;[ #[.+] #[~~+;##[_base_]] #[.=;_processId_;#[~~^;##[_base_]#[_user_and_password_]]] #[>=n;##[_processId_];0;[ {commands} #[ close the base ] ];[ #[~~-;##[_base_]] {else commands} #[.-] ]] ]] #[=.; open the base for reading. ;{commands};{else commands}] #[=; close the base ;[ #[==;true;##[_break_writing_];[ ##[~~vx;##[_base_]] ];[ #[~~.;##[_base_];##[_processId_]] ]] #[~~-;##[_base_]] #[.-] ]] #[=; add ;[ #[==;true;#[~~+.;##[_base_];##[_processId_];[{element}]];;] ]] #[=.; add ;{element}] #[=; add? ;[ #[~~+.;##[_base_];##[_processId_];[{element}]] ]] #[=.; add? ;{element}] #[=; add. ;[ #[==;true;#[~~+.;##[_base_];##[_processId_];[{element}]];[{commands}];[{else commands}]] ]] #[=.; add. ;{element};{commands};{else commands}] #[=; change ;[ #[==;true;#[~~/.;##[_base_];##[_processId_];[{element}]];;] ]] #[=.; change ;{element}] #[=; change? ;[ #[~~/.;##[_base_];##[_processId_];[{element}]] ]] #[=.; change? ;{element}] #[=; change. ;[ #[==;true;#[~~/.;##[_base_];##[_processId_];[{element}]];[{commands}];[{else commands}]] ]] #[=.; change. ;{element};{commands};{else commands}] #[=; undo changes ;[ #[~~vx;##[_base_]] ]] #[=; get ;[ ##[~~^.;##[_base_];##[_processId_]] ]] #[=; run ;[ #[~~^.;##[_base_];##[_processId_]] ]] #[=; elements count ;[ #[~~^n;##[_base_];##[_processId_]] ]] #[=; base elements count ;[ #[~~^N;##[_base_];##[_processId_]] ]] #[=; length ;[ ##[~~(.);##[_base_];##[_processId_]] ]] #[=; move to ;[ #[==;true;##[~~>.;##[_base_];##[_processId_];[{element}]];;] ]] #[=.; move to ;{element}] #[=; move to? ;[ ##[~~>.;##[_base_];##[_processId_];[{element}]] ]] #[=.; move to? ;{element}] #[=; move to. ;[ #[==;true;##[~~>.;##[_base_];##[_processId_];[{element}]];[ {commands} ];[ {else commands} ]] ]] #[=.; move to. ;{element};{commands};{else commands}] #[=; first ;[ #[==;true;##[~~>(.;##[_base_];##[_processId_]];;] ]] #[=; first? ;[ ##[~~>(.;##[_base_];##[_processId_]] ]] #[=; first. ;[ #[==;true;##[~~>(.;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; first. ;{commands};{else commands}] #[=; last ;[ #[==;true;##[~~>).;##[_base_];##[_processId_]];;] ]] #[=; last? ;[ ##[~~>).;##[_base_];##[_processId_]] ]] #[=; last. ;[ #[==;true;##[~~>).;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; last. ;{commands};{else commands}] #[=; next ;[ #[==;true;##[~~>+.;##[_base_];##[_processId_]];;] ]] #[=; next? ;[ ##[~~>+.;##[_base_];##[_processId_]] ]] #[=; next. ;[ #[==;true;##[~~>+.;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; next. ;{commands};{else commands}] #[=; previous ;[ #[==;true;##[~~>-.;##[_base_];##[_processId_]];;] ]] #[=; previous? ;[ ##[~~>-.;##[_base_];##[_processId_]] ]] #[=; previous. ;[ #[==;true;##[~~>-.;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; previous. ;{commands};{else commands}] #[=; closest ;[ #[==;;##[~~>?;##[_base_];##[_processId_];[{element}]];;] ]] #[=.; closest ;{element}] #[=; closest? ;[ ##[~~>?;##[_base_];##[_processId_];[{element}]] ]] #[=.; closest? ;{element}] #[=; closest. ;[ #[==;-3;##[~~>?;##[_base_];##[_processId_];[{element}]];[ {else commands} ];[ {commands} ]] ]] #[=.; closest. ;{element};{commands};{else commands}] #[=; closest.. ;[ #[.+] #[.=;result;##[~~>?;##[_base_];##[_processId_];[{element}]]] #[==;0;##[result];[{0}];] #[==;-1;##[result];[{-1}];] #[==;1;##[result];[{1}];] #[==;-2;##[result];[{-2}];] #[==;2;##[result];[{2}];] #[==;-3;##[result];[{-3}];] #[.-] ]] #[=.; closest.. ;{element};{0};{-1};{1};{-2};{2};{-3}] #[=; closest next ;[ #[==;true;##[~~>(?;##[_base_];##[_processId_];[{element}]];;] ]] #[=.; closest next ;{element}] #[=; closest next? ;[ ##[~~>(?;##[_base_];##[_processId_];[{element}]] ]] #[=.; closest next? ;{element}] #[=; closest next. ;[ #[==;true;##[~~>(?;##[_base_];##[_processId_];[{element}]];[ {commands} ];[ {else commands} ]] ]] #[=.; closest next. ;{element};{commands};{else commands}] #[=; closest previous ;[ #[==;true;##[~~>)?;##[_base_];##[_processId_];[{element}]];;] ]] #[=.; closest previous ;{element}] #[=; closest previous? ;[ ##[~~>)?;##[_base_];##[_processId_];[{element}]] ]] #[=.; closest previous? ;{element}] #[=; closest previous. ;[ #[==;true;##[~~>)?;##[_base_];##[_processId_];[{element}]];[ {commands} ];[ {else commands} ]] ]] #[=.; closest previous. ;{element};{commands};{else commands}] #[=; check for ;[ ##[~~?.;##[_base_];##[_processId_];[{element}]] ]] #[=.; check for ;{element}] #[=; check for. ;[ #[==;true;##[~~?.;##[_base_];##[_processId_];[{element}]];[ {commands} ];[ {else commands} ]] ]] #[=.; check for. ;{element};{commands};{else commands}] #[#; -- Paths in a base --] #[=; get the base path ;[ ##[~~*...;##[_base_];##[_processId_];true] ]] #[=; move to the base path ;[ #[==;true;##[~~>...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]];;] ]] #[=.; move to the base path ;{path};{local}] #[=; move to the base path? ;[ ##[~~>...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]] ]] #[=.; move to the base path? ;{path};{local}] #[=; move to the base path. ;[ #[==;true;##[~~>...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]];[ {commands} ];[ {else commands} ]] ]] #[=.; move to the base path. ;{path};{commands};{else commands};{local}] #[=; get from the base path ;[ ##[~~^...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]] ]] #[=.; get from the base path ;{path};{local}] #[=; add the base path ;[ #[==;true;##[~~+...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]];;] ]] #[=.; add the base path ;{path};{local}] #[=; add the base path? ;[ ##[~~+...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]] ]] #[=.; add the base path? ;{path};{local}] #[=; add the base path. ;[ #[==;true;##[~~+...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]];[ {commands} ];[ {else commands} ]] ]] #[=.; add the base path. ;{path};{commands};{else commands};{local}] #[=; check the base path ;[ ##[~~?...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]] ]] #[=.; check the base path ;{path};{local}] #[=; check the base path. ;[ #[==;true;##[~~?...;##[_base_];##[_processId_];{path};#[==;local;{local};[false];[true]]];[ {commands} ];[ {else commands} ]] ]] #[=.; check the base path. ;{path};{commands};{else commands};{local}] #[=; move the base path ;[ ##[~~>./.;##[_base_];##[_processId_];{from a path};{to a path}] ]] #[=.; move the base path ;{from a path};{to a path}] #[#; -- Divider paths --] #[=; get the path ;[ ##[~~...///;##[_path_divider_];##[~~*...;##[_base_];##[_processId_];true]] ]] #[=; move to the path ;[ #[==;true;##[~~>...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]];;] ]] #[=.; move to the path ;{path};{local}] #[=; move to the path? ;[ ##[~~>...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]] ]] #[=.; move to the path? ;{path};{local}] #[=; move to the path. ;[ #[==;true;##[~~>...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]];[ {commands} ];[ {else commands} ]] ]] #[=.; move to the path. ;{path};{commands};{else commands};{local}] #[=; get from the path ;[ ##[~~^...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]] ]] #[=.; get from the path ;{path};{local}] #[=; run from the path ;[ #[~~^...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]] ]] #[=.; run from the path ;{path};{local}] #[=; add the path ;[ #[==;true;##[~~+...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]];;] ]] #[=.; add the path ;{path};{local}] #[=; add the path? ;[ ##[~~+...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]] ]] #[=.; add the path? ;{path};{local}] #[=; add the path. ;[ #[==;true;##[~~+...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]];[ {commands} ];[ {else commands} ]] ]] #[=.; add the path. ;{path};{commands};{else commands};{local}] #[=; check the path ;[ ##[~~?...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]] ]] #[=.; check the path ;{path};{local}] #[=; check the path. ;[ #[==;true;##[~~?...;##[_base_];##[_processId_];##[~~///...;{path};##[_path_divider_]];#[==;local;{local};[false];[true]]];[ {commands} ];[ {else commands} ]] ]] #[=.; check the path. ;{path};{commands};{else commands};{local}] #[=; move the path ;[ ##[~~>./.;##[_base_];##[_processId_]; ##[~~///...;{from a path};##[_path_divider_]]; ##[~~///...;{to a path};##[_path_divider_]] ] ]] #[=.; move the path ;{from a path};{to a path}] #[=; previous symbol ;[ #[==;true;##[~~>-@;##[_base_];##[_processId_]];;] ]] #[=; previous symbol? ;[ ##[~~>-@;##[_base_];##[_processId_]] ]] #[=; previous symbol. ;[ #[==;true;##[~~>-@;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; previous symbol. ;{commands};{else commands}] #[=; next symbol ;[ #[==;true;##[~~>+@;##[_base_];##[_processId_]];;] ]] #[=; next symbol? ;[ ##[~~>+@;##[_base_];##[_processId_]] ]] #[=; next symbol. ;[ #[==;true;##[~~>+@;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; next symbol. ;{commands};{else commands}] #[=; up symbol ;[ #[==;true;##[~~>^@;##[_base_];##[_processId_]];;] ]] #[=; up symbol? ;[ ##[~~>^@;##[_base_];##[_processId_]] ]] #[=; up symbol. ;[ #[==;true;##[~~>^@;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; up symbol. ;{commands};{else commands}] #[=; down symbol ;[ #[==;true;##[~~>v@;##[_base_];##[_processId_]];;] ]] #[=; down symbol? ;[ ##[~~>v@;##[_base_];##[_processId_]] ]] #[=; down symbol. ;[ #[==;true;##[~~>v@;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; down symbol. ;{commands};{else commands}] #[=; lock for write ;[ ##[~~#v;##[_base_];##[_processId_]] ]] #[=; unlock for write ;[ ##[~~#v;##[_base_];##[_processId_]] ]] #[=; lock for read ;[ ##[~~#^;##[_base_];##[_processId_]] ]] #[=; unlock for read ;[ ##[~~#^;##[_base_];##[_processId_]] ]] #[=; subset ;[ #[==;true;#[~~>v;##[_base_];##[_processId_]];;] ]] #[=; subset? ;[ #[~~>v;##[_base_];##[_processId_]] ]] #[=; subset. ;[ #[==;true;#[~~>v;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; subset. ;{commands};{else commands}] #[=; superset ;[ #[==;true;#[~~>^;##[_base_];##[_processId_]];;] ]] #[=; superset? ;[ #[~~>^;##[_base_];##[_processId_]] ]] #[=; superset. ;[ #[==;true;#[~~>^;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; superset. ;{commands};{else commands}] #[=; remove ;[ #[==;true;#[~~x.;##[_base_];##[_processId_]];;] ]] #[=; remove? ;[ #[~~x.;##[_base_];##[_processId_]] ]] #[=; remove. ;[ #[==;true;#[~~x.;##[_base_];##[_processId_]];[ {commands} ];[ {else commands} ]] ]] #[=.; remove. ;{commands};{else commands}] #[=; remove the base ;[ #[ remove the base. ] #[#;[ #[ superset ] #[ remove ] #[ add ;ZZZ] #[ subset ] #]] ]] #[=; get the base as a simple text ;[ #[out; #[ZZZ2SimpleTXTFromDividerPath;##[_base_];;/] ] ]] #[=; get the base as a simple text. ;[ #[ZZZ2SimpleTXTFromDividerPath;##[_base_];;/] ]] #[=; add the user ;[ ##[~~u+;##[_base_];##[_processId_];[{name}];[{password}];[{role}]] ]] #[=.; add the user ;{name};{password};{role}] #[=; change the user ;[ ##[~~u/;##[_base_];##[_processId_];[{name}];[{password}];[{new name}];[{new password}]] ]] #[=.; change the user ;{name};{password};{new name};{new password}] #[=; remove the user ;[ ##[~~u-;##[_base_];##[_processId_];[{name}];[{password}];[{role}]] ]] #[=.; remove the user ;{name};{password};{role}] #[=; tab ;[ ##[chr;9] ]] #[=; new line ;[ ##[chr;10] ]] #[=;.^-;[ #[-;#[.^];#[==;;{levels};[1];[{levels}]];0] ]] #[=.;.^-;{levels}]