Citect Cicode

Chris Taylor

Lifetime Supporting Member
Join Date
Feb 2011
Location
Canterbury
Posts
257
Morning all.

I'm trying to automate some emails using citect and cicode.

I can get cicode to open Outlook, send an email and then close Outlook, no problems.

My problem is the syntax of the "MailSend" function, specifically the sNote string.

what I want to do is to place a variable in that string so it can say "tank 1 at variable litres"

for example

MailSend("[email protected]","message header","Fuel Status","",0)

this is OK

MailSend("[email protected]","message header","Fuel Status" fuel_variable" litres","",0)

is not OK

Anyone know? I'm suppecting I've have to do this as an attachment but its easier for the engineers to see this just as a mail on thier phones.

I'll put request in to Citect but its the weekend and they are not always quick to respond.

All the best

Chris Taylor
 
Last edited:
try

MailSend("[email protected]","message header","Fuel Status" + int_to_str(fuel_variable) + " litres","",0)

I think the cicode function is int_to_str, but at least this should get you on the right track. The + is used to concatenate the strings
 
I think you will need to use the ^ escape character to insert variables into the message text.

Providing fuel_variable is a string this should work.
MailSend("[email protected]","message header","Fuel Status ^""+fuel_variable+"^ litres","",0)

Cheers
 
Thank you very much GeoffC and chelton


MailSend("[email protected]","message header","Fuel Status "+INTtoSTR(fuel_variable)+" litres","",0)

That worked a treat

The ^ was useful as well as it meant using ^n allowed me to format the email so it looked like it wasn't from a 4 year old.

Chris
 

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
288
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,985
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,785
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,230
Back
Top Bottom