Word "type" gives syntax error
Original Reporter info from Mantis: ocean
-
Reporter name:
Original Reporter info from Mantis: ocean
- Reporter name:
Description:
I'm using this kind of code to access form element type. Works fine in Delphi, but in FPC I get syntax error?
formitem:=(Collection.item(i, 0) as IHTMLElement);
if formitem.type='text' then ...
program vt;
{$mode delphi}{$H+}
uses classes, sysutils, variants;
procedure test;
var v1, v2: variant;
begin
v1:=v2.name; // Works fine!
v1:=v2.type; // Syntax error?
end;
begin
test;
end.
C:\lazarus\fpc\2.7.1\bin\i386-win32>fpc c:/bug/vt.lpr
Free Pascal Compiler version 2.7.1 [2012/07/10] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling c:\bug\vt.lpr
vt.lpr(10,6) Warning: Local variable "v2" does not seem to be initialized
vt.lpr(11,9) Fatal: Syntax error, "identifier" expected but "TYPE" found
Fatal: Compilation aborted
Error: C:\lazarus\fpc\2.7.1\bin\i386-win32\ppc386.exe returned an error exitcode
Mantis conversion info:
- Mantis ID: 22622
- Platform: Win32
- Version: 2.7.1