question about concatenation
question about concatenation
I have two values and 2 string$ variables I need to concatenate. It doesn't like it. I have year day line$ and run$ and I need then as 1 value or string. I tried let lot$ = year + day + line$ + run$ but no dice. Any way to join these items as 1?
- {Nathan}
- Veteran
- Posts: 1169
- Joined: Thu Aug 19, 2004 6:08 pm
- Location: The wetlands of central Ohio, USA
- Contact:
Uhhh
thats kinda confusing, but i might know wut u wanna do. if some of thes little things you are tying to add are integers, then just use MK... uhh... i dunno wut the exact thing is, but it starts with mk. you con convert integers, singles, doubles to string. hope that helps!!!
- {Nathan}
- Veteran
- Posts: 1169
- Joined: Thu Aug 19, 2004 6:08 pm
- Location: The wetlands of central Ohio, USA
- Contact:
i...can...hELP
just do it like this
PRINT Varible1, Varible2
ect
easy, eh?
PRINT Varible1, Varible2
ect
easy, eh?
Er... no.
The way Nathan1993 suggested will have 4 or more spaces between the variables.
Here's the way to do it:
STR$ converts a number variable (integer, long, single, double) to a string. If the number is positive, it will have one space in front. That's why I use LTRIM$ as well. It removes spaces at the front of a string.
Hope it helped... again
And Nathan1993:
So, use STR$. Then the number 666 will just become " 666".
The way Nathan1993 suggested will have 4 or more spaces between the variables.
Here's the way to do it:
Code: Select all
lot$ = LTRIM$(STR$(year)) + LTRIM$(STR$(day)) + line$ + run$
PRINT lot$
Hope it helped... again
And Nathan1993:
You must mean MKI$, MKL$, MKS$ and MKD$. But these are not used for converting numbers to numerical strings. They are for converting numbers to strings bitwise. So if you have a number 666 and you make a string out of it using MKI$, you'll get CHR$(&H9A) + CHR$(02).Nathan1993 wrote:then just use MK... uhh... i dunno wut the exact thing is, but it starts with mk.
So, use STR$. Then the number 666 will just become " 666".