cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Design forum

Variable within Text

Lingwisyer
Legend
Hi all,
Figured this would similar to how it is in excel and basic but I can't figure out how to do it...

1. How do you insert a variable into a text string? eg. "1:variable_x @ A1"
2. How can you insert a text string at the end of a calculation? eg. variable_y=variable_x*5 "outlets"


Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
1 ACCEPTED SOLUTION
1 REPLY 1

Solution
Barry Kelly
Moderator
Lingwisyer wrote:
1. How do you insert a variable into a text string? eg. "1:variable_x @ A1"
If variable_x is a string value then you can just concatenate (add) them together.
"1:" + variable_x + "@ A1"
If variable_x is a numeric value then you have to convert it to a string.
"1: " + STR(variable_x,2,0) + " @ A1"
Lingwisyer wrote:
2. How can you insert a text string at the end of a calculation? eg. variable_y=variable_x*5 "outlets"
variable_y must be a string variable of course.
Then same as before if variable_x is a string value then you can just concatenate (add) them together.
variable_y = variable_x + "*5 outlets"
If variable_x is a numeric value then you have to convert it to a string.
variable_y = STR(variable_x,2,0) + "*5 outlets"
Or if you actually want to multiplt variable_x * 5 then
variable_y = STR(variable_x*5,2,0) + " outlets"

Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Didn't find the answer? Start a new discussion

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!