Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

CODE: Setting Notes.ini preferences.
Mark Beaumont 18.Apr.02 11:08 AM a Web browser
Notes Client -- Other Release 5 Windows NT


Here is some code I wrote ages ago::

I used it in a button to set the web links on or off (bit #5), but there's no reason why the code cannot be altered to toggle any of the bits!

Mark.



Sub Click(Source As Button)
Dim PrefFile As String, BinPref As String, NewBinFile As String,newval As Double
Dim vNeg As Variant, dbPrefFile As Double, strpos As Integer

' Negative flag
vNeg = False
PrefFile = Sess.GetEnvironmentString( "Preferences", True )
dbPrefFile = Cdbl( PrefFile )
If dbPrefFile<0 Then
vNeg = True
dbPrefFile = 0 - dbPrefFile
End If
BinPref = Bin$( dbPrefFile )

strpos = Len( BinPref ) - 5
If Mid$( BinPref, strpos, 1 ) = "1" Then
Print "Adding Links.."
NewBinFile = Mid$( BinPref, 1 ,strpos-1) & "0" & Mid$( BinPref,strpos+1 )
Else
If Msgbox( "Are you sure - unset the web link hotspot?", 36,
"Confirm" ) = 6 Then
Print "Removing Links.."
NewBinFile = Mid$( BinPref, 1 ,strpos-1) & "1" & Mid$(BinPref, strpos+1 )
Else
Print "web hotspot link operation aborted.."
Exit Sub
End If
End If

newval = convbintoDBL( NewBinFile )
If vNeg Then newval = 0 - newval

Call Sess.SetEnvironmentVar( "Preferences", Cstr( newval ), True )
Print "web link operation completed... "
End Sub




Function convBinToDBL(strBin As String) As Double
Dim dTemp As Double , i As integer
dTemp = 0
For i = Len(strBin) To 1 Step -1
If Mid(strBin, i, 1) = "1" Then dTemp = dTemp + 2 ^ (Len(strBin)
- i)
Next i
convBinToDBL = dTemp
End Function



User Preferences and .ini settings (Robert Cameron 6.Jun.00)
. . RE: User Preferences and .ini setti... (Steve Held 6.Jun.00)
. . RE: User Preferences and .ini setti... (Paul K Smerdon 6.Jun.00)
. . RE: User Preferences and .ini setti... (Paul K Smerdon 6.Jun.00)
. . . . RE: User Preferences and .ini setti... (Patricia A Wool... 1.Aug.00)
. . . . RE: User Preferences and .ini setti... (Robert Wragg 8.Jan.01)
. . . . Programatically set "User Preferenc... (Tom Panucci 10.Oct.01)
. . . . . . RE: Programatically set "User Prefe... (Darren Crocker 11.Oct.01)
. . . . . . . . RE: Programatically set "User Prefe... (Tom Panucci 11.Oct.01)
. . . . . . . . . . RE: Programatically set "User Prefe... (Chris Hawkes 22.Nov.01)
. . . . . . . . . . . . CODE: Setting Notes.ini preferences... (Mark Beaumont 18.Apr.02)
. . . . . . . . . . . . CODE: Setting Notes.ini preferences... (Mark Beaumont 18.Apr.02)
. . . . . . Agent Update (Tom Panucci 11.Oct.01)
. . . . . . . . Addition to agent (Almar Diehl 3.Jul.02)
. . RE: User Preferences and .ini setti... (Darren Crocker 11.Oct.01)
. . RE: User Preferences and .ini setti... (John M Wargo 23.Jan.02)



Lotus Software


  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM accelerators
IBM Composite Applications
IBM Mashup Center
Lotus ActiveInsight
Lotus Connections
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Forms
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
LotusLive
LotusLive iNotes
LotusLive Meetings & Events
Lotus Mobile Connect
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Quickr
Lotus Sametime
Lotus Symphony
Lotus Web Content Management
Lotus Widget Factory
Lotus Workforce Management
WebSphere Dashboard Framework
WebSphere Portal
WebSphere Portal Express
WebSphere Portlet Factory

 Lotus Forums
Notes/Domino 8.5
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
Lotus ActiveInsight & WebSphere Dashboard Framework
Lotus Connections
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Forms
Lotus Labs
LotusLive Meetings
Lotus Mobile Connect
Lotus Quickr
Lotus Sametime
Lotus Sametime Unyte Events
Lotus Sametime Unyte Share
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Web Content Management
Lotus Widget Factory
Lotus Workflow
Lotus Workforce Management