Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
IDE
Add Component Template
Background compile
Batch file target
Block Completion
Build Tools
Caliber
Class Completion
Class Explorer
Code Browsing
Code Completion
Code Editor
Code Explorer
Code Parameters
Code Templates
Compiler Message Window
Deployment Manager
Dialogs
Direct
Docking
File Browser
File Handling
Form Designer
Help
History View
IDE Insight
Memory Issues
Menu Designer
Menus
Module Manager
Multi-Monitor Support
Object Inspector
Object TreeView
Open Tools API
Packages
Performance
Printing
Project Explorer(old Object Browser)
Project Management
Refactoring
Repository
Save Desktop
Search
Start Page
Starteam
Startup/Shutdown
Structure Pane
System Resources
ToDoList
Tool Palette
Toolbars/Status Line
Translation Tools
Unit Testing
Version Control
VersionInfo
Views
Visual Form Inheritance
Workgroup(PVCS)
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/IDE/Code Templates
[ Add a report in this area ]
Report #:
36085
Status:
Reported
Error in 'for in' template
Project:
Delphi
Build #:
10.0.2288.42451
Version:
10.0
Submitted By:
Ilshat Absharipov
Report Type:
Basic functionality failure
Date Reported:
11/3/2006 1:41:33 AM
Severity:
Commonly encountered problem
Last Updated:
1/4/2008 4:43:37 PM
Platform:
All versions
Internal Tracking #:
Resolution:
None
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
4.00 out of 5
Total Votes:
None
Description
We can use operator for...in with arrays. But when we use code template named 'forin' (for in loop) Delphi declare new variable of TObject type, that is not correct
Steps to Reproduce:
1. Declare array of any type
type MyArray: array of string;
2. Set cursor in some procedure of function body
3. Enter 'forin'
4. Press Ctrl+Space, code insight appears and we see that there is 'forin' template. Use it
5. Enter 'myvar' in 'MyElem' point and 'MyArray' in MyList point. Press Tab to end template
6. After that we have new variable myvar: TObject but MyArray is string array
Workarounds
None
Attachment
None
Comments
Sebastian Modersohn at 11/3/2006 4:45:52 AM
-
For this to work along the lines of what you expect, the DeclareVariable call in the live template would need to figure out the base type of the enumerator, which is certainly possible, but definitely not implemented yet.
See http://delphi.wikia.com/wiki/Delphi_Live_Templates#forin for a new forint-Template which asks for the type of the iterator variable.
Additionally I'd recommend changing type and severity to C2, maybe C1. This is most definitely not a show stopper.
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us