Results 1 to 3 of 3

Thread: printing last name with first and middle initial

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Baytown, TX United States
    Posts
    19

    Post

    I'm currently working a program that will allow the user to enter their last name, and first and middle initial. Here's my code:

    begin
    write('enter your last name: ');
    readln(LastName);
    write('enter your first initial: ');
    readln(initialf);
    write('enter your middle initial: );
    readln(initialm);
    writeln(LastName, ', initialf, ', initialm)
    end.

    When I run it for the name R.M. Jones, I get the following: Jones(for the last name), initialf(for the first initial), and M(for the middle initial). Can someone tell me what's wrong?

  2. #2
    Hyperactive Member Juan Carlos Rey's Avatar
    Join Date
    Aug 1999
    Location
    Mendoza, Argentina
    Posts
    301

    Post

    That´s a VERY strange VB you have, what version is it?
    Ha, ha, ha, Excuse.Me
    Looking VERY CAREFULLY at your code, I see you are missing a quote in your middle initial code line. Did ya see? HTH


    ------------------
    I wish I was patient... RIGHT NOW!


    [This message has been edited by Juan Carlos Rey (edited 01-25-2000).]

  3. #3
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Post


    kazooie21,

    What Juan mentioned is at this line

    writeln(LastName, ', initialf, ', initialm)

    should be
    writeln(LastName, '', initialf, '', initialm)
    or
    writeln(LastName+''+initialf+''+initialm)

    Regards

    ------
    What a unique "VB" syntax.


    [This message has been edited by Keiko (edited 01-25-2000).]

Posting Permissions

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



Click Here to Expand Forum to Full Width