Path: csiph.com!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail From: oh2aun@gmail.com (FFmike) Newsgroups: comp.lang.forth Subject: Re: Parsing =?UTF-8?B?dGltZXN0YW1wcz8=?= Date: Mon, 7 Oct 2024 05:23:16 +0000 Organization: novaBBS Message-ID: <0c8c1eb4a2b5fbd9e4451be2c6f13402@www.novabbs.com> References: <1f433fabcb4d053d16cbc098dedc6c370608ac01@i2pn2.org> <24f3b255de9d943acf76851692ec1724@www.novabbs.com> <9531b46a687bdbe61cbe032e0135571f@www.novabbs.com> <85f5d3108a627cfc39c2d496dc1ed1930977516f@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="917318"; mail-complaints-to="usenet@i2pn2.org"; posting-account="39UK9ThsGv2aH5Ju2f1a+mSLdXsn+5dak35uZnMCiTc"; User-Agent: Rocksolid Light X-Rslight-Posting-User: b798353b37e53d14ace2ed0c33020067837946c0 X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Site: $2y$10$AMp5L//4sn/Oxpifjn1s9O7DHDWh/j02V/Wm.iTi1rEeA6TWfym/6 Xref: csiph.com comp.lang.forth:132410 On Mon, 7 Oct 2024 3:58:28 +0000, dxf wrote: > That treats '12' as hours and '12:13' as hours/min when it should be > secs and min/secs respectively. I did not see that. It can be fixed by comparing source and >in. Maybe not elegant, but it works. variable cnt : (/t) ( addr len -- hrs mins secs) 1 cnt ! 3 for [char] : word number? dup 1 = if drop 'source 2+ @ >in @ <> if 1 cnt +! then else 2 = if 2drop else drop then 0 then next cnt @ for rot next ( fixup) ; : /t ( addr len -- hrs mins secs ) ['] (/t) execute-parsing ; : t. rot . swap . . ; s" 30" /t t. 0 0 30 ok<$,ram> s" 29:30" /t t. 0 29 30 ok<$,ram> s" 1:29:30" /t t. 1 29 30 ok<$,ram>