Avatar of tazrebel
tazrebel

asked on 

String manipulation problems in VB6

I have some constatn strings defined in a module, for example:
Public Const B707_FMC_Debug_Config_Spec As String = "fmc_debug_config_spec.txt"
In the main part of my code i dont want to have to repeat code for every new name so i am trying to pass in the current name and concatenate it to the rest of the string. So for example, i insted of using B707_FMC_Debug_Config_Spec to retrieve the string i need. I need to pass in the main name and then build the string so retrieve the constant string. The code looks like this:

curPrgmConfigSpec = selectedProgram & "_DSIL_Config_Spec"

Im passing in selectedProgram, wich in this case is B707. But instead of "curPrgmConfigSpec"containing    
           fmc_debug_config_spec.txt
which is what it should resolve to;
it contains  
     B707_DSIL_Config_Spec
How can i get it to resolve to the constant i have declared in the module and not be seen as just a simple stirng? Your help is greatly appreaciated.
ProgrammingVisual Basic Classic

Avatar of undefined
Last Comment
sirbounty
SOLUTION
Avatar of Raynard7
Raynard7

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of tazrebel
tazrebel

ASKER

Thanks for the response. The case statement is exactly what i ended up doing. I am going to divide the points up between all of you. Thanks for the info!
Avatar of tazrebel
tazrebel

ASKER

I couldnt divide the points up exactly so one of you missed a point. My basis for awarding the last two entries the extra point was that their input took more time. And since i had already came to a solution on my own i thought it was fair to split it up. Hope everyone is ok with that.
Avatar of sirbounty
sirbounty
Flag of United States of America image

Happy to help - thanx for the grade! :^ )
Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo