Das Notes Forum
Lotus Notes / Domino Sonstiges => Tipps und Tricks => Thema gestartet von: HaPe am 31.01.03 - 09:56:36
-
Hi das Folgende hab ich grad im Web gefunden:
I wanted to create a list with numbers in sequence, like 1 : 2 : 3 : 4 : 5, and didn´t think it was possible to to this dynamically. Since R5 cannot loop inside @Formulas, I had to think out another way.
Since the language is quite powerful regarding the list operator, you could do it this way:
min:=2;
max:=10;
startDate:=[01/01/01];
((@TextToTime(@Explode(@TextToTime(@Text(startDate) + "-" +
@Text(@Adjust(startDate; 0; 0; max - min; 0; 0; 0))))) -
startDate)/86400) + min;
The start date is irrelevant, since we are just counting days. The @Explode(daterange) function is very special, since it creates a list with all dates in the specified range. And since the list operator has higher precedence than the subtraction operator, the subtraction of the start date is made on the whole list! When subtracting / adding two dates, you get the result as the difference in seconds, so we have to divide it with 60*60*24=86400. Simple, isn´t it? :-)
http://dev.kanngard.net/Permalinks/ID_20030129233632.html
-
:o :o :o
Das ist klasse!
CPO
-
... ich nutze zur Generierung von Nummernlisten die Permutationsregel...
_a := "0" : "1" : "2" : "3" : "4" : "5" : "6" : "7" : "8" : "9";
_Liste := _a *+ _a;
@Subset(@Subset(_Liste; 11);-10)
... liefert "01" .. "10" als Text-Zahlenliste...
... mit @TextToNumber(...) kann man daraus dann auch Zahlen generieren...
... ich kann damit zum Bespiel die Zeilen einer dynamischen Tabelle nummerieren - in Verbindung mit @Elements...
ata
... da war noch ein Fehler, den ich korrigiert habe - so gehts jetzt...
ata
-
Die Idee ist noch besser ;-)
Ich war mir nicht bewust das es ein *+ als Operator giebt. Man findet in Notes halt immer noch was neues...
-
Aber atas Formel kann man verstehen - im Gegensatz zu dem Datumsgewurschtel. Und ich liebe es, wenn's läuft, ohne daß ich weiß, wie 8) 8) 8)
CPO
-
tja HaPe wenn du die Notes Hilfe aufmerksam liest steht das auch drin ;D ;D
cu