Closed Thread
Results 1 to 3 of 3

Thread: Very simple problem! Pascal Help

  1. #1
    2710 is offline Programmer
    Join Date
    Sep 2008
    Posts
    108
    Rep Power
    0

    Question Very simple problem! Pascal Help

    Hi all,

    Basically, this is what I want:

    A Program that takes in the first 3 letters of a sentence/string, and then it takes the last letter of that 3 letter string and outputs it. The program runs, but it just wont show the letter, can anyone tell me what Im doing wrong? I cant for the life of me figure it out:
    Code:
      var
      word, Left, right: string;
    
      function Oneletter(S: String):String;
      begin
      S:=Rightstr(S,1);
      S:=result;
      end;
    
      begin
    
      Writeln('Please Type');
      readln(Word);
    
      Left:=Leftstr(Word,3);
      Right:= Oneletter(Left);
    
      writeln(Right);
      readln;
    end.
    I just dont get it!

    Thanks!!
    Last edited by WingedPanther; 02-10-2009 at 10:36 AM. Reason: add code tags (the # button)

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: Very simple problem! Pascal Help

    S:=result;

    should be

    result := S;
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    2710 is offline Programmer
    Join Date
    Sep 2008
    Posts
    108
    Rep Power
    0

    Re: Very simple problem! Pascal Help

    Such a simple matter >< I cant believe it! Thanks!!

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. I need help with a very simple problem
    By Walizzay in forum Java Help
    Replies: 4
    Last Post: 07-23-2011, 10:24 AM
  2. My Pascal problem. Help ASAP! D:
    By happiness in forum Pascal and Delphi
    Replies: 8
    Last Post: 02-12-2011, 01:27 PM
  3. Problem with Free Pascal 2.4.0 Compiler
    By daudang_47 in forum Pascal and Delphi
    Replies: 2
    Last Post: 05-19-2010, 04:54 AM
  4. c++ to pascal(simple code)
    By lukasyno in forum Pascal and Delphi
    Replies: 2
    Last Post: 11-13-2009, 08:44 AM
  5. 2 simple pascal problem help!pls
    By rlpp in forum Pascal and Delphi
    Replies: 3
    Last Post: 12-26-2008, 07:01 AM

Tags for this Thread

Bookmarks

Posting Permissions

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