Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1008982 // ctxGetVar

JavaX fragment (include)

static S ctxGetVar(S name) {
  S value = null;
  if (eq(name, "questioncount"))
    value = str(ctxContext().conversationLength);
  if (value == null)
    value = ctxContext().vars.get(name);
  if (value == null)
    value = ctxContext().globals.get(name);
  if (value == null && name.startsWith("MATCH") && isInteger(name.substring(5)))
    value = get(ctxContext().matches, parseInt(name.substring(5))-1);
  print("ctxGetVar " + name + " = " + sfu(value));
  ret value;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1008982
Snippet name: ctxGetVar
Eternal ID of this version: #1008982/10
Text MD5: 94f245093945ba60436b47cb3cc920bc
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-04 18:17:04
Source code size: 485 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 557 / 580
Version history: 9 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)