Subj : mode parameter in console.strlen()
To   : Nightfox
From : Digital Man
Date : Thu Jun 23 2022 10:44 am

 Re: mode parameter in console.strlen()
 By: Nightfox to Digital Man on Thu Jun 23 2022 09:21 am

> Hi DM,
>
> I'm curious what the mode parameter is for in console.strlen()?

Today, it's only use is to control whether the passed string is expected to be UTF-8 encoded or not.

> jsobjs.html
> says mode is an optional parameter, but it doesn't say what it's for.  When
> looking at the mode values in sbbsdefs.js, it seems some don't make sense
> for getting string length (such as P_NOABORT, P_NOABORT, etc.)..
> Also, P_NOATCODES might make sense, but I'd think console.strlen() already
> would not be counting at-codes as part of string length..?

It *does* count at-codes as part of the string. Passing P_NOATCODES would have no effect.

The only checked/used P_* (print) mode flag in console.strlen() is P_UTF8.
--
                                           digital man (rob)

Synchronet "Real Fact" #89:
Rob played drums on the LP "Weedpuller" available for digital purchase/stream
Norco, CA WX: 86.3�F, 39.0% humidity, 1 mph E wind, 0.00 inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net