<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="PT-BR" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thanks!</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">And to revert the string in the enumerator, exists a function?</p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><b>De: </b><a href="mailto:pas2js-request@lists.freepascal.org">pas2js-request@lists.freepascal.org</a><br>
<b>Enviado:</b>sábado, 24 de junho de 2023 07:00<br>
<b>Para: </b><a href="mailto:pas2js@lists.freepascal.org">pas2js@lists.freepascal.org</a><br>
<b>Assunto: </b>Pas2js Digest, Vol 59, Issue 2</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Send Pas2js mailing list submissions to<br>
        pas2js@lists.freepascal.org<br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js">https://bra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freepascal.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fpas2js&data=05%7C01%7C%7C64a6c1cdfdb341236ecf08db7499c825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638231976088750515%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oTom8QwwBLBsG9IwEwnL3TV5%2B7RJIEBMkarwnpJ44CA%3D&reserved=0</a><br>
or, via email, send a message with subject or body 'help' to<br>
        pas2js-request@lists.freepascal.org<br>
<br>
You can reach the person managing the list at<br>
        pas2js-owner@lists.freepascal.org<br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Pas2js digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Enum as an const (Henrique Gottardi Werlang)<br>
   2. Re: Enum as an const (Michael Van Canneyt)<br>
   3. Re: Enum as an const (Mattias Gaertner)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 23 Jun 2023 17:54:53 +0000<br>
From: Henrique Gottardi Werlang <henriquewerlang@hotmail.com><br>
To: "pas2js@lists.freepascal.org" <pas2js@lists.freepascal.org><br>
Subject: [Pas2js] Enum as an const<br>
Message-ID:<br>
        <CP4P284MB17317ADDD53BBBDF4009EA87B223A@CP4P284MB1731.BRAP284.PROD.OUTLOOK.COM><br>
        <br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
It possible to convert an enumerator in a const string?<br>
<br>
For example I declare a enumerator:<br>
<br>
TMyEnumerator = (MyEnum1, MyEnum2, MyEnum3);<br>
<br>
In the generated JS file, it is possible do convert the enumerator value in a const string, like, "MyEnum1"?<br>
<br>
Thanks.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.freepascal.org/pipermail/pas2js/attachments/20230623/b9d94fd7/attachment-0001.htm">https://bra01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.freepascal.org%2Fpipermail%2Fpas2js%2Fattachments%2F20230623%2Fb9d94fd7%2Fattachment-0001.htm&data=05%7C01%7C%7C64a6c1cdfdb341236ecf08db7499c825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638231976088750515%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jh1V1ilFq7uauh8%2FcbfVCG4j5bP73TZ%2BQKuocp5Ndbk%3D&reserved=0</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 23 Jun 2023 20:04:45 +0200 (CEST)<br>
From: Michael Van Canneyt <michael@freepascal.org><br>
To: Henrique Gottardi Werlang via Pas2js <pas2js@lists.freepascal.org><br>
Subject: Re: [Pas2js] Enum as an const<br>
Message-ID: <alpine.DEB.2.22.394.2306232004170.215464@home><br>
Content-Type: text/plain; charset=US-ASCII; format=flowed<br>
<br>
<br>
<br>
On Fri, 23 Jun 2023, Henrique Gottardi Werlang via Pas2js wrote:<br>
<br>
> It possible to convert an enumerator in a const string?<br>
><br>
> For example I declare a enumerator:<br>
><br>
> TMyEnumerator = (MyEnum1, MyEnum2, MyEnum3);<br>
><br>
> In the generated JS file, it is possible do convert the enumerator value in a const string, like, "MyEnum1"?<br>
<br>
The compiler actually generates the strings, see:<br>
<br>
<a href="https://wiki.freepascal.org/Pas2js_Transpiler#Translating_enums">https://bra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.freepascal.org%2FPas2js_Transpiler%23Translating_enums&data=05%7C01%7C%7C64a6c1cdfdb341236ecf08db7499c825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638231976088750515%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CjdxFIpEpKDWsb9hOUShwrOwkcVVMMG20L7veGI63YU%3D&reserved=0</a><br>
<br>
Michael.<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Sat, 24 Jun 2023 08:59:17 +0200<br>
From: Mattias Gaertner <nc-gaertnma@netcologne.de><br>
To: pas2js@lists.freepascal.org<br>
Subject: Re: [Pas2js] Enum as an const<br>
Message-ID: <20230624085917.5ce5fa1d@limapholos><br>
Content-Type: text/plain; charset=US-ASCII<br>
<br>
On Fri, 23 Jun 2023 20:04:45 +0200 (CEST)<br>
Michael Van Canneyt via Pas2js <pas2js@lists.freepascal.org> wrote:<br>
<br>
> On Fri, 23 Jun 2023, Henrique Gottardi Werlang via Pas2js wrote:<br>
> <br>
> > It possible to convert an enumerator in a const string?<br>
> ><br>
> > For example I declare a enumerator:<br>
> ><br>
> > TMyEnumerator = (MyEnum1, MyEnum2, MyEnum3);<br>
> ><br>
> > In the generated JS file, it is possible do convert the enumerator<br>
> > value in a const string, like, "MyEnum1"?  <br>
> <br>
> The compiler actually generates the strings, see:<br>
> <br>
> <a href="https://wiki.freepascal.org/Pas2js_Transpiler#Translating_enums">https://bra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.freepascal.org%2FPas2js_Transpiler%23Translating_enums&data=05%7C01%7C%7C64a6c1cdfdb341236ecf08db7499c825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638231976088750515%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CjdxFIpEpKDWsb9hOUShwrOwkcVVMMG20L7veGI63YU%3D&reserved=0</a><br>
<br>
... which can be used with<br>
<br>
str(MyEnum1)<br>
<br>
or<br>
<br>
str(e)<br>
<br>
<br>
Mattias<br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
Pas2js maillist  -  Pas2js@lists.freepascal.org<br>
<a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js">https://bra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freepascal.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fpas2js&data=05%7C01%7C%7C64a6c1cdfdb341236ecf08db7499c825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638231976088750515%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oTom8QwwBLBsG9IwEwnL3TV5%2B7RJIEBMkarwnpJ44CA%3D&reserved=0</a><br>
<br>
<br>
------------------------------<br>
<br>
End of Pas2js Digest, Vol 59, Issue 2<br>
*************************************<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>