How do I compile functions and subs the right way

Results 1 to 2 of 2

Thread: How do I compile functions and subs the right way

  1. #1
    Join Date
    Dec 1969

    Default How do I compile functions and subs the right way

    I have written a security/membership application that has about thirty-something functions and several subroutines for various tasks such as …<BR><BR>Here are a few of the functions I wrote that return true/false value to evaluate off of.<BR><BR>bolValidCredentials(strUsername, strPassword)<BR>bolValidToken(strUsername, strToken)<BR>bolAccountExists(strUsername)<BR>bolA ccountCreated(strFName, strLName, strEMail, strUsername, strToken)<BR>bolAccountUpdated(strUsername, strFName, strLName, strEMail, strActive)<BR>bolAccountDeleted(strUsername)<BR>bo lPasswordSaved(strUsername, strPassword)<BR>bolMailSent(strTo, strBody, strSubject)<BR>bolMemberGrantedPrivilege(byVal strIn AS String)<BR>bolArray_Contains_Item(byVal aIn as Array, ByVal strIn As String)<BR>AuthenticationRequired(byVal strIn AS String)<BR><BR>I am currently using include files to group these together and make the code reusable, however I would like to move these functions over to something more secure and protected like a server control (I guess this is a DLL in the bin folder)<BR><BR>It may be important to note that some of the common functions use other common functions i.e. function bolValidCredentials might use bolAccountExists to check whether the account exists before continuing. <BR><BR>I do not have visual so I would like to learn how to do this without having to have it.<BR><BR>What I envision as my solution would be some way to be able to combine all of these functions and subs together in a compiled class of some sort that I could import in to each page needing the functionality. <BR><BR>So say I import this class of subs and functions into a page naming it XYZ_APP<BR>In my code where I wanted to use the functionality I would be able to do something like:<BR><BR><BR>If NOT XYZ_APP.bolAccountExists(“john”) Then<BR> ‘ Modify the john account<BR>Else<BR> ‘ Display message that the john account does not exists.<BR>End If<BR><BR>Thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: How do I compile functions and subs the right

    Search around on Google to find out how to command line compile. I have never made anything .net outside of visual studio so Im not exactly sure how, but I know it can be done.<BR><BR>What it sounds like you want is a class with shared functions. That way you do not have to instantiate an instance of this class, you can simply call it directly. Just put Public Shared in front of all the function/sub declarations. Any private functions you have in there is totally fine too, just add the shared to those as well. You could compile this class seperately, but I dont see a reason to.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts