Q:

Function return value from formless or non-form unit

Hi I am not sure how to call function in formless or non-form unit to return the value. 
Unit1.h
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
    TButton *Button2;
    TLabel *Label2;
    void __fastcall Button2Click(TObject *Sender);
private:    // User declarations
public:     // User declarations
    __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

Unit1.cpp
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include "Unit3.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{

}

//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
    USHORT lengthOfYard;
    USHORT widthOfYard;
    USHORT areaOfYard;

    widthOfYard = 15;
    lengthOfYard = 17;
    areaOfYard= FindArea(lengthOfYard,widthOfYard);
    Label2->Caption = "\nYour yard is "+ areaOfYard +" square feet\n\n";

}
//---------------------------------------------------------------------------

Unit3.h
//---------------------------------------------------------------------------
#ifndef Unit3H
#define Unit3H
//---------------------------------------------------------------------------

// declare the function here in the header file. 

USHORT FindArea(USHORT length, USHORT width); //function prototype

#endif//---------------------------------------------------------------------------

Unit3.cpp
//---------------------------------------------------------------------------

#pragma hdrstop

#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)

USHORT FindArea(USHORT l, USHORT w)
{
    return l * w;
}

I could not find solution  or tutorial for this question.  
You have a better one? 
Clement

A:

The current file organization is fine. 
You should change the line:
Label2->Caption = "\nYour yard is " + areaOfYard + " square feet\n\n";

into:
Label2->Caption = "\nYour yard is " + String(areaOfYard) + " square feet\n\n";

The first form gives the error:

E2885: Invalid pointer addition

since the type of "\nYour yard is " is char * and you are adding a number to a pointer (take a look at Borland C++ Builder 6 and string concatenation and Concatenate two string literals for further details). 
With a String the operator+ is overloaded and adding a pointer-to-char to a String is well defined. 
EDIT
USHORT type is defined in windows.h.  You should add:
#include <windows.h>

in Unit3.h or, better, use a standard C++ type (unsigned FindArea(unsigned l, unsigned w)).