![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Incident Reports » Incident Reports Addressed for Version 2.02 » View Incident Report |
![]() |
Reported By: Michael Dreher Reported On: 9/25/2015 For: Version 2.01 Build 2 |
type TTestInstructionDataType = ( TIDT_INT, TIDT_FLOAT, TIDT_BOOL, TIDT_STRING ); procedure TForm1.Button1Click(Sender: TObject); var n : integer; begin // Comparing const int with enum member in a case statement, it compiles case 1 of TIDT_INT : n:=1; TIDT_FLOAT : n:=1; TIDT_BOOL : n:=1; TIDT_STRING : n:=1; else n:=1; end; // Comparing const int with enum member in an IF statement. // Does not compile: // [Error] Unit1.wbs (45,10): Expected boolean, integer, or double but instead found TIDT_STRING { if 1 = TIDT_STRING then n:=1; } // Make an explicite cast, this compiles // The case statement above does not need an explicite cast. if TTestInstructionDataType(1) = TTestInstructionDataType(TIDT_STRING) then n:=1; // Check some extension (using below), it compiles if (TTestInstructionDataType(1) = TTestInstructionDataType(TIDT_STRING)) then n:=1; // Test AND operator in boolean expression (using below), it compiles if (1=1) AND (2=2) then n := 1; // Combine enumeration member (with explicite casting) and AND operator in IF statement: // Does not compile: // [Error] Unit1.wbs (66,7): Expected Boolean but instead found TTestInstructionDataType(1) { if (TTestInstructionDataType(1) = TTestInstructionDataType(TIDT_STRING)) AND (2=2) then n:=1; } end;
This web page was last updated on Monday, November 13, 2023 at 07:46 AM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |