Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Functions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Malgaras  
View profile  
 More options Jul 29 2000, 3:00 am
Newsgroups: borland.public.delphi.students
From: "Malgaras" <malga...@iol.ie>
Date: 2000/07/29
Subject: Functions
I'm trying to get this to work but it keeps saying Unsatisfied Forware or
externam declaration

unit varkey32;

interface

Uses SysUtils, Windows, Messages;

Function varkey(Stringthing : PChar) : Boolean;
implementation

var mainwin,kidwin:Thandle;
    TargetPoint:Tpoint;
    stringToSend:string;
    Loopint:integer;
   Stringthing: String;
   begin
  mainwin:=Findwindow('Notepad',nil);
  if mainwin<>0 then
  begin
   targetPoint.x:=50; {make sure it is is the "writing" area of notepad}
   targetPoint.y:=50;
  end;
  kidWin:=ChildWindowFromPoint(mainwin,targetpoint);
  if kidwin<>0 then
   begin
     StringToSend:=Stringthing;
     For loopint:=0 to length(stringToSend)-1 do
     begin
      PostMessage(Kidwin,wm_char,Ord(stringToSend[loopint]),0);
     end;
  end;
end.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Holger Koch  
View profile  
 More options Jul 29 2000, 3:00 am
Newsgroups: borland.public.delphi.students
From: "Holger Koch" <holger.koch-datensyst...@otelo-online.de>
Date: 2000/07/29
Subject: Re: Functions

Malgaras <malga...@iol.ie> wrote:
> I'm trying to get this to work but it keeps saying Unsatisfied
Forware or
> externam declaration

> unit varkey32;

> interface

> Uses SysUtils, Windows, Messages;

> Function varkey(Stringthing : PChar) : Boolean;

Ok, you export a unit, called varkey...
> implementation

but here, you did not implement the function!
> var mainwin,kidwin:Thandle;
>     TargetPoint:Tpoint;
>     stringToSend:string;
>     Loopint:integer;
>    Stringthing: String;

The code, you placed after the begin runs directly by starting your
application.
The code will be handled like initialistion-code (see initialisation
in Delphi-Help)

So you have to implement a function called varkey, returning Boolean
value or you delete
the "export" in interface-part of your unit.

For further information see delphi help with the topic "writing units"
or something sounds like this.

Greetings,

Holger


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Rudolf  
View profile  
 More options Jul 29 2000, 3:00 am
Newsgroups: borland.public.delphi.students
From: "Dave Rudolf" <dave.t.rud...@home.com>
Date: 2000/07/29
Subject: Re: Functions
You need something like this:
------------------------------

unit varkey32;

interface

Uses SysUtils, Windows, Messages;

Function varkey(Stringthing : PChar) : Boolean;

implementation

Function varkey(Stringthing : PChar) : Boolean;
begin
.
.
.
end;  {end of varkey function}

end.  {end of unit}
---------------------------------------
You need the function header in both the interface and implementation
sections. This is because you may have more than one routine in a unit (in
fact, it seems like a waste to write a whole unit for only one routine). You
have to tell the complier which routine you are implementing For example:

---------------------------------------

unit Stuff;

interface

procedure DoStuff;
function TestStuff:BOOLEAN;

implementation

procedure DoStuff;
begin
    {code for DoStuff}
end;

function TestStuff:BOOLEAN;
begin
    {code for TestStuff}
end;

end.

---------------------------------------

Hope that clarifies things.

-------------------------------------------------------
http://members.home.net/dave.t.rudolf
http://members.home.net/stonemason

"Malgaras" <malga...@iol.ie> wrote in message

news:8lusbo$15o8@bornews.borland.com...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »