cosfreelance
MIS
Hi All
I have a script that opens a text file and does some data extraction. the extracted data is then saved to a delimited txt file. A part of the script picks up the full country name as in "United States". I need to replace the "United States" with "USA". I have about 100 countries.
I have created a function within the same script that looks up, and replaces the Long Name with the Abbrevation. This works as expected. My question is how do call the Countrylook up function from the main script
Main Script
***********
Function Main(afile)
--------> Start Data extraction Code
strCountry = (strCountryName)
strCountry = CountryLookup(strCountry) -----> how do i call the function, and set the strCountry value to the value found in the CountryLookup function?
--------> End Data extraction Code
End Function
Country Lookup Function
***********************
Function CountryLookup(aCountry)
Select Case (aCountry)
CASE "United States" CCODE = ("USA")
"
"
"
CASE "Other Country " CCODE = ("OC")
Case Else CCODE = (strError)
End Select
End Function
The strCountry = CountryLookup(strCountry) does not work.
Many thanks
I have a script that opens a text file and does some data extraction. the extracted data is then saved to a delimited txt file. A part of the script picks up the full country name as in "United States". I need to replace the "United States" with "USA". I have about 100 countries.
I have created a function within the same script that looks up, and replaces the Long Name with the Abbrevation. This works as expected. My question is how do call the Countrylook up function from the main script
Main Script
***********
Function Main(afile)
--------> Start Data extraction Code
strCountry = (strCountryName)
strCountry = CountryLookup(strCountry) -----> how do i call the function, and set the strCountry value to the value found in the CountryLookup function?
--------> End Data extraction Code
End Function
Country Lookup Function
***********************
Function CountryLookup(aCountry)
Select Case (aCountry)
CASE "United States" CCODE = ("USA")
"
"
"
CASE "Other Country " CCODE = ("OC")
Case Else CCODE = (strError)
End Select
End Function
The strCountry = CountryLookup(strCountry) does not work.
Many thanks