Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

An intellectual is someone whose mind watches itself. -- Albert Camus


dovenet / Synchronet Javascript / mode parameter in console.strlen()

SubjectAuthor
* mode parameter in console.strlen()Nightfox
`* mode parameter in console.strlen()Digital Man
 `- mode parameter in console.strlen()Nightfox

1
mode parameter in console.strlen()

<62B49323.3668.dove_sync_js@digitaldistortionbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=803&group=DOVE-Net.Synchronet_Javascript#803

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: nightfox@VERT/DIGDIST (Nightfox)
To: Digital Man
Subject: mode parameter in console.strlen()
Message-ID: <62B49323.3668.dove_sync_js@digitaldistortionbbs.com>
Date: Thu, 23 Jun 2022 02:21:55 -0700
X-Comment-To: Digital Man
Path: rocksolidbbs.com!not-for-mail
Organization: Digital Distortion
Newsgroups: DOVE-Net.Synchronet_Javascript
X-FTN-PID: Synchronet 3.19c-Linux master/402f4377f Jun 1 2022 GCC 9.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20220623093357-0700 c1e0
WhenExported: 20220623151850-0700 c1e0
ExportedFrom: VERT sync-js 3735
WhenImported: 20220623092155-0700 c1e0
WhenExported: 20220623093360-0700 c1e0
ExportedFrom: DIGDIST dove_sync_js 3668
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Nightfox - Thu, 23 Jun 2022 09:21 UTC

Hi DM,

I'm curious what the mode parameter is for in console.strlen()? 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..?

Nightfox

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

mode parameter in console.strlen()

<62B4A66B.3736.sync-js@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=804&group=DOVE-Net.Synchronet_Javascript#804

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: digital.man@VERT (Digital Man)
To: Nightfox
Subject: mode parameter in console.strlen()
Message-ID: <62B4A66B.3736.sync-js@vert.synchro.net>
Date: Thu, 23 Jun 2022 03:44:11 -0700
X-Comment-To: Nightfox
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <62B49323.3668.dove_sync_js@digitaldistortionbbs.com>
References: <62B49323.3668.dove_sync_js@digitaldistortionbbs.com>
X-FTN-PID: Synchronet 3.19c-Linux master/dde8c68d0 Jun 14 2022 GCC 8.3.0
X-FTN-CHRS: CP437 2
WhenImported: 20220623104411-0700 c1e0
WhenExported: 20220623151850-0700 c1e0
ExportedFrom: VERT sync-js 3736
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Digital Man - Thu, 23 Jun 2022 10:44 UTC

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

mode parameter in console.strlen()

<62B4B442.3670.dove_sync_js@digitaldistortionbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=805&group=DOVE-Net.Synchronet_Javascript#805

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: nightfox@VERT/DIGDIST (Nightfox)
To: Digital Man
Subject: mode parameter in console.strlen()
Message-ID: <62B4B442.3670.dove_sync_js@digitaldistortionbbs.com>
Date: Thu, 23 Jun 2022 04:43:14 -0700
X-Comment-To: Digital Man
Path: rocksolidbbs.com!not-for-mail
Organization: Digital Distortion
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <62B4A66B.3736.sync-js@vert.synchro.net>
References: <62B4A66B.3736.sync-js@vert.synchro.net>
X-FTN-PID: Synchronet 3.19c-Linux master/402f4377f Jun 1 2022 GCC 9.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20220623120403-0700 c1e0
WhenExported: 20220623151850-0700 c1e0
ExportedFrom: VERT sync-js 3737
WhenImported: 20220623114314-0700 c1e0
WhenExported: 20220623120359-0700 c1e0
ExportedFrom: DIGDIST dove_sync_js 3670
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Nightfox - Thu, 23 Jun 2022 11:43 UTC

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

>> 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..?

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

I was thinking attribute codes when I wrote that.. :P It makes sense that it would count at-codes as part of the string.

DM> The only checked/used P_* (print) mode flag in console.strlen() is P_UTF8.

I see. Thanks.

Nightfox

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


dovenet / Synchronet Javascript / mode parameter in console.strlen()

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor