Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Obs:
- Comenziile de creare a tabelelor nu se plaseaza in acelasi loc cu comenzile care adauga inregisrari in tabela, deoarece comanda de creare suprascrie tabelele respectiva
- Sortare:
- Select* from elevi order by inaltime desc
- creare.prg :
- CREATE TABLE elevi (cod N(3), nume C(30), datan D, med N(5.2), rezultat L)
- USE elevi
- BROWSE
- use
- populare.prg :
- SET PATH TO "E:\\12C"
- CLEAR
- SET TALK OFF
- SET DATE TO DMY
- SET CENTURY ON
- USE elevi
- INPUT "Dati numar inregistrari: " TO n
- FOR i=1 TO n
- vcod = 0
- vnume = ""
- vdatan = {}
- vmed = 0.0
- vrezultat = .F.
- INPUT "COD = " TO vcod
- ACCEPT "NUME = " TO vnume
- INPUT "DATA NASTERII = " TO vdatan
- INPUT "MEDIA = " TO vmed
- INPUT "REZULTAT = " to vrezultat
- APPEND BLANK
- replace cod WITH vcod, nume WITH vnume, datan WITH vdatan, med WITH vmed, rezultat WITH vrezultat
- ENDFOR
- use
- aplicatie.prg :
- close all
- use elevi
- CLEAR
- ?"Introduceti operatia dorita:"
- ?"1 - introducerea a n inregistrari"
- ?"2 - afisarea inregistrarilor elevilor clasei date"
- ?"3 - afisarea unui elev dupa numarul inregistrarii"
- ?"4 - afisarea unui elev dupa numarul matricol"
- ?"5 - stergerea unui elev dupa nume"
- ?"6 - modificarea datelor unui elev dupa nume"
- input to op
- if(op==1)
- do populare
- endif
- if(op==2)
- input "Dati numarul clasei: " to vclasa
- browse for clasa = vclasa
- endif
- if(op==3)
- input "Dati numarul inregistrarii: " to vnumar
- browse for recno() = vnumar
- endif
- if(op==4)
- input "Dati numarul matricol: " to vmatricol
- browse for matricol = vmatricol
- endif
- if(op==5)
- accept "Dati numele elevului: " to vnume
- delete for nume = vnume
- pack
- endif
- if(op==6)
- accept "Dati numele elevului: " to vnume
- locate for nume = vnume
- input "Dati noua clasa: " to vnouclasa
- input "Dati noul matricol: " to vnoumatricol
- accept "Dati noua adresa: " to vnouadresa
- replace clasa with vnouclasa, matricol with vnoumatricol, adresa with vnouadresa, nume with vnume
- endif
- use
- transfer:
- SET TALK OFF
- CLEAR
- CLOSE ALL
- SELECT 1
- USE elevi
- SELECT 2
- USE respinsi
- select 1
- SCAN
- vcod = cod
- vnume = nume
- vmed = med
- vrez = rez
- IF vrez=.F.
- ?"sterg " + vnume
- SELECT 2
- APPEND BLANK
- replace cod WITH vcod, med WITH vmed, rez WITH vrez
- SELECT 1
- ENDIF
- ENDSCAN
- DELETE FOR vrez=.F.
- PACK
- USE
- SELECT 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement