Grace Cheong
17th August 2011, 14:51
Hi,

I want to read some characters in a string using [string1(start_position;length)] that found in this forum. It's returned "0" value, could anyone tell me what's wrong in my script?


extern domain tcmcs.str50 Str
extern domain tcmcs.str50 TempStr
extern domain tcpono Len1
extern domain tcpono LenTemp
extern domain tcpono pos_space

TempStr = "Hello Today ABC XYZ" |-- 19
pos_space = pos(TempStr," ") |-- 6

LenTemp = len(TempStr) - (pos_space - 1) |-- 14
Len1 = len(TempStr) - LenTemp | -- 5
Str = TempStr(1 ; Len1)

Why Str return zero value "0" ?? Not "Hello" ?


Regards,
Grace

mark_h
17th August 2011, 14:58
Because str is a reservered word or function. Just use str1 or something like that.

Grace Cheong
18th August 2011, 03:45
Oic, i see. Ok, I try use another word, thanks!