can you do API calls in MapBasic??   i don't werk with mapbasic, rather use
VB to control it, so here's the way to get the user name:

        Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
            "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

        Function fOSUserName() As String
        Dim lngLen As Long, lngX As Long
        Dim strUserName As String
        strUserName = String$(254, 0)
        lngLen = 255
        lngX = apiGetUserName(strUserName, lngLen)
        If lngX <> 0 Then
            fOSUserName = Left$(strUserName, lngLen - 1)
        End Function

then it's just a matter of setting your username variable to the function:
        MapInfoUser = fOSUserName


hope it helps.



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, 27 June 2002 6:53 PM
To: [EMAIL PROTECTED]
Subject: MI-L Calling a User ID


I am building a script to automatically tag a line with the name of the
person who digitised it.

I would like to call the Windows UserName of the currently logged on user to
do this.

Does anyone know how to call the name of the currenltly logged on user with
a MapBasic script?

Andrew
 


This E-mail and any files transmitted with it are private and intended
solely for the use of the individual or entity to whom they are addressed.
If you are not the intended recipient, the E-mail and any files have been
transmitted to you in error and any copying, distribution or other use of
the information contained in them is strictly prohibited.

Nothing in this E-mail message amounts to a contractual or other legal
commitment on the part of English Nature unless confirmed by a signed
communication.

English Nature will make every effort to keep its network free of viruses.
However, the recipient of this message will need to scan this message, and
any attachments, for viruses, as English Nature can take no responsibility
for any computer virus that might be transferred by this e-mail.

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to