![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Thu, Sep 14 2017 5:20 AM | Permanent Link |
Matthew Jones | How can I make a char from an int? That is, I want
myChar := 'a' + nRandom; I thought the StringBuilder might solve it, but it needs a char. Is there a smart way? (My current solution is an index into a string, which is clumsy) -- Matthew Jones |
Thu, Sep 14 2017 7:48 AM | Permanent Link |
Walter Matte Tactical Business Corporation | Untested....
myChar := chr( ord('a') + nRandom ); Walter "Matthew Jones" wrote: How can I make a char from an int? That is, I want myChar := 'a' + nRandom; I thought the StringBuilder might solve it, but it needs a char. Is there a smart way? (My current solution is an index into a string, which is clumsy) -- Matthew Jones |
Thu, Sep 14 2017 8:37 AM | Permanent Link |
Matthew Jones | Walter Matte wrote:
> myChar := chr( ord('a') + nRandom ); Ahah! Chr() being the magic. It would be nice if conversion routines like this were listed in the Casting section, which I looked in. Many thanks. -- Matthew Jones |
Fri, Sep 22 2017 2:40 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Matthew,
<< Ahah! Chr() being the magic. It would be nice if conversion routines like this were listed in the Casting section, which I looked in. Many thanks. >> It's the same reason IntToStr isn't in the casting section. Casts are type conversions that are performed based upon the types being type-compatible, whereas conversions like this are done between incompatible types. In other words, they're simply used for ensuring the compiler understands what you already know, not providing any additional functionality/dimensions to the actual underlying value. Tim Young Elevate Software www.elevatesoft.com |
Mon, Sep 25 2017 3:41 AM | Permanent Link |
Matthew Jones | Tim Young [Elevate Software] wrote:
> It would be nice if conversion routines like this were listed in the Casting section, which I looked in. Many thanks. >> > > It's the same reason IntToStr isn't in the casting section. I'm happy for it to be a link to the summary "conversion functions" page. 8-) -- Matthew Jones |
This web page was last updated on Wednesday, November 29, 2023 at 09:43 PM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |