Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8461329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:51:02+00:00 2026-06-10T13:51:02+00:00

In the main unit I have defined a function that is then called by

  • 0

In the main unit I have defined a function that is then called by another form with the appropriate parameter:

unit Parser;
interface
uses
[...]

function SaveGridLayoutToReg(ASaveViewName: AnsiString): Integer;

type
TForm1 = class(TForm)
[...]
function SaveGridLayoutToReg(ASaveViewName: AnsiString): Integer;
end;

[...]

function TForm1.SaveGridLayoutToReg(ASaveViewName: AnsiString): Integer;
var
  AStoreKey: string;
  AOptions: TcxGridStorageOptions;
  LayoutRegistryKey: TRegistry;
begin
  AStoreKey := 'Software\KTRT\Stats';

  AOptions := [];
  cxGrid1TableView1.StoreToRegistry(AStoreKey, True, AOptions, ASaveViewName);

  LayoutRegistryKey.RootKey:= HKEY_CURRENT_USER;
  if LayoutRegistryKey.OpenKey(AStoreKey+'\'+ASaveViewName, false) then
    Result := 0
  else
    Result := -1;
end;

In the other form:

[...]
uses Parser;

procedure TForm3.Button1Click(Sender: TObject);
var
LayoutRegistryKey: TRegistry;
AStoreLocation : AnsiString;
AStoreKey: string;
begin
  AStoreLocation := Edit1.Text;
  if Parser.SaveGridLayoutToReg(AStoreLocation) <> 0 then
    Label1.Visible := True
  else
  begin
    Label1.Visible := False;
    Form3.Visible := False;
  end;
end;
[...]

I am somehow doing it wrong since I keep getting the error

Unsatisfied forward or external declaration

If I don’t declare the function in the TForm1 class then the grid view won’t be found. If I don’t declare the function after the “uses” clause, I won’t be able to call it from the other form.
I really can’t get it 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:51:03+00:00Added an answer on June 10, 2026 at 1:51 pm

    You declare two functions in the interface section, namely, SaveGridLayoutToReg at

    function SaveGridLayoutToReg(ASaveViewName: AnsiString): Integer;
    

    and TForm1.SaveGridLayoutToReg a few lines later. But in the implementation section, you only implement the latter one.

    That is, you need to replace

    unit Parser;
    interface
    uses
    [...]
    
    function SaveGridLayoutToReg(ASaveViewName: AnsiString): Integer;
    
    type
    TForm1 = class(TForm)
    [...]
    function SaveGridLayoutToReg(ASaveViewName: AnsiString): Integer;
    end;
    

    with

    unit Parser;
    interface
    uses
    [...]
    
    type
    TForm1 = class(TForm)
    [...]
    function SaveGridLayoutToReg(ASaveViewName: AnsiString): Integer;
    end;
    

    or you have to implement both functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that is using a stackpanel which then gets called inside
I have unit test sample code that basically runs 2 threads: the main test
I have a large simulation written in C++. The main working unit for the
I need a Timer in a 'no form' Delphi unit (there's still a main
I have a unit test that checks behavior on blocking and non-blocking sockets -
I have a main app-context.xml that defines a property placeholder with two locations: default
I'm trying to implement function objects in Java. I have a Unit class, with
I've recently started practising TDD and unit testing, with my main primers being the
I have a number of tests failing in the following JUnit Task. <target name=test-main
I have a util module that produces a jar to be used in other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.