Problem with Pascal script

Touch-It not working as expected? Report problems and share solutions!
dimitar_n_g
Posts: 3
Joined: Fri Jan 15, 2021 12:05 pm

Problem with Pascal script

Postby dimitar_n_g » Sat Jan 16, 2021 8:12 pm

I want to map the action of the button and in Tab Action I select Pascal scripting. I try to write the following code but without any success.

uses Process;
var
RunProgram: TProcess;
begin
RunProgram := TProcess.Create(nil);
RunProgram.CommandLine := ‘calc.exe’;
RunProgram.Execute;
RunProgram.Free;
end;

If someone can help me please. It is urgent!
Attachments
1.png

User avatar
chessware
Site Admin
Posts: 384
Joined: Sat Jun 22, 2013 11:26 am
Contact:

Re: Problem with Pascal script

Postby chessware » Mon Jan 18, 2021 4:58 pm

Use a "Execute a program" command instead.
Touch-It Designer.jpg

dimitar_n_g
Posts: 3
Joined: Fri Jan 15, 2021 12:05 pm

Re: Problem with Pascal script

Postby dimitar_n_g » Mon Jan 18, 2021 8:01 pm

It was my first idea. I wrote calc.exe for example. I want to open the special software and than to perform a series of operations (which I can do only with some script). But my idea was to integrate the script to the keyboard which I preparing now. I am not so friendly with pascal that's why I need help. If there is some way to use some other programing languages write me some base instructions

So If you can share me some idea In this line of thought I will be very grateful. (I am sure you are the master of this software)

User avatar
chessware
Site Admin
Posts: 384
Joined: Sat Jun 22, 2013 11:26 am
Contact:

Re: Problem with Pascal script

Postby chessware » Tue Jan 19, 2021 11:08 am

You can write a DLL with the language of your choice.
Then copy that DLL to the Touch-It folder and call exported procedures from Pascal scipting.
Touch-It Designer.jpg
Remember that you need a 64 bit DLL on 64 bit plateform.

dimitar_n_g
Posts: 3
Joined: Fri Jan 15, 2021 12:05 pm

Re: Problem with Pascal script

Postby dimitar_n_g » Tue Jan 19, 2021 8:00 pm

I try all day without any results . The dll is in the correct folder the code is like yours but nothing. You will see in attachment the dll file and the picture of my last try. Could you try with my dll file. The code inside of the dll is similar like in my first post just to open calculator.

Public Function Sayhello()
System.Diagnostics.Process.Start("calc.exe")
End Function
Attachments
DIMDLL.zip
(1.35 KiB) Downloaded 39 times
Second_try.png

User avatar
chessware
Site Admin
Posts: 384
Joined: Sat Jun 22, 2013 11:26 am
Contact:

Re: Problem with Pascal script

Postby chessware » Thu Jan 21, 2021 1:08 pm

Your dll is 32 bit. It will only works on 32 bit platform. You must comply with Touch-It which is either 32 or 64 bit based on the platform.

Your dll does not provide any entry point. MyFunc and MyProc are not available.

Your dll must be located in the Touch-It app folder (C:\Program Files\Chessware\Touch-It), not the data folder (we will change this in the next release).


Return to “Problems and solutions”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest