Das Notes Forum
Domino 9 und frühere Versionen => Administration & Userprobleme => Thema gestartet von: Der Hase am 20.02.03 - 11:16:33
-
Hallo Experts, gibt es eine Funktion in Script die mir aus einem
Notesitem alle Werte nur einmal ausgibt.
Etwas wie die Formel @Unique wäre toll
Danke
-
nimm doch Evaluate für @unique in Script.
Gab dazu letzte haufenweise Beispiele im Entwicklerforum.
Oder:
Sub Click(Source As Button)
Dim newitem$, reslist$, ulist As Variant
newitem = "Notes is kewl"
x = 0
REM prompt the user for items for the array till they quit
Do While newitem <> ""
If newitem <> "" Then
Redim Preserve slist(x) As String
REM InputBox[$] ( prompt [ , [ title ] [ , [ default ] [ , xpos , ypos ] ] ] )
newitem = Inputbox$("Enter another item to add to the list." & Chr$(10) & "Click Cancel when you are done.", "Enter Item", newitem)
slist(x) = newitem
x = x + 1
End If
Loop
REM run the array through the unique function
ulist = Unique(slist)
REM Now set up the result so it can be displayed to the user
Forall u In ulist
reslist = reslist & Chr$(10) & u
End Forall
Msgbox "The unique list is:" & reslist,, "Unique Result"
End Sub
Function Unique(a)
Dim data List As Integer
Dim i%, n%
REM test to see if a is an array; if not, return it
If Not(IsArray(a)) Then
Unique = a
Exit Function
End If
For i=Lbound(a) To Ubound(a)
data( Cstr(a(i)) ) = i
Next
REM This takes the new list and puts it back into an array
n = 0
Redim newarray(0 To Ubound(a)-Lbound(a))
Forall z In data
newarray(n) = a(z)
n = n + 1
End Forall
Redim Preserve newarray(0 To n-1)
REM This returns the new array
Unique = newarray
End Function
zu finden in der megageilen Library (such mal nach unqiue):
http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/816d64935ee8842485256c680051b592?OpenDocument
-
hi,
du kannst @unique über den befehl evaluate in das script einbinden.
such mal im forum nach evaluate.
tschö
-
oh, ein Echo ;D ;D ;D
*nix für ungut*
-
hallo rob,
da war wohl einer schneller...
-
rob,
du postest ja schneller als das echo gucken kann! :D ;D ;D
-
Hi,
schau mal hier:
http://www.free.dominoserver.de/computer/noteslibrary.nsf/d2d59a3d7fc73a2bc1256a6900638352/4b72e8439c418c6080256c9300736699?OpenDocument (http://www.free.dominoserver.de/computer/noteslibrary.nsf/d2d59a3d7fc73a2bc1256a6900638352/4b72e8439c418c6080256c9300736699?OpenDocument)
In der Bibliothek ist eine Scriptversion von Unique enthalten.
Axel
-
ah wahh, ich fands nur total witzig..passiert mir auch häufiger, daß mein Antwortposting offen im Browser rumliegt, während ich was anderes mache (telefonieren, zocken, etc..ab zu mal was arbeiten) und dann schließe ich das Ding irgendwann später ab und schwupps,....liegen schon mehrere Antworten vor ;D
Destowegen ist das Forum genial: es lebt, schlicht und einfach.
-
@Rob
du sollst arbeiten und nich zocken... ;D ;D
Axel
-
ich arbeite aber um zu zocken... :D..äh, um zu leben, meine ich...ätschi...Axel..biste Deutscher :o ;D ;D ;D ;D
ok, genug OT´led...sorry
-
@Rob
äh, um zu leben, meine ich...ätschi...Axel..biste Deutscher
äh, ich denke schon. Gestern war ich's noch. ??? ;D
Axel
-
also jetzt wirklich mein letztes OT..
weißt doch Axel, Deutsche lebbe um zu arbeiten und
alle anderen arbeiten um zu lebbe...
kanntest Du den Joke noch nicht? Cool :D
Wie gesagt, ist halt ein Joke, mehr nit.