Genii Weblog


Civility in critiquing the ideas of others is no vice. Rudeness in defending your own ideas is no virtue.


Thu 29 Apr 2004, 01:20 PM
The title is almost the same, but this post shows the same logic as the one before, but using @Midas Formulas 3.30 instead.  Compare the two and see what you think.

pathName := @Prompt([OkCancelEdit]; "Graphic Pathname""Enter the full pathname for the graphics file:");
fileName := @RightBack(pathName; "\\");
@DbCommand("Midas":"NoCache""CreateImageResource"; ""; fileName; pathName);

Sheesh!  It makes the 32 lines of the Midas Rich Text LSX version look long.  Granted, the live version has some error checking and stuff, but it almost makes you wonder why IBM can't come up with this stuff.  Anyway, I just wanted to let you know I was still here... still testing.  I should come up for air soon.

Copyright © 2004 Genii Software Ltd.

Thu 29 Apr 2004, 01:19 AM
While working on a new sample to be distributed with Midas version 3.30, I created this code for creating and modifying image resources with Midas Version 3.30.  It has gotten has gotten very simple.  Here is the whole agent for either creating or modifying an image resource:

Sub Initialize
   ' *** Domino back-end class objects
   Dim session As New NotesSession
   Dim db As NotesDatabase
   
   ' *** Midas back-end class objects
   Dim rtSession As New GeniiSession
   Dim rtitem As New GeniiRTItem
   
   ' *** Miscellaneous processing variables
   Dim fileName As String
   Dim pathName As String
   Dim pos As Integer
   
   Set db = session.CurrentDatabase
   
   pathName$ = Inputbox$("Enter the full pathname for the graphics file:", "Graphic Pathname", "")
   If Len(pathName) =Then Exit Sub
   
   fileName = pathName
   pos = Instr(fileName, "\")
   While pos > 0
      fileName = Mid$(fileName, pos+1, Len(fileName)-pos)
      pos = Instr(fileName, "\")
   Wend
   
   Set rtitem = rtSession.CreateImageResource(db.Server, db.FilePath, fileName, pathName)
   rtitem.Save
End Sub

By default, the CreateImageResource will overwrite the existing image resource, so this will either create or update the image resource.  Pretty simple, eh?

Copyright © 2004 Genii Software Ltd.