<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Domino, Email, Spam and IT Related &#187; Programming</title>
	<atom:link href="http://www.indomino.net/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indomino.net/blog</link>
	<description>My Passion about Lotus Notes, Domino, Email and IT Related</description>
	<lastBuildDate>Fri, 27 Aug 2010 02:48:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Evaluate, the bridge between Lotus Script and @Formula</title>
		<link>http://www.indomino.net/blog/2009/10/03/evaluate-the-bridge-between-lotus-script-and-formula/</link>
		<comments>http://www.indomino.net/blog/2009/10/03/evaluate-the-bridge-between-lotus-script-and-formula/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 15:21:41 +0000</pubDate>
		<dc:creator>bfebrian</dc:creator>
				<category><![CDATA[Lotus Notes and Domino]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[evaluate]]></category>
		<category><![CDATA[formula]]></category>
		<category><![CDATA[lotus-domino]]></category>
		<category><![CDATA[lotus-notes]]></category>
		<category><![CDATA[lotus-script]]></category>

		<guid isPermaLink="false">http://www.indomino.net/blog/2009/10/03/evaluate-the-bridge-between-lotus-script-and-formula/</guid>
		<description><![CDATA[In lotus notes programming, I usually use Formula for simple program and Lotus Script for more complex program. I try to avoid many lines of Formula, because it difficult to read and not structured.
But, Formula have many method that Lotus Script do not have, like @Implode and @Explode. Even we can write our ownLotus Script function [...]]]></description>
			<content:encoded><![CDATA[<p>In lotus notes programming, I usually use Formula for simple program and Lotus Script for more complex program. I try to avoid many lines of Formula, because it difficult to read and not structured.</p>
<p>But, Formula have many method that Lotus Script do not have, like @Implode and @Explode. Even we can write our ownLotus Script function to do that, it just a waste of time and energy.</p>
<p>But, we have Evaluate in Lotus Script.</p>
<p>Evaluate  function is one of many of my favorite functions, because it able to run Formula and than pass the result of that Formula intoLotus Script variable (variant).</p>
<p>This is the syntax of Evaluate</p>
<blockquote><p>variant = notesSession.Evaluate( formula$, doc )</p></blockquote>
<p>We can use Evaluate function to pass the result from any kind of Formula,  from simple formula like @UserName to more complex formula like @Implode.</p>
<p>Recently, I use Evaluate in my program, to shorten the length of theLotus Script.</p>
<p>I need to calculate the difference in days between two date, but only in business days ( so saturday and sunday will not be counted also holidays).</p>
<p>Formula already have the function to calculate that, so I don&#8217;t need to create another lengthly Lotus Scriptfunction just to calculate that. I use the formula instead, so I need the Evaluate function.</p>
<p>varDay=Evaluate(&#8220;@BusinessDays(@Date(datFinal);@Date(@Now);1;datPublicHoliday)&#8221;,doc)</p>
<p>Remember that Evaluate function return value is variant.</p>
<p>With Evaluate, Formula and Lotus Script can coexist together.</p>
<img src="http://www.indomino.net/blog/?ak_action=api_record_view&id=163&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.indomino.net/blog/2009/10/03/evaluate-the-bridge-between-lotus-script-and-formula/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Send email notification with LotusScript</title>
		<link>http://www.indomino.net/blog/2009/09/16/send-email-notification-with-lotusscript/</link>
		<comments>http://www.indomino.net/blog/2009/09/16/send-email-notification-with-lotusscript/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 13:28:57 +0000</pubDate>
		<dc:creator>bfebrian</dc:creator>
				<category><![CDATA[Lotus Notes and Domino]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[email-notification]]></category>
		<category><![CDATA[lotus-domino]]></category>
		<category><![CDATA[lotus-notes]]></category>
		<category><![CDATA[lotus-script]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.indomino.net/blog/?p=154</guid>
		<description><![CDATA[Lotus Notes and Domino is not only  about email, it&#8217;s more than that. One of it&#8217;s feature it workflow, where people can create workflow application faster an d easier than any other application out there.
One of the important thing in workflow is email notification, to let users know that they have one job to do, [...]]]></description>
			<content:encoded><![CDATA[<p>Lotus Notes and Domino is not only  about email, it&#8217;s more than that. One of it&#8217;s feature it workflow, where people can create workflow application faster an d easier than any other application out there.</p>
<p>One of the important thing in workflow is email notification, to let users know that they have one job to do, or just simply notification.</p>
<p>Example,  if a staff create a leave request and when he or she submit the request, his or her manager will get an email notification about the request.</p>
<p>I have this one of my favorite sub program to create an email notification, well I named it &#8220;CreateEmailNotification&#8221; <img src='http://www.indomino.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>If you like, you can use it for free. Just copy the sub program in one or new Script Library.</p>
<p>This is the sub program.</p>
<p>=====Start of Sub Program<br />
Sub CreateMailNotification(doc As notesdocument, strSendTo As Variant, strSubject As String, strCopyTo As Variant)</p>
<p>Dim session As notessession<br />
Dim db As notesdatabase<br />
Dim docMail As notesdocument<br />
Dim rtitem As Variant</p>
<p>Set db = doc.parentdatabase<br />
Set session = db.Parent<br />
Set docMail=db.createdocument<br />
Set rtitem=docMail.CreateRichTextItem(&#8220;Body&#8221;)</p>
<p>If strSendTo(0)=&#8221;" Then Exit Sub</p>
<p>&#8216;=====set mail<br />
docMail.Form = &#8220;Memo&#8221;<br />
docMail.From = session.UserName<br />
docMail.Principle = session.UserName<br />
docMail.SendTo = strSendTo</p>
<p>If Isarray(strCopyTo) Then<br />
If strCopyTo(0)&lt;&gt;&#8221;" Then<br />
docMail.CopyTo = strCopyTo<br />
End If<br />
Else<br />
If strCopyTo&lt;&gt;&#8221;" Then<br />
docMail.CopyTo = strCopyTo<br />
End If<br />
End If</p>
<p>docMail.Recipients = strSendTo<br />
docMail.Subject = strSubject<br />
docMail.PostedDate = Now</p>
<p>&#8216;=====set body field<br />
Call rtitem.AppendText(&#8220;Please click this doclink to see more details about the status &#8221; + &#8221; &#8220;)<br />
Call rtitem.AppendDocLink( doc, &#8220;click to open document&#8221;)<br />
Call rtitem.AddNewLine( 2 )</p>
<p>&#8216;=====send mail<br />
Call docMail.send(False)<br />
End Sub<br />
=====End of Sub Program</p>
<p>Feel free to do some modification if necessary.</p>
<p>You can call it from any lotusscript with simple line like this.</p>
<p>call Call CreateMailNotification (doc, doc.nmSendTo, strSubject,doc.nmCopyTo)</p>
<p>Don&#8217;t forget to put use &#8220;Script Libary Name&#8221; first.</p>
<img src="http://www.indomino.net/blog/?ak_action=api_record_view&id=154&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.indomino.net/blog/2009/09/16/send-email-notification-with-lotusscript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sample Code: Shell function</title>
		<link>http://www.indomino.net/blog/2007/01/30/sample-code-shell-function/</link>
		<comments>http://www.indomino.net/blog/2007/01/30/sample-code-shell-function/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 09:17:00 +0000</pubDate>
		<dc:creator>bfebrian</dc:creator>
				<category><![CDATA[Lotus Notes and Domino]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[lotus-script]]></category>

		<guid isPermaLink="false">http://www.indomino.net/blog/?p=12</guid>
		<description><![CDATA[In the forum, some one asked how he can download a file from a web server
via lotus script. It hit me. I have exactly almost the same function, but I
download from a ftp server instead of a web server. But, it almost the
same.
Actually lotus script &#8211; as far as I know &#8211; doesn&#8217;t provide function [...]]]></description>
			<content:encoded><![CDATA[<p>In the forum, some one asked how he can download a file from a web server<br />
via lotus script. It hit me. I have exactly almost the same function, but I<br />
download from a ftp server instead of a web server. But, it almost the<br />
same.</p>
<p>Actually lotus script &#8211; as far as I know &#8211; doesn&#8217;t provide function for<br />
that. So, I look elsewhere, then I found a very interesting function call<br />
shell.</p>
<p>From Designer Help, description about shell function is very short &#8211; Starts<br />
another program &#8211; that it, no more no less.</p>
<p>Later I found out that shell can &#8216;almost&#8217; run anything via command line,<br />
like my agent that called an ftp program to download or upload a file.</p>
<p>Sample of my agent:<br />
Dim TaskID as integer<br />
TaskID = Shell (&#8220;c:\programto\download.bat&#8221;)</p>
<p>Than I create a batch file called download.bat<br />
<a href="ftp://ftp.exe/">ftp.exe</a> -i -s:&#8221;c:\programto\download.txt&#8221;&gt;c:\jbadownload\log\getsO13Log.txt</p>
<p>Than I create a download.txt<br />
open <a href="ftp://ftp.server.com/">ftp.server.com</a><br />
ftpusername<br />
ftpusepassword<br />
ascii<br />
prompt<br />
cd tosomefolder<br />
lcd tosomelocalfolder<br />
get somefile<br />
bye</p>
<p>See the tricks?</p>
<p>I don&#8217;t use any third party ftp client, just using ftp client that already<br />
included in all windows distribution. That&#8217;s works.</p>
<p>I also use the shell function to do many things, like extract zip files<br />
with pkunzip and many more.</p>
<img src="http://www.indomino.net/blog/?ak_action=api_record_view&id=12&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.indomino.net/blog/2007/01/30/sample-code-shell-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create your first notes database</title>
		<link>http://www.indomino.net/blog/2007/01/22/how-to-create-your-first-notes-database/</link>
		<comments>http://www.indomino.net/blog/2007/01/22/how-to-create-your-first-notes-database/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 09:26:00 +0000</pubDate>
		<dc:creator>bfebrian</dc:creator>
				<category><![CDATA[Lotus Notes and Domino]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[lotus-notes]]></category>

		<guid isPermaLink="false">http://www.indomino.net/blog/?p=10</guid>
		<description><![CDATA[Once, I met a friend who just take a course on domino designer.  After a
small talk, he ask a question that surprised me. How to create a lotus
notes database? I look at him, and ask didn&#8217;t he just take a course for
that?  It seem a stupid question. then he explain me that he [...]]]></description>
			<content:encoded><![CDATA[<p>Once, I met a friend who just take a course on domino designer.  After a<br />
small talk, he ask a question that surprised me. How to create a lotus<br />
notes database? I look at him, and ask didn&#8217;t he just take a course for<br />
that?  It seem a stupid question. then he explain me that he know how to<br />
create form, views etc, BUT he doesn&#8217;t how to start and how they linked to<br />
each other. Based on my friend experienced, I create this mini how to. This<br />
is a very basic tutorial on how to create your first lotus notes database.</p>
<p>To do this, you must installed domino designer.</p>
<p>First of all, create a blank database.<br />
&gt;From File menu, select Database and click New. Than right click the<br />
database, then click Open in Designer.</p>
<p>Second, create a form.<br />
In the form, you should at least add one field, and action buttons to edit<br />
and save.<br />
For edit button, you can use this simple formula:<br />
@Command([EditDocument])</p>
<p>For save button, you can use this formula<br />
@Command([FileSave]);</p>
<p>If needed, you can add another action button, called Exit or Close<br />
@Command([FileCloseWindow])</p>
<p>Third, create a view to display the form.<br />
In the view, you should add an action button to create the form that you<br />
just created.<br />
Example:<br />
@Command([Compose];&#8221;Form A&#8221;)</p>
<p>That it. Very basic, but your first notes database is ready to go.</p>
<p>To make your database more readable by users or to make it more good<br />
looking, you can add these additional steps.</p>
<p>First, I like how IBM design the mail template. Therefore I like to use the<br />
same design as in the mail template.</p>
<p>Create few pages<br />
As in mail template, create two pages, one for database name, and second to<br />
display your user name.<br />
For page to display your database name, just type the name, no formula<br />
needed.<br />
For page to display your user name, create a computed text, and in the<br />
formula windows type this formula @Name([CN];@UserName).</p>
<p>Create an outline.<br />
Outline will simplify how your notes user will switch on different view.<br />
Create one outline, and click generate default outline and then create a<br />
page to display the outline.</p>
<p>Create a frame.<br />
And to put the whole elements that you just created, you use a frame.</p>
<p>Now from the database properties, in launch tab, select the frame that you<br />
just created as default launcher.</p>
<p>That it. Your database now look more professional with pages and frame. Add<br />
more colors or pictures if you have too.</p>
<p>To add more functionality for your database, create an agent. This, another<br />
story.</p>
<img src="http://www.indomino.net/blog/?ak_action=api_record_view&id=10&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.indomino.net/blog/2007/01/22/how-to-create-your-first-notes-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sample Code: Import data from a text file into notes database</title>
		<link>http://www.indomino.net/blog/2007/01/16/sample-code-import-data-from-a-text-file-into-notes-database/</link>
		<comments>http://www.indomino.net/blog/2007/01/16/sample-code-import-data-from-a-text-file-into-notes-database/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 04:47:00 +0000</pubDate>
		<dc:creator>bfebrian</dc:creator>
				<category><![CDATA[Lotus Notes and Domino]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[lotus-script]]></category>

		<guid isPermaLink="false">http://www.indomino.net/blog/?p=8</guid>
		<description><![CDATA[This morning, I have a question for a member of mailing list, how we can
import data from a text file. Well I just have the code for that. Is quite
simple on how to import the data from a text file, but what you gonna do
with the data, is another question.
This a cut version of my [...]]]></description>
			<content:encoded><![CDATA[<p>This morning, I have a question for a member of mailing list, how we can<br />
import data from a text file. Well I just have the code for that. Is quite<br />
simple on how to import the data from a text file, but what you gonna do<br />
with the data, is another question.</p>
<p>This a cut version of my lotusscript agent. I only show how we import the<br />
data from a text file. My agent, actually use the data to create new<br />
documents in notes database. The text file should located in the server<br />
where the agent run. Also the signer of the agent must have appropriate<br />
rights in the server.</p>
<p>In the agent, you will see the NoteLog object. Well, I have a habit to<br />
create a log on every agent that I created. So I can troubleshoot the agent<br />
easily if something goes wrong.</p>
<p>&gt;&gt;&gt;&gt;&gt;<br />
Sub Initialize<br />
Dim fileNum As Integer<br />
Dim strLine As String</p>
<p>&#8216;//=====prepare for loging<br />
Dim currentLog As New NotesLog( &#8220;Import data from text file&#8221; )<br />
Call currentLog.OpenNotesLog( &#8220;&#8221;, &#8220;AMgrLog.nsf&#8221; )<br />
&#8216;//=====</p>
<p>fileNum = Freefile()<br />
Open &#8220;c:\data\import\sample.txt&#8221; For Input As fileNum</p>
<p>&#8216;//=====<br />
Call currentLog.LogAction( &#8220;Import data from text file &#8211; Start&#8221;)<br />
&#8216;//=====</p>
<p>Do While Not Eof (fileNum)<br />
Line Input #fileNum, strLine<br />
&#8216;//===now you have strLine variable that you can manipulate as<br />
you want<br />
&#8216;//===example Trim(Mid$(strLine,69,7))<br />
Loop</p>
<p>Close fileNum<br />
&#8216;//=====loging<br />
Call currentLog.LogAction( &#8220;Import data from text file &#8211; End&#8221;)<br />
Call currentLog.Close</p>
<p>End Sub<br />
&gt;&gt;&gt;&gt;&gt;</p>
<p>Now, you have it and have fun.</p>
<img src="http://www.indomino.net/blog/?ak_action=api_record_view&id=8&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.indomino.net/blog/2007/01/16/sample-code-import-data-from-a-text-file-into-notes-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
