Liste des Groupes | Revenir à cl forth |
dxf <dxforth@gmail.com> wrote:The HH:MM:SS format is easy but how to deal with the variants shown above?
They occur in the real world.
Toad code:
fload job
: xx. 0 <# bl hold # # #> type ;
: tab3. tab rot xx. swap xx. xx. ;
-- &num ( g -- s )
-- Convert g-string to numeric string address
: &num drop 1- ;
-- Note g-string is ANS string ( addr u )
-- ts_elms ( "[hh:][mm:]ss<bl>" -- 0 0 ss | 0 mm ss | hh mm ss )
-- Parse timestamp elements: hh=hours mm=minutes ss=seconds
-- Input hh: element and hh:mm: combination elements may be left out
-- if zero(s).
: ts_elms
bl word here count
o+s do i c@ asc : = if bl i c! then loop
0 0 0 here count
begin
bl split dup 0> while &num number drop
5 roll drop -rot
repeat 4drop
;
...
Les messages affichés proviennent d'usenet.