473,385 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help with string

Hi, i need some help with string. I like to build a string containing
some other variable name and use the variable as if the on inside as been
transfom to there contain:
Exemple

dim a as string
dim b as integer
dim c as string
dim d as string

c = "abcd"
d = "defg"
b = 1
if some condition
a = "c = b"
else
a = "d "
calcul
b = xyz

b become 12 for exemple

print a

I like to be able to have the variable a = "abcd = 12"
or = "defg" depending of the if condition.

i think the name of this transform is indirection but Im not sure

Help me I'm dont know what to do about that

Thank you for your help
Mike
Jan 19 '06 #1
3 4563

"Michel Gilbert" <mg******@shr.cmac.com> wrote in message
news:Y7*******************@news20.bellglobal.com.. .
Hi, i need some help with string. I like to build a string containing
some other variable name and use the variable as if the on inside as been
transfom to there contain:
Exemple

dim a as string
dim b as integer
dim c as string
dim d as string

c = "abcd"
d = "defg" if some condition
a = "c = b"
else
a = "d " b become 12 for exemple I like to be able to have the variable a = "abcd = 12"
or = "defg" depending of the if condition.


I am not sure if I understand, but I think you want

a = c & " = " & b

which would make a be "abcd = 12"
Do not put the variables inside of the "quote" marks.
Instead, use & to build a string.

a = c & " = " & b

means make a be equal to
whatever is in c
followed by " = "
followed by whatever is in b
Jan 20 '06 #2
not exactly: i want to be able to change the contain of the variable A.
I want to build the contain of the variable A at the run time, then at the
end i print A. The text part is print as is but the variable is replace with
there content. Before the end I don't know what will be in the A. It could
be ex: "B text C kjkkjk" or "text B C rytytyt" or " B lkjhkjhaskjh" etc...
But i want to be able to print ex: if B = "Lucy" C = "Mark" A = "Lucy text
Mark kjkkjk" or "text Lucy MarK rytytyt" or " Mark lkjhkjhaskjh" etc...
I lok in the wikipedia and it's is call "indirection" if you want the
definition

Thank you for your help

"Steve Gerrard" <my********@comcast.net> a écrit dans le message de
news:T9********************@comcast.com...

"Michel Gilbert" <mg******@shr.cmac.com> wrote in message
news:Y7*******************@news20.bellglobal.com.. .
Hi, i need some help with string. I like to build a string containing
some other variable name and use the variable as if the on inside as been transfom to there contain:
Exemple

dim a as string
dim b as integer
dim c as string
dim d as string

c = "abcd"
d = "defg"

if some condition
a = "c = b"
else
a = "d "

b become 12 for exemple

I like to be able to have the variable a = "abcd = 12"
or = "defg" depending of the if condition.


I am not sure if I understand, but I think you want

a = c & " = " & b

which would make a be "abcd = 12"
Do not put the variables inside of the "quote" marks.
Instead, use & to build a string.

a = c & " = " & b

means make a be equal to
whatever is in c
followed by " = "
followed by whatever is in b

Jan 20 '06 #3

"Michel Gilbert" <mg******@shr.cmac.com> wrote in message
news:gY********************@news20.bellglobal.com. ..
not exactly: i want to be able to change the contain of the variable A.
I want to build the contain of the variable A at the run time, then at the
end i print A. The text part is print as is but the variable is replace with
there content. Before the end I don't know what will be in the A. It could
be ex: "B text C kjkkjk" or "text B C rytytyt" or " B lkjhkjhaskjh" etc...
But i want to be able to print ex: if B = "Lucy" C = "Mark" A = "Lucy text
Mark kjkkjk" or "text Lucy MarK rytytyt" or " Mark lkjhkjhaskjh" etc...
I lok in the wikipedia and it's is call "indirection" if you want the
definition


If at runtime A could be "B text C kjkkjk", or it could be "B lkjhkjhaskjh",
then you would need to parse the text to find the variable names in it.

If A contained "B & ""text"" & C & ""kjkkjk""", or something like that, you
could use a script control, add the variables B and C to it, and have it
evaluate the expression for you.

Either way, you would need to have some very strict rules about the content of
A, and how the variables in it are delimited and identified.
Jan 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
7
by: Alan Bashy | last post by:
Please, guys, In need help with this. It is due in the next week. Please, help me to implement the functions in this programm especially the first three constructor. I need them guys. Please, help...
1
by: wukexin | last post by:
I write my own class Cfile, I want to know what about implement ctime().Who help me? My use function ctime, I sign it with $$$. my class Cfile: #------------------------ file.h...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
18
by: James Radke | last post by:
Hello, We are currently using a user DLL that when working in VB 6.0 has a user defined type as a parameter. Now we are trying to use the same DLL from a vb.net application and are having...
16
by: Allen | last post by:
I have a class that returns an arraylist. How do I fill a list box from what is returned? It returns customers which is a arraylist but I cant seem to get the stuff to fill a list box. I just...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
22
by: KitKat | last post by:
I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam 7, and Cam 8. Well it does that but it also needs to change the file name to the same folder where the file is being...
6
by: JonathanOrlev | last post by:
Hello everyone, I have a newbe question: In Access (2003) VBA, what is the difference between a Module and a Class Module in the VBA development environment? If I remember correctly, new...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.