Genii Weblog

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");

Answer

width := @Sum(@DbColumn("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Graphic *"; "GraphicWidth"; "Format=Number"));

Answer

filesize := @Sum(@DbLookup("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"File *"; ".doc"; "FileSize"; "Format=Number KeyProperty=OriginalFileName KeyMatch=Ends "));

Answer

@DbColumn("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Section  *");

Answer

anchors := @DbColumn("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Anchor  *"; "AnchorText");
@If (anchors != ""; "["+@Implode(("<a href=\"#"+@ReplaceSubstring(anchors; " "; "%20"))+(("\">"+anchors)+"<a>"); "<br>")+"]"; "")

Answer

Copyright 2004 Genii Software Ltd.

What has been said:

No documents found