Results 1 to 4 of 4

Thread: Help on resulting a type Please

  1. #1
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help on resulting a type Please

    Umm so in a function i am trying to result in a type.
    Simba Code:
    Type
      Monster = Record
        Colour,Toll:Integer;
        Hue,Sat    :Extended;
        Uptext     :String;
      End;






    Function MonsterDetails(MonsterName:String):Monster;
    Begin
      Case MonsterName Of
      'Goblin':Begin
               End;
      End;
    End;

    But every time i do Result := ------ it throws an error

    Thanks for the help
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  2. #2
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Type
      Monster = Record
        Colour,Toll:Integer;
        Hue,Sat    :Extended;
        Uptext     :String;
      End;

    var
      MonsterSetup : Monster




    Function MonsterDetails(MonsterName:String):Monster;
    Begin
      Case MonsterName Of
      'Goblin':Begin
                  with MonsterSetup do  //loads recoard to store specific infomation for script
                  begin
                    Colour:= ;
                    Toll:= ;
                    Hue:= ;
                    Sat:= ;
                    Uptext:= '' ;
                  end;
               End;
      End;
    End;

    use the above case to store all monsters.

    when you call a specific one use MonsterSetup.Colour, Toll and so on to call the relevant info.

    thats how i did it last time, hope it all makes sense

  3. #3
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    @Bobzilla69: with MonsterSetup do -> with Result do

  4. #4
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow that great, thanks both of you
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

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
  •