Door Games Unlimited

Welcome, Guest.


Subject: console.putmsg alternative that returns a string Date: Wed Oct 01 2014 07:44:15
From: Nightfox To: Psi-Jack

  Re: console.putmsg alternative that returns a string
  By: Psi-Jack to Nightfox on Wed Oct 01 2014 09:32:55

 Ni>> Is there an alternative to console.putmsg() that returns a string
 Ni>> instead of outputting to the console?  What I'd like to do is to
 Ni>> have @-codes, etc. interpreted in a string and save that string so I
 Ni>> can then pass that string to printf() so I can specify a field
 Ni>> length for the text.

 Ps> I believe what you're looking for is bbs.atcode():

 Ps> text = text.replace(/@([^@]+)@/g, function(m, code) {
 Ps>  return bbs.atcode(code);
 Ps> });

I saw bbs.atcode() in the docs..  I was hoping for something that handles a
whole string, similar to console.putmsg().  bbs.atcode() only interprets a
single @-code, which requires writing some more code, but I suppose that will
have to do.  Thanks.

Nightfox

---
 ■ Synchronet ■ Digital Distortion BBS - digitaldistortionbbs.com

Previous Message       Next Message
In Reply To: console.putmsg alternative that returns a string (Psi-Jack)
Replies: console.putmsg alternative that returns a string (Psi-Jack)