Home > ordinal type > error ordinal type required

Error Ordinal Type Required

Contents

the predefined types Integer, Char, WideChar, Boolean, and declared enumerated types. Ordinal types are required in several different situations: delphi ordinal type required The index type of an array must be ordinal. The low

E2001 Ordinal Type Required

and high bounds of a subrange type must be constant expressions of ordinal type. The element type error ordinal 42 of a set must be an ordinal type. The selection expression of a case statement must be of ordinal type. The first argument to the standard procedures

Ordinal Type Of Data

Inc and Dec must be a variable of either ordinal or pointer type. program Produce; type TByteSet = set of 0..7; var BitCount: array [TByteSet] of Integer; begin end. The index type of an array must be an ordinal type - type TByteSet is a set, not an ordinal. program Solve; type TByteSet = set of ordinal type expected 0..7; var BitCount: array [Byte] of Integer; begin end. Supply an ordinal type as the array index type. Retrieved from "http://docwiki.embarcadero.com/RADStudio/Seattle/e/index.php?title=E2001_Ordinal_type_required_(Delphi)&oldid=237546" Category: RAD Studio Reference Views Page Discussion View source History Personal tools Create account Log in Search RAD Studio Seattle Seattle Examples and Samples Seattle Libraries Main Page - Seattle Topics Wiki What's New Tutorials FireMonkey Application Platform Multi-Device Applications Getting Started Steps in Developing a Project Key Application Types FireDAC Windows Developer's Guide Modeling Tools IDE Reference and Utilities Delphi Reference C++ Reference Subject Index HTML5 Builder Newer Versions Berlin Topics Previous Versions XE8 Topics XE7 Topics XE6 Topics XE5 Topics XE4 Topics XE3 Topics XE2 Topics XE Topics 2010 Topics In other languages Deutsch Français 日本語 Assistance Known Problems and Recent Fixes Random Page Recent changes Help Tools What links here Related changes Special pages Printable version Permanent link Page information This page was last modified on 23 January 2015, at 06:58. Privacy policy About RAD Studio Disclaimers Help Feedback (QP, email)

Programming C# C and C++ Java Pascal and Delphi Visual Basic Perl Python Assembly Bash / Shell Scripting Mobile Development Game Development Web Development General Discussions PHP ASP.NET ASP Ruby Databases HTML5 / HTML / XHTML / DHTML CSS /

Ordinal Type Of Measurement

CSS3 JavaScript / jQuery / AJAX / JSON ColdFusion Website Design Tutorials Submit Tutorial Assembly C

Delphi Case Statement

and C++ C# Database HTML, CSS and JavaScript Java PHP Python Visual Basic Game Development Mobile Development Other Tutorials Community Search Site Members Lounge Introduce Yourself Image Gallery Facebook Twitter YouTube Guidelines FAQ Help Blogs Gallery Unanswered Join Codecall.net Why Join Codecall? Register with Facebook Register with Twitter Android Cheats More Codecall → Language Forums → Other Languages → Pascal and http://docwiki.embarcadero.com/RADStudio/Seattle/en/E2001_Ordinal_type_required_(Delphi) Delphi Javascript Disabled Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality. Check out our Community Blogs Recent Topics HostForLIFE.eu – Cheap Windows & ASP.NET Core 1.0.1 hosting | UNLIMITED Diskspace EUWindowsHost - Oct 09 2016 07:54 PM Square root estimation program rounding float values to left of decimal only problem, no ints used sonar87 - Oct 09 2016 10:11 AM Simple while loop, i mean really http://forum.codecall.net/topic/51760-this-error-driving-me-crazy-ordinal-type-required/ simple and i cant do it :( Siten0308 - Oct 05 2016 11:54 AM HostForLIFE.eu – Cheap Windows & ASP.NET Core 1.0.1 hosting EUWindowsHost - Oct 03 2016 12:38 AM Jigsaw Puzzle Website Content Packs - Add jigsaw puzzles to your website Zethix - Sep 28 2016 04:20 PM Recent Blog Entries Remove Characters in String T-SQL with No Loop Part 2 Barnsite's Blog 09 May Remove Characters in String T-SQL with No Loop Barnsite's Blog 09 May Black hat hacking DarkLordofthePenguins's Blog 05 Nov Essential skills for computer nerds DarkLordofthePenguins's Blog 11 Sep Adventures in VirtualBox DarkLordofthePenguins's Blog 22 Jul Recent Status Updates · Unlock · Lock 03 Sep surajkumardotin Student college project Hide Comments · Unlock · Lock 25 Jun TopHatProductions115 The TXP-Network is coming back this July... Hide Comments · Unlock · Lock 12 Feb moonvik Java... Hide Comments · Unlock · Lock 04 Feb camD357 I love this community ! Hide Comments · Unlock · Lock 02 Jan JackJames hi i am jack i am seo expert jack james would love you to read new post Hide Comments View All Updates Popular Tags networking Managed C++ stream console database authentication Visual Basic 4 / 5 / 6 session Connection import syntax hardware html5 asp.net array java mysql php c++ string C# HTML loop timer jquery ajax programming javascript Androi

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://stackoverflow.com/questions/14515492/using-case-statement-with-string of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users http://www.cyberforum.ru/delphi-beginners/thread356948.html Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a ordinal type minute: Sign up Using Case Statement with String up vote 21 down vote favorite 5 Say i have a string 'SomeName' and wanted the values return in a case statement. Can this bedone? Can strings be used in a case statement like so Case 'SomeName' of 'bobby' : 2; 'tommy' :19; 'somename' :4000; else showmessage('Error'); end; delphi delphi-xe2 share|improve this question asked ordinal type required Jan 25 '13 at 4:46 Glen Morse 42642161 It seems that FreePascal (FPC) already implemented this language feature, I wish Delphi will follow up! [forum.lazarus.freepascal.org/index.php?topic=17983.0] –Edwin Yip May 14 '14 at 7:30 add a comment| 4 Answers 4 active oldest votes up vote 24 down vote accepted The Delphi Case Statement only supports ordinal types. So you cannot use strings directly. But exist another options like build a function which returns a Integer (hash) based on a string using generics and anonymous methods ( A generic case for strings) using a function which receive an array of strings (Making a case for Strings, the sane way) and so on. share|improve this answer edited Jan 25 '13 at 5:18 answered Jan 25 '13 at 5:11 RRUZ 114k11253398 2 you would think by xe2 version, they would of added something.. –Glen Morse Jan 25 '13 at 5:16 add a comment| up vote 23 down vote In Jcl library you have the StrIndex function StrIndex(Index, Array Of String) which works like this: Case StrIndex('SomeName', ['bobby', 'tommy', 'somename']) of 0: ..code.. ;//bobby 1: ..code..;//to

Ðåãèñòðàöèÿ Òåñòû Áëîãè Ñîîáùåñòâî Ïîèñê Ññûëêè ñîîáùåñòâà Ñîöèàëüíûå ãðóïïû Ïîèñê Google ïî ôîðóìó Ïîèñê Yandex ïî ôîðóìó Ïîèñê ïî ôîðóìó Ðàñøèðåííûé ïîèñê Òåñòû Ñïèñîê òåñòîâ Ê ñòðàíèöå... @batmanrider 21 / 22 / 2 Ðåãèñòðàöèÿ: 20.09.2011 Ñîîáùåíèé: 196 Çàïèñåé â áëîãå: 1 27.09.2011, 07:24 Íåïîíÿòíàÿ îøèáêà â öèêëå. #1 Delphi1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var i: String; begin case i of 0: Label1.caption; 1: Label2.caption; 2: Label3.caption; 3: Label4.caption; end; for i:=0 to 3 do i:='íîâûé êàïòèîí'; end; end.â case i of - [DCC Error] Unit1.pas(34): E2001 Ordinal type required â for i:=0 to 3 do - [DCC Error] Unit1.pas(40): E2032 For loop control variable must have ordinal type Similar Ýêñïåðò 41792 / 34177 / 6122 Ðåãèñòðàöèÿ: 12.04.2006 Ñîîáùåíèé: 57,940 27.09.2011, 07:24 Íåïîíÿòíàÿ îøèáêà â öèêëå. Ïîñìîòðèòå çäåñü: Íåïîíÿòíàÿ îøèáêà Delphi Delphi Íåïîíÿòíàÿ îøèáêàÍåïîíÿòíàÿ îøèáêà Delphi Delphi Íåïîíÿòíàÿ îøèáêàÍåïîíÿòíàÿ îøèáêà Delphi Ïîñëå ðåãèñòðàöèè ðåêëàìà â ñîîáùåíèÿõ áóäåò ñêðûòà è áóäóò äîñòóïíû âñå âîçìîæíîñòè ôîðóìà. @Mawrat 12694 / 5600 / 653 Ðåãèñòðàöèÿ: 19.09.2009 Ñîîáùåíèé: 8,784 27.09.2011, 08:54 Íåïîíÿòíàÿ îøèáêà â öèêëå. #2 Ñîîáùåíèå îò batmanrider â case i of - [DCC Error] Unit1.pas(34): E2001 Ordinal type required Ordinal type required - òðåáóåòñÿ ïîðÿäêîâûé òèï.  Case ïåðåìåííàÿ âûáîðà äîëæíà ïðèíàäëåæàòü ïîðÿäêîâîìó òèïó. Ê ïîðÿäêîâûì òèïàì îòíîñÿòñÿ: öåëûå, ïåðå÷èñëèìûå è ñèìâîëüíûå òèïû. Ñîîáùåíèå îò batmanrider var i: String; Òèï String ê ýòèì òèïàì íå îòíîñèòñÿ. @batmanrider 21 / 22 / 2 Ðåãèñòðàöèÿ: 20.09.2011 Ñîîáùåíèé: 196 Çàïèñåé â áëîãå: 1 27.09.2011, 16:56 [ÒÑ] Íåïîíÿòíàÿ îøèáêà â öèêëå. #3 Delphi1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; La

 

Related content

No related pages.