notes.txt

(1 KB) Pobierz
alias notes {
  set %exist $isfile( notes.txt )
  if ( %exist != $true ) { run notepad notes.txt }
  window -e @notes 1 1 500 200
  clear @notes
  set %notes 0
  set %lenotes $lines(notes.txt)
  if ( %lenotes == 0 ) goto eind
  echo @notes 4        Notes Current Notes: %lenotes
  :gogo
  inc %notes
  set %notestring $read -l $+ %notes notes.txt
  echo @notes 8Note %notes $+ :11 %notestring
  if %notes == %lenotes goto eind
  goto gogo
  :eind
}

on *:input:@notes: {
  if ( $left( $1, 1) != $chr(47) ) {
    if ( $left( $1 , 1) == $chr(46) ) { 
      if ( $1 == .re ) { clear @notes | notes | goto eind }
      if ( $1 == .del ) { write -dl $+ $2 notes.txt | clear @notes | notes | goto eind }
      goto eind      
    } 
    inc %notes
    write notes.txt $1-
    echo @notes 11New Note %notes $+ :8 $1-
  }
  :eind
  halt
}
menu @notes {
  &Refresh notes:/clear @notes | /notes
  -
  &Delete notes:/write -dl $+ $?="the number of note you want to delete:" notes.txt | clear @notes | notes
  -
  &Close:/window -c @notes | hecho you just type /notes to start it up again
}
Zgłoś jeśli naruszono regulamin