AD304 : Formula Follies And LotusScript Lunacy

Rocky Oliver presenting. I only have 34 minutes of battery left so lets see how much I can get written before losing power…

Going to cover what’s new in Notes 8.0 formulas, look at some new and exciting lotuscript stuff and generally help make people aware of new ways to do things.

Why use formulas? formulas are always faster. They are highly optimized and closer to the core API while lotusscript and java are higher lanaguage levels and need translation down to the api.

@SORT will sort things. It didn’t appear till Notes 6. There are a number of keywords like [accentsensitive] or [decending] and you can string them together [opt1]:[opt2] etc etc.

You can use [CustomSort] you write a formula that comes back as tru or false. It uses a quicksort method and compares values and runs the formula against them. If it’s true then the values are switched and if false they are not switched. It runs until everything comes back false.

So to sort by size use the following code. The $A and $B represent the values to be compared.

@sort(list;[CustomSort;@length($A)>@length($B));

The custom sort formula can be as complicated as you want. As long as it returns True or False. Just don’t make it more complicated as you need and remember that $A and $B are the values to compare.

@Transform is a powerful formula.

Think of it as an @ForAll. It works against a list and executes a formula against each value in the list and replaces the result of the formula into that list members position. This example will take a list of names and if any value for X is a lowercase g then it will make it an Uppercase G.

@transform(Some_List; “X”;@if(@lowercase(@left(X;1))=”g”;@Uppercase(X);x)))

The first X in quotes is the variable and that is only used in the transform formula.

Another new formula @Nothing. Saves you having to trim empty strings. Use it where you’d normally use “”

@abstractSimple : creates a short abstract of a text or richtext field.

@GetViewInfo : returns 1 if the view is filtered using @SetViewInfo

@IsusingJavaElement : will return 1 is the view is a new Java based view.

@passwordQuality : New examples in the help doc

@URLQueryString : Now allows dynamic DB2 query views

@Version : Added new version numbers

6 minutes of battery left…..

Advertisement
Tagged with:
Posted in None
One comment on “AD304 : Formula Follies And LotusScript Lunacy
  1. Wow, you did a great job in typing it all out. I was in the sessions as well, and I think you wrote it down in a very comprehensive way.

    Like

Comments are closed.

Archives
%d bloggers like this: