This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

new line
#1
Hi in this for function, the texts are stringed together and sent on an email. This is for the alarm window 
But what do I have to add in the end to get a new line between each alarm entry?

I tried to send mail in the for function directly but only the last alarm is then sent by email for some reason. Why is that?

what do i use to get the number for the current row in the rows function?

What do I use to get the total number of rows in the table?

maileksport = " "
for _, row in ipairs(rows) do
  alstmaxid = math.max(alstmaxid, row.id)
  alertdate = os.date('%c', row.alerttime)
  maileksport = maileksport .. (  "Alarmnr \n \n " .. " - " .. ((alertdate .. " - ".. row.alert  )) ) --- here i want a new line
    --  mail(mailalarm, (lokasjon ..  " - ALARM " ), alertdate .. " - ".. row.alert )   --- this only send the last entry in table as alarm

   
end
Reply


Messages In This Thread
new line - by PassivPluss - 18.01.2023, 13:30
RE: new line - by admin - 18.01.2023, 13:54
RE: new line - by PassivPluss - 18.01.2023, 16:06
RE: new line - by admin - 19.01.2023, 08:20

Forum Jump: