HP3000-L Archives

January 2001, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Clogg <[log in to unmask]>
Reply To:
John Clogg <[log in to unmask]>
Date:
Mon, 15 Jan 2001 15:03:26 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (32 lines)
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

ATOM RSS1 RSS2