Substring

From a var X type Char = 9, I pretend get each value to make a MATH operation on each value.

Ex: X = 789653124

I pretend

Get 7 and make some calc

Get 8 and make some calc

Get 9 and make some calc

I tryed with Substring function but I am not sure how to do that.

Thanks

Hi ,

you need copystr function to copy part of the string and eval to convert it .

g-

Hi

I tryed this

X= 852963741

X:= “VAT Registration No.”;
MESSAGE(‘CONT= %1’, X);

N:=(COPYSTR(X,1,9));

MESSAGE(‘The Value is %1’,N);

But N becames = 852963741

I want

N= 8

N=5

N=2

Thanks

Pls read the C/Side help!

Copies a substring of any length from a specific position in a string (text or code) to a new string.



<br>NewString := COPYSTR(String, Position[, Length])<br>

Parameters
String

Type: Text constant or code

The string that you want to copy from.

Position

Type: Integer

The position of the first character to copy. The value of Position must be greater than zero (0). If Position is greater than the length of the string, the system returns an empty string.

Length

Type: Integer

The number of characters to copy. Length must be greater than zero (0). If the value of Length results in Position + Length > (total length of the string), then the result includes all the characters from Position to the end of the string.