Closed Thread
Results 1 to 3 of 3

Thread: This error driving me crazy! "Ordinal Type required"

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

    This error driving me crazy! "Ordinal Type required"

    Hi,

    I got a combo box where you can select stuff and I coded it with this:


    procedure TFrmDatabase.ComboBox1Change(Sender: TObject);
    begin

    case combobox1.Text of

    'GiftAidID': searchbox.Width:= 80;
    'Title': searchbox.Width:= 50;
    'Initial': searchbox.Width:= 20;
    'Surname': searchbox.Width:= 100;
    'Address': searchbox.Width:= 500;
    'PostCode': searchbox.Width:= 100;
    'E-mail': searchbox.Width:= 400;
    'DateR': searchbox.Width:= 200;
    'AmountRaised': searchbox.Width:= 70;

    end;

    But the stupid program keeps highlighting the bolded part and says: 'Ordinal Type required'!

    Any help appreciated? I have always done case this way, well i pascal anyways.

    Thanks

  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: This error driving me crazy! "Ordinal Type required"

    Case statements require NUMBERS, not strings. Specifically, an ordinal type is an Integer, Word, etc.
    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: This error driving me crazy! "Ordinal Type required"

    But in pascal, I was able to use strings...so is that just pascal?

    Omg, so I have to give each variable a number and then do it? argh.

    EDIT:

    Lucky me, I can use the Combobox's 'itemindex' . I would have had to list all everything otherwise >_>

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Alex G. CSS "Sexy Buttons" - what about "submit on 'ENTER'" ?
    By shackrock in forum JavaScript and CSS
    Replies: 7
    Last Post: 12-05-2010, 04:57 PM
  2. Replies: 2
    Last Post: 11-01-2010, 11:52 PM
  3. "Type to Learn" STYLE Programming Teacher
    By tuchdoun in forum General Programming
    Replies: 4
    Last Post: 09-07-2010, 11:02 AM
  4. Replies: 4
    Last Post: 05-01-2010, 04:58 AM
  5. Replies: 1
    Last Post: 04-30-2010, 11:22 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