Universal @DBLookup
Tue 30 Nov 2004, 09:18 AM
by Ben Langhinrichs
I am just having too much fun with the new (soon to be released) universal @DbLookup. To give you an idea of the flexibility, here are a few formulas. See if you can figure out what they do, and why they would be used, then click on the answer to see how close you came:
@DbLookup("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Paragraph *"; "Bullet"; "Text"; "KeyProperty=ParagraphStyle KeyMatch=Substr");
Answerwidth := @Sum(@DbColumn("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Graphic *"; "GraphicWidth"; "Format=Number"));
Answerfilesize := @Sum(@DbLookup("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"File *"; ".doc"; "FileSize"; "Format=Number KeyProperty=OriginalFileName KeyMatch=Ends "));
Answer@DbColumn("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Section *");
Answeranchors := @DbColumn("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Anchor *"; "AnchorText");
@If (anchors != ""; "["+@Implode(("<a href=\"#"+@ReplaceSubstring(anchors; " "; "%20"))+(("\">"+anchors)+"<a>"); "<br>")+"]"; "")
Answer
Copyright © 2004 Genii Software Ltd.