Subject: | |
From: | |
Reply To: | |
Date: | Mon, 15 Jan 2001 15:03:26 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
The negative value for the third parameter doesn't mean "count backwards",
it means an ending position. So STR(text,2,5) means start in position two
and extract a 5-character string, and STR(text,2,-5) means start in position
2 and end in position 5 (4 characters). In your example the ending position
is before the starting position, which is invalid.
-----Original Message-----
From: Paul H Christidis [mailto:[log in to unmask]]
Sent: Monday, January 15, 2001 2:44 PM
To: [log in to unmask]
Subject: STR function broken in 6.0 pp2
Used the following commands to extract a substring:
:setvar indx 8
:setvar text "abcdefgh"
:setvar subt STR(text, indx, -4)
:showvar subt
SUBT =
:echo ![LEN(subt)]
0
According to the help text of the STR function, the above should have
assigned the string "efgh" to the variable 'subt'. Instead it assigned a
'null' string to it.
Anyone else has encountered the above.
Regards
Paul Christidis
|
|
|