Domino 9 und frühere Versionen > Entwicklung

@evaluate - wozu?

(1/2) > >>

Centaury:
Hallo!
Wozu ist @evaluate da? Die Hilfe spuckt dazu nicht viel (fast nichts) aus. Was mach ich damit?

Christopher:
Kannst Du in Lotus Script verwenden um eine Formel auszuführen.

Beispiel:

Function KillUmlaute ( s As String ) As String
   strformula = { @ReplaceSubString("} + s + {"; "ä":"ö":"ü":"ß":"Ä":"Ö":"Ü":"Dr. ":"_":"-":" "; "ae":"oe":"ue":"ss":"Ae":"Oe":"Ue":"":"":"":"" ) }
   nStr = Evaluate( strformula )
   KillUmlaute = nstr(0)
End Function

P.S. Es funktionieren aber nicht alle Formel damit.

Rob Green:
kenne keine Formel funktion namens "@evaluate".

Aber, evaluate wird in Script gerne verwendet, um komplexe Schritte in Script einzusparen, indem man es mit der Formelsprache über das Evaluate Statement koppelt. Evaluate führt die Formel innerhalb eines Scriptcodes aus.

Dazu die Help:
The Evaluate statement in Domino Designer has the following syntax:
returnValue = Evaluate( notesFormula [, notesObject ] )
NotesFormula is a string variable, expression, or constant.
notesObject is optional and provides context for the formula; for example, if the formula accesses a field, notesObject must be the NotesDocument object that contains the field.
returnValue is an array whose type and number of elements reflect the formula result; a scalar value is returned to element 0 of the array. You should use a variant for the return value since you may not know how many elements are being returned.
The following @functions, which affect the user interface, do not work within an Evaluate statement: @Command, @DbManager, @DbName, @DbTitle, @DDEExecute, @DDEInitiate, @DDEPoke, @DDETerminate, @DialogBox, @PickList, @PostedCommand, @Prompt, and @ViewTitle.

Beispiele aus diesem Forum (SUCHE Funktion):

--- Code: ---Dim CharArray As Variant
     ImplodedStr$ = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"
     StrDelimiter$ = ","
     CharArray = evaluate(|@Explode("| & ImplodedStr$ & |";"| & StrDelimiter$ & |")|)
--- Ende Code ---


--- Code: ---eval = evaluate({@Text(ReplicaID; "*")}, doc)
--- Ende Code ---



--- Code: ---...dim und set von doc...
dim ret_eval as Variant
ret_eval = evaluate(|FIELD Mehrfachfeld := @Trim(@Replace(Mehrfachfeld;"| + loeschstring + |";""))|,doc)
--- Ende Code ---


--- Code: ---Call backendDoc.ReplaceItemValue("tmp_DVB_Name", evaluate("@Name([CN]; DVB_Name)", note))

--- Ende Code ---


--- Code: ---Function Split ( ImplodedStr$, StrDelimiter$) as variant
    Split = evaluate(|@Explode("| & ImplodedStr & |";"| & StrDelimiter & |")|)
End function
--- Ende Code ---

Centaury:
Evaluate kenn ich. Ich meine aber @evaluate. Ich habe hier eine fertige Datenbank, in der das verwendet wird und verstehe nur Bahnhof. ???

ata:
... in meiner 5erHilfe habe ich nichts dazu gefunden - mit welcher Version arbeitest du - ev. R6 ?

ata

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln