Patrick,
You seem to keep ignoring the answers posted. Look:
1. In xHarbour, any string of 1 Character has a SUB TYPE called CHAR.
2. xHarbour type CHAR is compatible in ANY NUMERIC context, which means you
can do:
sString := "Hello"
sEncripted := ""
FOR EACH cChar IN sString
sEncripted += cChar - HB_EnumIndex()
NEXT
This also means that it's supported at the lowest SYSTEM LEVEL, so even
hb_itemGetNI()/hb_itemGetND(), etc, know to support CHAR as NUMERIC.
This extension has been created many years back, from the very start of
xHarbour, and it was exactly this kind of arguments that pushed me to create
xHarbour. Those that prefer to be error compatible should be using Clipper.
Ron
--------------------------------------------------
From: "Patrick Mast, xHarbour." <[email protected]>
Sent: Thursday, April 02, 2009 12:46 PM
To: "Marcelo Lombardo" <[email protected]>
Cc: "xHarbour Developers Mailing List"
<[email protected]>
Subject: Re: [xHarbour-developers] Str() function.
> Hello Marcelo,
>
>> As Ron said, this is intentional. This is a xHB extension like:
>> a := "ABCD"
>> ? a[2] // prints "B", no RT error
>
> Yes, I understand, but:
> Str("a",1,0) is useless no?
>
> The first parameter of STR() should be numeric.. I'm only talking
> about giving a character parameter to STR(). STR() is not build to
> accept a character parameter and thus should produce a RT error.
>
> Patrick
>
> ------------------------------------------------------------------------------
> _______________________________________________
> xHarbour-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xharbour-developers
>
------------------------------------------------------------------------------
_______________________________________________
xHarbour-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xharbour-developers