combine a numeric variable and an alpha variable
combine a numeric variable and an alpha variable
Good morning! I have a problem. I would like to combine a numeric variable and an alpha variable into a single variable to create an identification code. I do not know how to do
Re: combine a numeric variable and an alpha variable
Good morning,
For this you can make use of the CONCAT function, which allows you to concatenate texts.
https://www.csprousers.org/help/CSPro/c ... ction.html
In the case of concatenating with variables of type integer, use the edit function for each integer variable, which returns a character string of the numeric value.
https://www.csprousers.org/help/CSPro/e ... ction.html
Example
Province = 1;
Distrit = "02";
strProvince = EDIT("99", Province);
Then you use that variable within the concatenation you want to perform.
ID_Map = CONCAT(strProvince , Distrit);
I hope you find it useful
For this you can make use of the CONCAT function, which allows you to concatenate texts.
https://www.csprousers.org/help/CSPro/c ... ction.html
In the case of concatenating with variables of type integer, use the edit function for each integer variable, which returns a character string of the numeric value.
https://www.csprousers.org/help/CSPro/e ... ction.html
Example
Province = 1;
Distrit = "02";
strProvince = EDIT("99", Province);
Then you use that variable within the concatenation you want to perform.
ID_Map = CONCAT(strProvince , Distrit);
I hope you find it useful
Re: combine a numeric variable and an alpha variable
Hello!
I tried to combine two texts with this code but it doesn't work.
PROC A5
A3 = "AA";
A4 = "BBBB";
string A5 = concat(A3," ", A4); // A5 is: TT BBBB
I tried to combine two texts with this code but it doesn't work.
PROC A5
A3 = "AA";
A4 = "BBBB";
string A5 = concat(A3," ", A4); // A5 is: TT BBBB
-
- Posts: 218
- Joined: November 21st, 2022, 4:41 pm
Re: combine a numeric variable and an alpha variable
Hello,
The code snippet you provided is in the postproc of A5, and uses A5 as the name of both a proc and a string variable, which is not allowed. Without the context of the rest of the app it's difficult to tell where the item A3 might be set to "TT" rather than being set to "AA". You can try testing concatenating with string variables to see how concatenation should be working and where your dictionary items have unexpected values.
Hope that helps,
Justin
The code snippet you provided is in the postproc of A5, and uses A5 as the name of both a proc and a string variable, which is not allowed. Without the context of the rest of the app it's difficult to tell where the item A3 might be set to "TT" rather than being set to "AA". You can try testing concatenating with string variables to see how concatenation should be working and where your dictionary items have unexpected values.
Hope that helps,
Justin
Re: combine a numeric variable and an alpha variable
Hello
Many thanks for your help.
Many thanks for your help.