Results 1 to 5 of 5

Thread: what is the.....

  1. #1
    Join Date
    Apr 2008
    Location
    hy71194 made my change -.-
    Posts
    356
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default what is the.....

    difference between procedure and function??? which one should i use???

    do they do diffrent things??



    [/URL

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Simply put:

    A function does something and tells you something back. Like function YourMom: string; In the function you do Result := 'l33t'; and if you say WriteLn(YourMom); it will write Leet.

    On the other hand, a procedure will just do something, and won't "pay you back". Like ti will do it, and not tell you anything back

    Get what I am saying? o.O


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  3. #3
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    Program Test;

    Function YourMomsNameIs: String;
    Begin                    //Text
      Result := 'Eva';
    End;

    Function YourMomsAgeIs: Integer;
    Begin                   //Number
      Result := 54;
    End;

    Function YourMomIsAFemale: Boolean;
    Begin                      //True or False
      Result := True;
    End;

    Function YourMomWeightsThisMuch: Extended;
    Begin                            //Float or extended number. Integer but with a decimal.
      Result := 75.4;
    End;

    Begin
      Writeln('Hi my moms name is ' + YourMomsNameIs + ' and is ' + IntToStr(YourMomsAgeIs)+' old. True means shes a woman ' + BoolToStr(YourMomIsAFemale)+
               'she weights ' + FloatToStr(YourMomWeightsThisMuch)+' kilograms');
    End.

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  4. #4
    Join Date
    Apr 2008
    Location
    hy71194 made my change -.-
    Posts
    356
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    oo i under stand i will stick with procedures for now.....



    [/URL

  5. #5
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by JuKKa View Post
    SCAR Code:
    Program Test;

    Function YourMomsNameIs: String;
    Begin                    //Text
      Result := 'Eva';
    End;

    Function YourMomsAgeIs: Integer;
    Begin                   //Number
      Result := 54;
    End;

    Function YourMomIsAFemale: Boolean;
    Begin                      //True or False
      Result := True;
    End;

    Function YourMomWeightsThisMuch: Extended;
    Begin                            //Float or extended number. Integer but with a decimal.
      Result := 75.4;
    End;

    Begin
      Writeln('Hi my moms name is ' + YourMomsNameIs + ' and is ' + IntToStr(YourMomsAgeIs)+' old. True means shes a woman ' + BoolToStr(YourMomIsAFemale)+
               'she weights ' + FloatToStr(YourMomWeightsThisMuch)+' kilograms');
    End.
    HaHa Jukka you should actually make this a script it will catch on

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •