18.01.2013 Views

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

If you move your code to Win32 (Windows 95 or Windows NT) the API call<br />

no longer works. A new API call GetProfileStringA has been created to<br />

handle the UNICODE requirements of strings under the 32-bit plat<strong>for</strong>m.<br />

New <strong>Visual</strong> <strong>Basic</strong> Statements<br />

In its most recent release, <strong>Visual</strong> <strong>Basic</strong> now supports GetSetting,<br />

SaveSetting and DeleteSetting commands that provide access to the registry<br />

on a 32-bit plat<strong>for</strong>m (in order to save parameters) and to standard INI files<br />

on 16-bit plat<strong>for</strong>ms.<br />

Wrapper Examples<br />

Lotus provides <strong>LotusScript</strong> wrappers around a number of common APIs,<br />

such as the Win16 WriteProfileString, in an .LSS file called LTSSL30.LSS. If<br />

you desire to use the WriteProfileString, GetProfileInt, GetProfileString API<br />

calls directly in <strong>Visual</strong> <strong>Basic</strong>, you will need to provide wrapper functions<br />

similar to those provided in the Lotus LTSSL30.LSS file.<br />

'——————————————————————————————<br />

' GetProfString<br />

' This function returns a profile string from the specified<br />

' ini file. If the filename passed is "", then the string<br />

will<br />

' be searched <strong>for</strong> in the WIN.INI file<br />

'——————————————————————————————<br />

Public Function GetProfString(Section as String, Entry as<br />

String, Filename as String, DString as String) as String<br />

Dim retstr as String*256<br />

Dim retval as Integer<br />

If filename = "" then<br />

Else<br />

retval = GetProfileString(Section, Entry, DString,<br />

retstr, 256)<br />

retval = GetPrivateProfileString(Section, Entry, DString,<br />

End If<br />

retstr, 256,Filename)<br />

GetProfString = Left$(retstr, retval)<br />

End Function<br />

16 <strong>LotusScript</strong> <strong>for</strong> <strong>Visual</strong> <strong>Basic</strong> <strong>Programmers</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!