Jump to content
AC Tool Forums
Sign in to follow this  
Annunaki

Keys

Recommended Posts

Not sure if this is the correct place to post but I'm trying to map a key to a button and not having much luck.

Here is what i've got

 

0787ed4311dfb2d3020cf8ca8bf93c5b.png

 

What am I missing here?

Edited by Annunaki

Share this post


Link to post
Share on other sites

First, yes it is the correct place.

And second, the problem you are experiencing is a very minor, and common, mistake. And it is easily fixed. You need to add Divide to the uses clause

So your code, as pictured above, should be:

Unit2
{$FORM TForm2, Unit2.sfm}

uses
	Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Divide;
	
procedure ButtonClick(Sender: TObject; var DragObject: TDragObject);
begin
	Keys('d');
	Delay(500);
end;

begin
end;

 

The uses clause is where you would INCLUDE libraries to used the various procedures/functions, global variables, etc they have for you to use in your script. The uses also includes script files so that you may use what procedures/functions, global variables, etc. that it may have. As such you would add to the uses clause those files or libraries that you are using procedures/functions, global variables, etc from.

All of Divides commands and variables are part of the Divide library. In order for you to use any of the library's functions in the current script file. You need to add Divide to the uses clause.

With that being said. Not all script files will use the Divide library, or even any one of the other available libraries or accessible script files.

 

 

 

Share this post


Link to post
Share on other sites
16 minutes ago, Annunaki said:

Ok I figured it out

 

I needed to add Divide to the uses section.

Yep, you posted that as I was typing in my response. but, you are correct.

Share this post


Link to post
Share on other sites

Thank you very much for the explanation and I am really looking foward to seeing what i can do with Divide albeit with the limited free time I get, it is most certainly a major improvemnt compared to AC tool.

I am having memory leak messeges at the moment but i will duly create a new thread for this when one pops up again.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and to our Privacy Policy.