| || |
Getting String Names From A Shared Module
I have a shared module called Declarations that looks like:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Public Sub CollateralReleaseLookUpNames()
Dim CRScrName1, CRScrName2, CRScrName3, CRScrName4, CRScrName5, _
CRScrName6, CRScrName7, CRScrName8, CRScrName9, CRScrName10 As String
CRScrName1 = "Lookup: Customer" '0
CRScrName2 = "Lookup: Cllateral ID" 'Starts Win
CRScrName3 = "Lookup: Reason" '0
CRScrName4 = "Lookup: Destination" '3
CRScrName5 = "Lookup: Auto Deposit Location" '3
CRScrName6 = "Lookup: Release Form" '0
CRScrName7 = "Lookup: Carrier" '0
CRScrName8 = "Lookup: New Investor" ' Blank
CRScrName9 = "Lookup: New Custodian" '0
CRScrName10 = "Lookup: Home Loaction" '3
End Sub</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">In my script I have:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">'$TPInclude "Declarations"
Dim FlagC As Integer
hfile4 = FreeFile()
Open "CS:\PMe\DF\Ce.txt" For Input As #hfile4
Do While Not EOF(hfile4)
Input #hfile4, Customer, Collateral_ID, Effective_Release_Date, Reason, Requestor, Request_Date, Amend, Reject, Destination_Type, Destination, Auto_Deposit_Location, _
Address_Override, Addressee_Name, Addressee_Title, Address, Address_2, City, State, Zip, Release_Form, Carrier, Courier_Tracking_Number, Shipping_Reference_Number, _
Return_Due_Date, Notation, New_Investor, New_Commitment_Number, New_Price, Commit_Expiration, Investor_ID, New_Custodian, Home_Location_Option, Home_Location
Call CollateralReleaseLookUpNames</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">But I can't retain the value "CRScrName9" being "Lookup: New Custodian". I have included the module name and even ran it both with and without calling the function name in the shared module. This declarations module is where I would like to define all the screen name so if they change I only need to change them in one place.
In Short, how do you call a shared module and retain the values set in the shared module?
Re: Getting String Names From A Shared Module
Since this is VBA (I don't have experience with TestPartner, but I do know VBA) you might want to change those Variables in the Subroutine to be globally defined Constants in your Include file. The variables being declared (DIM) in the subroutine make them "Local" (or Private) instead of "Global" (or Public) like you would need them to be. (I'm surprised that the other CRScrName variables would work either).
Look up the difference between Public and Private Variables and Constants and that will get you on the right track.