Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / beginner help with strings and variables

Author
Message
Dragon of Logic
21
Years of Service
User Offline
Joined: 10th Sep 2003
Location:
Posted: 6th Oct 2003 20:01
Hello, I am trying to do something quite simple, but my brain doesn't seem to want to give me the answer. I have 2 variables defined and I want to combine the variables with some text in a new string, like follows:

varA$ = "name"
varB$ = "occupation"

test$ = "Thank you (insert varA$ here). I see you work as a (insert varB$ here)."

I tried to do it like:

test$ = "Thank you " +varA$ "I see you work as a " +varB$

But I obviously am not doing it right.
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 6th Oct 2003 20:05
The problem is you have you have to insert +'s behind the variables aswell, so you'd use

test$ = "Thank you " +varA$+ " I see you work as a " +varB$

instead.

I would be unstoppable if I could just get started...
Dragon of Logic
21
Years of Service
User Offline
Joined: 10th Sep 2003
Location:
Posted: 6th Oct 2003 20:40
Thanks a lot!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Oct 2003 03:16
you can also concatenate strings with semicolons, as well

PRINT "Hello, ";strName;". I see you work as a ";strOccupation

-RUST-

Login to post a reply

Server time is: 2024-11-25 11:32:58
Your offset time is: 2024-11-25 11:32:58