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

30
LINES

< > BotCompany Repo | #1000945 // Test auto-reportToChat on every print - hopefully no recursion?

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2229L/17K/53K).

1  
!747
2  
3  
m {
4  
  !include #1000947 // LineBuf
5  
  
6  
  p {
7  
    Class javax = getJavaX();
8  
    print("JavaX: " + javax);
9  
    
10  
    set(javax, "customSystemOut", new Appendable() {
11  
      new LineBuf buf;
12  
      
13  
      // only using this one
14  
      public Appendable append(CharSequence cs) {
15  
        buf.append(cs.toString());
16  
        while (true) {
17  
          S s = buf.nextLine();
18  
          if (s == null) break;
19  
          reportToChat(s, true);
20  
        }
21  
        return this;
22  
      }
23  
24  
      public Appendable append(char c) { return this; }
25  
      public Appendable append(CharSequence s, int start, int end) { return this; }
26  
    });
27  
    
28  
    print("Hallöchen");
29  
  }
30  
}

Author comment

Began life as a copy of #1000944

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1000945
Snippet name: Test auto-reportToChat on every print - hopefully no recursion?
Eternal ID of this version: #1000945/1
Text MD5: feb4dbe974d930b75f67284fd6a2102b
Transpilation MD5: 46c96822a774b856585ecad95cea4a22
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-11 17:15:42
Source code size: 684 bytes / 30 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 592 / 639
Referenced in: [show references]