The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Representative function

Last post 09-10-2008 1:57 PM by cesarb. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-10-2008 1:57 PM

    • cesarb
    • Not Ranked
    • Joined on 04-17-2008
    • Posts 2

    Representative function

    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.)

Page 1 of 1 (1 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems