* :--------------------------------------- * ------------------------: Copybook for GetUserName * : See the documentation for details. * :--------------------------------------- * * : Note: This API retrievs the name of * : the currently logged in user. * : Usefull if you need to keep * : track of where transactions * : originate. * To use: * * -----Get Computer Name Example ----------------------- * COPY WIN32API. * COPY GETUSRNM. * . * . * ------------------------: Call the API to get the value * * SET API-GETUSERNAME TO TRUE. * CALL 'GSWINAPI' USING WIN32API-PARMS * API-USER-NAME * WIN32API-B * WIN32API-C * WIN32API-D * WIN32API-E * WIN32API-F. * * ------------------------: If function failed, * : display a textual error message. * * IF WIN32API-FAILED * MOVE WIN32API-ERROR-TEXT TO my-error-message * do whatever to display my-error-message. * * * : This returned value will be a * : low-value terminated string. The exact * : length (including the low-value) will * : be found in WIN32API-RC 01 API-USER-NAME PIC X(260).