Programma di esempio WC.PRT
; WC
;
; Programma per Proteus
;
; (C) 1998-2003 Simone Zanella Productions
;
; Stampa il numero di parole, linee, caratteri e caratteri non bianchi.

; Parametri impliciti: output predefinito a console
;!proteus -o

; Inizializza
FUNCTION ONSTART()

  IF STREQ(ARGV(3), "..")
    CONSOLELN "Sintassi: " ARGV(1) " " ARGV(2) " nomefile"
    CONSOLELN ""
    CONSOLELN "Scopo: conta parole e caratteri in nomefile"
    ABORT 0
  FI
  _NW = 0
  _NC = 0
RETURN


; Conta il numero di parole sulla linea
TKH = TOKNEW(L, " ")
NTK = TOKNUM(TKH)

; Aggiunge il numero di caratteri in ogni parola a NC
FOR CurTok = 1 TO NTK
  ADD(@NC, STRLEN(TOKGET(TKH, CurTok)))
NEXT

TOKFREE(TKH)

ADD(@NW, NTK)


; Stampa i totali alla fine del file
FUNCTION ONEND()

  PRINTLN "Statistiche per il file: " _F
  PRINTLN "Dimensioni: " _S
  PRINTLN "Numero di caratteri non-bianchi: " _NC " (" \
          PFORMAT("2.2f", MUL(FDIV(_NC, _S), 100)) "%)"
  PRINTLN "Numero di linee: " _N
  PRINTLN "Numero di parole: " _NW
RETURN
Indice esempi Prossimo esempio Esempio precedente Indice per argomenti Indice analitico
Midnight Lake iPhone Case Black Women Shoes Black Flat Shoes Leather Flats Black Patent Ballerinas Black Ballet Shoes Casual Shoes Black Shoes Women Balle Record Player Cufflinks Best iPhone XR Clear Cases iPhone XS/XS Max Leather Cases Sale Best iPhone 8/8 Plus Silicone Cases iPhone 7/7 Plus Cases & Screen Protector New Cases For iPhone 6/6 Plus iPhone 8 Case Sale iPhone Xr Case Online iPhone 7 Case UK Online iPhone X Case UK Sale iPhone X Case Deals iPhone Xs Case New Case For iPhone Xr UK Online Case For iPhone 8 UK Outlet Fashion Silver Cufflinks For Men Best Mens Cufflinks Outlet Online The Gold Cufflinks Shop Online Cheap Shirt Cufflinks On Sale Nice Wedding Cufflinks UK Online Top Black Cufflinks UK Online Mens Cufflinks Online Silver Cufflinks For Men Men Cufflinks UK Sale Gold Cufflinks UK Online Gold Cufflinks UK Silver Cufflinks UK Shirt Cufflinks Discount Online Mens Cufflinks Deals & Sales Girls Shoes For Dance Fashion Ballet Dance Shoes Best Ballet Flats Shoes UK Online Cheap Ballet Pointe Shoes UK Online Best Ballet Shoes Outlet Best Dance Shoes Sale Cheap Ballet Flats Sale UK Best Pointe Shoes Online UK Ballet Dance Shoes UK Shoes For Dance UK Best Ballet Slippers Shop Best Yoga Shoes Hotsell