Blogs

  • Browse Blogs
  • My Blog
  • My Updates

Tags Help

  • View as cloud  | list

Similar Blogs

photo

Yellow is the...

55 Entries |  Tim Tripcony
Updated 
No Ratings 0     Comments 22
photo

TexasSwede

66 Entries |  Karl-Henry Martinsso...
Updated 
No Ratings 0     Comments 59
photo

Lotus Nut

69 Entries |  Chris Whisonant
Updated 
Ratings 4     Comments 96
photo

Urs Meli

19 Entries |  Urs Meli
Updated 
No Ratings 0     Comments 14
photo

Uh Clem's Adm...

35 Entries |  Chris Mobley
Updated 
Ratings 5     Comments 42

Dogear Bookmarks

.Domino Framework

Blog Authors:  Peter Presnell  

All entries tagged with files

@GetFile & @GetFileContents

Peter Presnell  |     |  Tags:  .dominoframework files  |  Comments (0)

The 0.6 Beta of the .DominoFramework already included a LotusScript implementation of the hypothetical @GetFile function.  This provides a shortuct to request the operating system to prompt the  user to select a file from the operating system using an undocument option of the NotesUIWorkspace.Prompt method:-

'/**
' * Prompts user to select a OS file using undocumented UIW.Prompt option
' *
' * @author Peter Presnell
' * @param  Default File Initial file name 
' * @return  Name of selected file (empty if cancel selected)
' */
Function atfGetFile(DefaultFile As String) As String
 Dim Title As String
 If DB Is Nothing Then Title$ = ".Domino Framework" Else Title$ = DB.Title$
 atfGetFile$ = Cstr(UIW.Prompt(12,Title$,"",DefaultFile$))
End Function

The next release of the .Domino Framework will also provide an implementation of the hypothetical @GetFileContent function.  This function can either take a filename as a parameter or prompt the user for a filename and then returns the contants of that filename in a NotesStream.  Again it acts as a shortuct way of getting the contents of a file without the need to repeat the LotusScript code to do this.

'/** ' * Reads the contents of a nominated file ' * ' * @author Peter Presnell ' * @param Source NAme of file to be read (Where non is provided the user is prompted to provide the file name) ' * @returns NotesSTream containing the contents of the file ' */ Function atfGetFileContent(Source As Variant) As NotesStream Dim FileName As String ' Name of file whose content is to be read Dim FileNum As Integer ' File number Dim Text As String ' Line of text read from file Try: On Error Goto Catch If Session.IsOnServer Then Exit Function Set atfGetFileContent = Session.CreateStream() Select Case Typename(Source) Case "STRING" If FileName$ = "" Then FileName$ = atfGetFile("") Else FileName$ = Cstr(Source) Case Else FileName$ = atfGetFile("") End Select If (FileName$ = "") Then Exit Function FileNum% = Freefile() Open FileName$ For Input As FileNum% Do While Not Eof(FileNum%) Line Input #FileNum%, Text$ Call atfGetFileContent.WriteText(Text$,EOL_CRLF) Loop atfGetFileContent.Position& = 0 Goto Finally Catch: Stop Call ReportError() Resume Finally Finally: If (FileNum% <> 0) Then Close FileNum% End Function

Skip to main content link. Accesskey S
IBM Lotus Connections Help Tools About

Tags

A tag is a keyword that is used to categorize an entry. To view the entries with a particular tag, click a tag name or enter a tag in the box.
The tag cloud indicates the frequency of tag use. Popular tags appear darkest. The slider control adjusts how many tags are displayed in the tag cloud.