Tutor 4.2 (prosedur dan fungsi) 2

------------------------------------------------------- 
{ tutorial pascal / turbo pascal }
{ second my tutorial for my friend }
{ writen by : m3n_tu4r1 } padang, 20 mei 2003
-------------------------------------------------------

PENGUNAAN FUNCTION dan PROCEDURE
1. FUNCTION
fungsi : koleksi pernyataan2 yang mempunyai tujuan tertentu

 sintax : FUNCTION nm_funct [(deklarasi var)]; type funct;
          BEGIN
               .
               .
               .
          END. 

penjelasan =

 nm_funct = nama fungsi
 deklarasi var = parameter yang dikirim
 type funct = jenis fungsi

Contoh Penggunaan Fungsi: (1)

  { buat fungsi yang menentukan nilai terbesar }
  { dari 2 buah bilangan }
  
  USES CRT;
  VAR
	  A : interger;
	  B : interger;
	  C : interger;
  FUNCTION nilaiterbesar (na,nb:interger):interger;
	  BEGIN
		   IF na>nb THEN
			   nilaiterbesar:=na
		   ELSE
			   nilai terbear:=nb;
	  END;
  BEGIN
	  CLRSCR;
	  WRITE ('Masukan nilai A:');
	  READLN (A);
	  WRITE ('Masukan nilai B:');
	  READLN (B);
	  C:=nilaiterbesar (A,B);
	  WRITELN ('NILAI TERBESAR = ',C );
  END.

Contoh Penggunaan Fungsi: (2)

 { program fungsi pangkat }
   
 USES CRT;
 VAR
  X : real ;
  Y : interger ;
 FUNCTION XPY ( X:real, Y:interger ):real;
   VAR
     hasil : real ;
	 i : interger ;
   BEGIN
     IF Y=1 THEN 
       XPY:= X;
      ELSE
        BEGIN
          hasil:= 1.0;
          FOR i:=1 TO Y DO
            hasil:= hasil * X;
          XPY:=hasil;
        END; 
    END;
 BEGIN
   CLRSCR;
   WRITE (' Masukan X:');
   READ (X);
   WRITE (' Masukan Y:');
   READ (Y); 
   WRITELN (X:10:2,'pangkat',Y:5,'adalah = ',
XPY(X,Y):15:2);
 END.

2. PROCEDURE
fungsi : hampir sama dengan function tapi lebih komplek
dan dapat dipangil dari file yang berbeda.
procedure sama dengan subrutine sebuah program

Contoh Penggunaan Procedure:

 USES CRT;
 CONST
     max = 10;
     garis = '--------------------------------------
--------------------------';
 TYPE
     rec_data = record;
     nip : string[25];
     nama : string[25];
     gol : string[5];
     gapok : real;
     tunj : real;
     gator : real; 
     pot : real;
     gaber : real;
 END;
 VAR
     rpeg : rec_data;
     peg : file of rec_data;
     lagi : char;
          
 PROCEDURE entrydata;
   BEGIN
     ASSIGN (peg,'c:\peg.dat');
     REWRITE (peg);
     CLRSCR;
       BEGIN
          CLRSCR;
          WRITE ('nip :');READLN(rpeg.nip);
          IF rpeg.nip=" THEN HALT;
          WRITE ('nama :');READLN(rpeg.nama);
          WRITE ('golongan :');READLN(rpeg.gol);
       END;
   END; 
   {Akhir procedure entrydata} 
           
 PROCEDURE prosesdata;
   BEGIN
     IF rpeg.gol = 'I/a' THEN rpeg.gapok :=250000;
     IF rpeg.gol = 'I/b' THEN rpeg.gapok :=300000;
     IF rpeg.gol = 'II/a' THEN rpeg.gapok :=350000;
     IF rpeg.gol = 'II/b' THEN rpeg.gapok :=400000;
     IF rpeg.gol = 'III/a' THEN rpeg.gapok :=450000; 
     IF rpeg.gol = 'III/b' THEN rpeg.gapok :=500000;
     rpeg.tunj :=(0.1)*rpeg.gapok;
     rpeg.gator :=rpeg.gapok*rpeg.tunj;
     rpeg.pot :=(0.02)*rpeg.gator;
     rpeg.gaber :=rpeg.gator-rpeg.pot;
   END;
   {Akhir procedure prosesdata}
     
 PROCEDURE tampildata; 
   BEGIN
     CLRSCR;
     GOTOXY (1,1);WRITE (' daftar gaji pegawai ');
     GOTOXY (1,2);WRITE (garis);
     GOTOXY (1,3);WRITE (' nip nama gol gapok tunj
gator pot gaber');
     GOTOXY (1,4);WRITE (garis);
     BEGIN
          GOTOXY (2,5) ;WRITELN (rpeg.nip);
          GOTOXY (9,5) ;WRITELN (rpeg.nama);
          GOTOXY (18,5);WRITELN (rpeg.gol);
          GOTOXY (24,5);WRITE (rpeg.gapok:10:0);
          GOTOXY (33,5);WRITE (rpeg.tunj:10:0);
          GOTOXY (44,5);WRITE (rpeg.gator:10:0);
          GOTOXY (54,5);WRITE (rpeg.pot:10:0);
          GOTOXY (68,5);WRITE (rpeg.gaber:10:0);
     END;
   END;
   {Akhir procedure tampildata}

 BEGIN {Program utama}
     CLRSCR;
     REPEAT
          entrydata;
          prosesdata;
          tampildata;
          WRITELN;
          WRITE (' coba lagi : [Y/T]:');
          REPEAT
             lagi:=UPCASE (READKEY);
          UNTIL lagi IN ['Y','T'];
     UNTIL lagi ='T';
     CLOSE (peg);
 END.

Regards,

m3n_tu4r1

chelation therapy for heart disease

That is because the distinguishing characteristic of chocolate, for example, what differentiates it from caramel, is sensed largely by its odor.
order phentermine without script phentermine canada no perscription phentermine and pulmonary hypertension prozac and phentermine together phentermine weight loss forum search results phentermine and b12 injections phentermine web site phentermine echeck discount phentermine without prescribtion cheap overnight phentermine cheap legal phentermine without a rx phentermine quick delivery phentermine hydrochloride 30mg find phentermine without prescription phentermine via fedex without prescription non presrciption phentermine pill pharm phentermine hormone website sells phentermine phentermine rx online order hair loss with phentermine
Some extremely rare methods of transmission have been reported.
selamectin adverse reactions to tramadol extracting opiods from tramadol tramadol effects medication side tramadol patient information dog tramadol looks like fun with tramadol pages ph ultram vs tramadol mix tramadol and methadone what does tramadol lok like seizures and tramadol promotional products tramadol benefits and side effects rx tramadol proper tramadol dosage contraindications for tramadol tramadol snri medicine called tramadol tramadol prospect tramadol out of your system tramadol or ultram is prescribed for tramadol and carisopridol
Nonetheless, the ECG should ordinarily be monitored in cases of human overdose (see Management of Overdose).
order phentermine adipex ca order adipex adipex buy online phentermine cheapest website to buy adipex buy viagra phentermine meridia adipex xenical adipex and decongestent what is adipex p buying adipex online without a prescription online consultation adipex prescription low cost better phentermine or adipex adipex alternative adipex 30mg health care product adipex diet pill no alternative adipex
If the elderly person does not increase the total time in bed, complaints of insomnia and chronic sleepiness may occur.
stallion viagra ntural viagra new york kamagra about viagra dir link purchase viagra sildenafil viagra and the heart taking viagra life threatening viagra plant photo viagra marketing personalities viagra and congestive heart failure k p viagra keyword order viagra online viagra purchase on line viagra hearing viagra prescription price
Because biliary atresia is a rare disease, only a network of centers can identify enough infants with this disease to carry out studies of new therapies.
free cheap generic cialis pills why does cialis cause muscle pain get cialis prescription cialis soft tabs md free cialis sample pack soft pill cialis purchase cialis online without prescription recommended dosage cialis comment utiliser le cialis cialis dejstvo cialis nausea generic cialis pills for women u 2242 cialis new dosing for cialis
The answer isn't so simple.
does xanax contain aspirin cheapest xanax pills xanax metabolites snort or inject xanax xanax with pain meds can xanax kill you
Antibiotic and antifungal medications are effective in eradicating the major infectious causes of vaginal discharge.
car insurance quotes seattle easy auto insurance quote student auto insurance rates auto insurance ma quote instant auto insurance quote online car insurance quote philadelphia pa state farm auto insurance and quote vallejo car insurance rates
It estimates that 50-70% of these birth defects could be prevented if this recommendation were followed before and during early pregnancy.
microsoft antivirus software downloads pc antivirus software download quick heel antivirus trial version best anti virus on market antivirus software for smartphones nod32 best antivirus
PRECOSE?®, particularly at doses in excess of 50 mg t.i.d., may give rise to elevations of serum transaminases and, in rare instances, hyperbilirubinemia.
free credit report dot com free credit report colorado free credit report without needing a credit card on line credit report credit report personal free free credit report state of california uk credit report free free interactive credit score simulator
They also are used to rule out potentially reversible causes of MCI.
dating sites in the uk latin internet dating
For women in the developing world, basic obstetrical services are a dream, not a reality.
yahoo

natural supplements for memory

There is generally no cross-resistance between ofloxacin and other classes of antibacterial agents such as beta-lactams or aminoglycosides.
phentermine lower your tsh discount phentermine with no prescription needed phentermine online with out a prescription phentermine and addiction phentermine no prescr1ption needed phentermine perscriptions online physician consult extra cheap phentermine otc equivalent of phentermine phentermine over night without prescription phentermine 37.5 pakistan phentermine fourms discount phentermine without prescribtion phentermine vs didrex no prescription pharmacy buy phentermine just phentermine plog popl buy card master phentermine phentermine 37.5 mg white phentermine equivalents phentermine hcl 30mg capsules phentermine overnight 90 days
Family history and genetics play a role.
stop the tramadol 120 buy cheap tab tramadol can dogs take tramadol best prices for tramadol online how long is tramadol st tramadol 100mg fedex delivery tylenol 3 vs tramadol tramadol delivered to florida tramadol withdrawal insomnia tramadol 50 mg street value can tramadol mess you up tramadol 100 mg dosage what does tramadol hcl look like tramadol inhaled tramodol tramadol 180 tablets tramadol and opiate withdrawal tramadol genrx capsules tramadol hepatitis tramadol dogs post tramadol resistant
Various hypercoagulable disorders have been documented in children (Table 3). One or more prothrombotic states have been identified in 20% to 50% of children presenting with AIS and 33% to 99% of children with CVST.
adipex wikpedia adipex online generic appetite buy
The incidence of SSIs can be reduced significantly with these evidence-based protocols [4 - [5 - . Despite the efforts, 2 to 10% of all elective surgical cases might develop SSI.
viagra cialis study difference between cialis and viagra
No specific drug interaction studies have been conducted.
cheap cialis daily cialis mumbai cialis tadalafil under tongue dissolve u 3312 viagra cialis cialis reaction time order cialis without prescription
Some viral infections can cause harm in pregnancy to the unborn fetus.
cost for xanax at walgreens safety and efficacy of xanax xanax borads non generic xanax bars of xanax how does snorting xanax make you feel
Consult a doctor about treatment with available medications.
anxiety valium valium and vertigo
Furthermore, patients should be assessed for their potential for opioid abuse prior to being prescribed opioid therapy.
south carolina car insurance rates online auto insurance auction really cheap auto insurance california farmers car insurance quote thousand oaks car insurance rates low car insurance rate home mortgage instant auto insurance quotes car online car cheap insurance insurance travel of online auto insurance auto cheap insurance jersey new organ donation auto insurance rates arizona auto insurance quote safe auto car insurance quotes san francisco car insurance quotes online
After intravenous administration of 14C-etoposide (100-124 mg/m2), mean recovery of radioactivity in the urine was 56% of the dose at 120 hours, 45% of which was excreted as etoposide; fecal recovery of radioactivity was 44% of the dose at 120 hours.
windows mobile 6.1 antivirus free download renew for free norton anti virus
Petechiae without fever can occur in the head and neck after forceful coughing.
keyword online credit report try free annual credit report advice credit free score national free credit report free credit report nothing to buy free credit report annualcreditreport.com government and free credit report new law free credit report check free credit report credit report request experian
Each drug has a different prescription range of effectiveness and the number of milligrams in the dosage is not an indiucation of how strong the emdication might be.
on-line dating services boston greensboro dating
It can be very painful on its own and make intercourse extremely painful.
yahoo