Citect cicode

Dariusch

Member
Join Date
Sep 2003
Posts
284
I have a little problem trying to get a little script work.
I have a page on it I have the Process Analyst ActiveX
I have createt a new button on toolbar "my_command1"
But when i run the program and I click on the button nothing happens.
I get no error when compeling.
I have also inplemntet the function "InitProcessAnalyst()" on page shown.

Someone who has any idea what I have done wrong??
Could it be some computer setup??

I have used the following example:

FUNCTION
InitProcessAnalyst()
OBJECT hPA = ObjectByName("CPA");
END

FUNCTION
CPA_E_CommandExecuted(OBJECT hPA, STRING commandId)
SELECT CASE commandId
CASE "my_command1"
PromptMe(hPA);
END SELECT
END

FUNCTION
PromptMe(OBJECT hPA)
Prompt("Hello World!");
END


Thank you

Dariusch
 
The button you create has to call the function CPA_E_CommandExecuted and pass the two variables (OBJECT hPA, STRING commandId) to the function. To debug, try inserting a message in the function code. The message will halt execution and tell you where the code is at.
ie Message("Hello","Program halted at position 1 " + "commandID = " + commandId,48);
Regards Alan case
 

Similar Topics

I am trying to display a variable within a cicode function onto a graphics page. This function queries a SQL database. I can get the value onto a...
Replies
3
Views
287
Hi guys, its my first time progamming cicode and I need to do popups alarms, there are several digital alarms and in their rising edge transition...
Replies
0
Views
507
Is there a way to run a Cicode function in the Cicode Editor? I have a function that works but I would like to run it without having a button on...
Replies
12
Views
2,979
in the past i have only been doing small mods to existing cicode and coping sections to reuse and modify to suit. Now i have been tasked to write...
Replies
5
Views
2,783
Does anyone have a Citect 2018 CiCode Reference Guide in pdf Format??? I know all the functions are in the help but..... I like to print them out...
Replies
5
Views
2,229
Back
Top Bottom