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

16
LINES

< > BotCompany Repo | #1009003 // ctxCallFunction

JavaX fragment (include)

static S ctxCallFunction(S fname, L<S> args) {
  print("Call function: " + fname);
  if (eqic(fname, "tolowercase"))
    ret toLower(first(args));
  if (eqic(fname, "length"))
    ret lstr(first(args));
  if (eqic(fname, "firstupper"))
    ret firstToUpper(first(args));
  if (eqic(fname, "time")) {
    Calendar c = germanCalendar();
    int s = seconds(c);
    ret hours(c) + " Uhr " + minutes(c) + " und "
      + (s == 1 ? "1 Sekunde" : s + " Sekunden");
  }
  throw todo("ctx function " + fname);
}

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: #1009003
Snippet name: ctxCallFunction
Eternal ID of this version: #1009003/5
Text MD5: e85547b1683c21c8ce42c6ee541342d5
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-01 19:06:10
Source code size: 518 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 424 / 469
Version history: 4 change(s)
Referenced in: [show references]