Synchronet v3.17b-Win32 (install) has been released (Jan-2019).

New Synchronet YouTube channel

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
custom:javascript [2019/02/21 03:50]
digital man [Output] Clarify that only console.putmsg() will expand extra attribute (e.g. Wildcat, PCBoard, Renegade) codes
custom:javascript [2019/05/06 02:05] (current)
digital man [See Also]
Line 120: Line 120:
 There are many different text output methods supported by the Synchronet JavaScript Object Model and knowing which method (function) to use in what situation can be confusing. The following table should help: There are many different text output methods supported by the Synchronet JavaScript Object Model and knowing which method (function) to use in what situation can be confusing. The following table should help:
  
-^ Method ​         ^ BBS((Terminal Server)) ^ JSexec ^ Prints newline ​^ Expands/​Decodes ​   ^ Multiple Values((as function arguments)) ^ Notes ^ +^ Method ​         ^ BBS((Terminal Server)) ^ JSexec ^ Newline ^ Xlat ((Character set translation)) ​^ Expands/​Decodes ​   ^ Multiple Values((as function arguments)) ^ Notes ^ 
-| ''​write()'' ​    | Yes                    | Yes    | No           | Telnet-IAC, [[custom:​ctrl-a_codes|Ctrl-A]] | Yes                | If user not online, same as ''​log(LOG_INFO,​ ...)''​ | +| ''​write()'' ​    | Yes                    | Yes    | No           | Yes | Telnet-IAC, [[custom:​ctrl-a_codes|Ctrl-A]] | Yes                | If user not online, same as ''​log(LOG_INFO,​ ...)''​ | 
-| ''​write_raw()''​ | Yes                    | No     | No           | Telnet-IAC ​        | Yes                | Value may contain NULs, no charset translation | +| ''​write_raw()''​ | Yes                    | No     | No           | No  ​| Telnet-IAC ​        | Yes                | Value may contain NULs, no charset translation | 
-| ''​writeln()'' ​  | Yes                    | Yes    | Yes          | Telnet-IAC, Ctrl-A | Yes                | aka ''​print()''​ | +| ''​writeln()'' ​  | Yes                    | Yes    | Yes          ​| Yes | Telnet-IAC, Ctrl-A | Yes                | aka ''​print()''​ | 
-| ''​printf()'' ​   | Yes                    | Yes    | No           | Telnet-IAC, Ctrl-A | Yes((using C printf format syntax)) ​ | ala C ''​printf()'' ​ | +| ''​printf()'' ​   | Yes                    | Yes    | No           | Yes | Telnet-IAC, Ctrl-A | Yes((using C printf format syntax)) ​ | ala C ''​printf()'' ​ | 
-| ''​alert()'' ​    | Yes                    | Yes    | Yes          | Telnet-IAC, Ctrl-A | No                 | If user not online, same as ''​log(LOG_WARNING,​ ...)''​ | +| ''​alert()'' ​    | Yes                    | Yes    | Yes          ​| Yes | Telnet-IAC, Ctrl-A | No                 | If user not online, same as ''​log(LOG_WARNING,​ ...)''​ | 
-| ''​log()'' ​            | Yes              | Yes    | N/A          |                    | Yes((following the log-level argument)) | Displayed/​logged on the server only | +| ''​log()'' ​            | Yes              | Yes    | N/A          ​| N/A |                    | Yes((following the log-level argument)) | Displayed/​logged on the server only | 
-| ''​console.print()'' ​  | Yes              | No     | No           | Telnet-IAC, Ctrl-A | Yes | | +| ''​console.print()'' ​  | Yes              | No     | No           | Yes | Telnet-IAC, Ctrl-A | Yes | | 
-| ''​console.write()'' ​  | Yes              | No     | No           | Telnet-IAC ​        | Yes | | +| ''​console.write()'' ​  | Yes              | No     | No           | PETSCII only | Telnet-IAC ​        | Yes | No line-counting/​auto-pause ​
-| ''​console.writeln()''​ | Yes              | No     | Yes          | Telnet-IAC ​        | Yes | | +| ''​console.writeln()''​ | Yes              | No     | Yes          ​| PETSCII only | Telnet-IAC ​        | Yes | No line-counting/​auto-pause ​
-| ''​console.putmsg()'' ​ | Yes              | No     | No           | Telnet-IAC, Ctrl-A, [[custom:​atcodes|@-Codes]],​ [[custom:​colors|Extra Attributes]] | No        | Typically used for displaying text/menu files | +| ''​console.putmsg()'' ​ | Yes              | No     | No           | Yes | Telnet-IAC, Ctrl-A, [[custom:​atcodes|@-Codes]],​ [[custom:​colors|Extra Attributes]] | No        | Typically used for displaying text/menu files | 
-| ''​console.center()'' ​ | Yes              | No     | Yes          | Telnet-IAC, Ctrl-A | No | Text centered on screen | +| ''​console.center()'' ​ | Yes              | No     | Yes          ​| Yes | Telnet-IAC, Ctrl-A | No | Text centered on screen | 
-| ''​console.mnemonics()''​ | Yes            | No     | No           | Telnet-IAC, Ctrl-A, @-Codes, ~ | No | Hotkey highlights | +| ''​console.mnemonics()''​ | Yes            | No     | No           | Yes | Telnet-IAC, Ctrl-A, @-Codes, ~ | No | Hotkey highlights | 
-| ''​console.putbyte()''​ | Yes              | No     | No           | Telnet-IAC ​        | No | No charset translation | +| ''​console.putbyte()''​ | Yes              | No     | No           | No  ​| Telnet-IAC ​        | No | No charset translation | 
-| ''​client.socket.send()''​ | Yes           | No     | No           ​| ​                   | No | Avoid using |+| ''​client.socket.send()''​ | Yes           | No     | No           | No  ​|                    | No | Avoid using |
  
 +
 +=== Carriage Returns ===
 +If you wish to send a traditional "​carriage return"​ character to the client terminal (i.e. move the cursor to the far left column without advancing to the next line) it is recommended that you use an output method/​function that supports [[custom:​Ctrl-A codes]] and you send the Ctrl-A ''​['' ​ sequences //instead of// an ASCII 13 (''​\r''​) character. This is required for PETSCII terminal compatibility,​ where an ASCII 13 character performs a complete "​newline"​ sequence (the equivalent of ''​\r\n''​) on the client terminal.
 ===== See Also ===== ===== See Also =====
   * [[http://​synchro.net/​docs/​jsobjs.html|Synchronet JavaScript Object Model]]   * [[http://​synchro.net/​docs/​jsobjs.html|Synchronet JavaScript Object Model]]
Line 144: Line 147:
   * [[:​custom:​index|Customization]]   * [[:​custom:​index|Customization]]
  
-{{tag>​javascript}}+{{tag>​javascript ​petscii}}
  

In Other Languages