Page 1 of 1

Problem with Pascal script

Posted: Sat Jan 16, 2021 8:12 pm
by dimitar_n_g
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!

Re: Problem with Pascal script

Posted: Mon Jan 18, 2021 4:58 pm
by chessware
Use a "Execute a program" command instead.
Touch-It Designer.jpg

Re: Problem with Pascal script

Posted: Mon Jan 18, 2021 8:01 pm
by dimitar_n_g
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)

Re: Problem with Pascal script

Posted: Tue Jan 19, 2021 11:08 am
by chessware
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.

Re: Problem with Pascal script

Posted: Tue Jan 19, 2021 8:00 pm
by dimitar_n_g
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

Re: Problem with Pascal script

Posted: Thu Jan 21, 2021 1:08 pm
by chessware
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).