#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    42
    Rep Power
    1

    Undeclared Identifier TFormCurrentField Error


    I am developing an application at Delphi by following inbuilt Help tutorial name 'Using DBExpress to view and update Database'.

    I am getting Undeclared Identifier error with TFormCurrentField.

    Seems like there is no component named as TFOrmCurrentField

    My code segment is at follows

    Code:
    private:	// User declarations
      // Private declarations
      String TableName;
      TStringList *AllTables;  //list of database tables
      TDBXDataExpressMetaDataProvider *FMetaDataProvider;
      TFormCurrentField *MemoForm;  //form to view individual elements in database table
    Does anyone has idea whether it is third party component or inbuilt one ?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    344
    Rep Power
    6
    Declarations in Delphi should be in the form:

    <variable name> : <variable type>;

    you seem to have

    <variable type> <variable name>;

    Also, if you are using * as you would in a C/C++ program as a pointer to some structure, then you would use ^ (shift 6) instead, although I suspect that in fact you don't need a (pointer to) variable at all. Delphi does a very good job of abstracting pointers (so while you are working with pointers, you don't have to think about it in terms of pointers)

    so
    Code:
    private:	// User declarations
      // Private declarations
      String TableName;
      TStringList *AllTables;  //list of database tables
      TDBXDataExpressMetaDataProvider *FMetaDataProvider;
      TFormCurrentField *MemoForm;
    should be
    Code:
    private:	// User declarations
      TableName: String;
      AllTables: TStringList;
      FMetaDataProvider: TDBXDataExpressMetaDataProvider;
      MemoForm: TFormCurrentField;

    Comments on this post

    • ninadgac agrees
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    42
    Rep Power
    1
    I am not sure how it is reversed while pasting code here bit surprise.

    I have declared it in the correct format as
    <variablename> <variabletype>

    as follows

    Code:
    private
        { Private declarations }
        TableName: String;
        AllTables: TStringList;  //list of database tables
        FMetaDataProvider: TDBXDataExpressMetaDataProvider;
        MemoForm: TFormCurrentField;  //form to view individual elements in database table
    Based on the above data type another declaration is

    Code:
    MemoForm := TFormCurrentField.Create(Self);
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    42
    Rep Power
    1
    Problem sorted out ...it was actually another form unit which was later named as FormCurrentField.

IMN logo majestic logo threadwatch logo seochat tools logo