What we take for granted
As Notes developers, I think we sometimes take for granted a lot of the stuff the product offers us. For example, I was coding a Lotusscript agent yesterday in release 5, and my head was so stuck in "Java land" that I started looking at using a custom class or function for "exploding" a string. in other words, the script equivalent of the StringTokenizer Java class. What a doofus! Of course, Notes 6 offers the developer a function for this (StrToken) which I've used before... but then suddenly, after grabbing Johan's excellent code, I slapped myself upside the head, and did this:
Const K_MACRO = {@Explode(txtDeptStructure; "\\")}
varStructures = Evaluate(K_MACRO, doc)
Update: In the end I used an explodeString function. I had to, as I had a need to tokenize some string variables generated by the code in addition to the field value above. Oh well. The code works well. And it's recursive! I love recursion <insert geek joke here >.
Posted at 12:42 on 21 Mar 2003 | Categories:
| (5 comments)

You are right Ben, But beyond just the tokenizer stuff I want to remark the great approach we can take of the Evaluate statement (both in LotusScript and Java), since it give us the power of the @Formulas in a snap. That is one of my favorite LotusScript and Java statements, and I use it frequently. In fact I always have something like:
Dim myF as string Dim myEv as variant myf = {some formula, from @DBLookups to some other usefull stuff} myEv = Evaluate(myF)Obviously I use the doc parameter when you want to evaluate the @Formula against a particular document. Very useful .
::AleX::.
Dominocode.Net
Splityeah? Alex, agreed,Evaluateis very useful. I always used to shy away from it on account of the horrendous memory leaks in r4.x, but now it's great stuff.