While trying to find out where is the last login used saved, and why it comes blank if the software didn't exit normally, we found the following function:
public function string uf_busca_ultimo_login ();
//=======================================================
// Function: uf_busca_login.
// Returns: boolean
// True - operation carried out with success.
// False - operation with error.
// Argument:
// Description:
// Verifies if the user's login.
//=======================================================
String ls_login
Select LOGIN_USUARIO
Into :ls_login
From LOG_NAVEGACAO
Where DT_LOG = (Select max(DT_LOG) from LOG_NAVEGACAO )
Using Sqlca;
If Sqlca.SqlCode <> 0 Then
ls_login = ''
Else
// Adds 1 to the branch code
If IsNull(ls_login) Then
ls_login = ''
End If
End If
Return ls_login
end function
(Comments have been translated for your enjoyment; any grammar errors on them were there in the original, except perhaps the "carried out" which was "realizada". DT_LOG is a DATE field.)