Interger

48 views
Skip to first unread message

ideasandinno...@gmail.com

unread,
Jul 12, 2014, 3:37:15 AM7/12/14
to suppor...@runmyprocess.com
Hi

I need to convert a string value to integer in runmyprocess. What is the corresponding code?

Thanks

Sweta Suman

unread,
Jul 12, 2014, 4:59:46 AM7/12/14
to suppor...@runmyprocess.com
Hi,

In your scenario, input values are number?

If it is in number then you can use JavaScript function "parseInt()" or "parseFloat()" to convert your string value into an integer.

Please feel free to ask.

Thanks & Regards
Sweta



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/f76e9a46-3d7e-477e-a8bc-dc10a9e26d56%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

ideasandinno...@gmail.com

unread,
Jul 12, 2014, 5:07:08 AM7/12/14
to suppor...@runmyprocess.com
<#function get_array my_father my_son>
<#if my_father?is_hash>
<#if my_father[my_son]?exists>
<#if my_father[my_son]?is_sequence>
<#assign my_array = my_father[my_son]>
<#else>
<#assign my_array = [my_father[my_son]]>
</#if>
<#else>
<#assign my_array = []>
</#if>
<#else>
<#assign my_array = []>
</#if>
<#return my_array>
</#function>

<#assign my_entries = get_array(P_result.feed,"entry")>

<#list my_entries as x>
${x.oano}
</#list>

I need to get the length of x.oano. What can be done?

Sweta Suman

unread,
Jul 12, 2014, 6:19:06 AM7/12/14
to suppor...@runmyprocess.com
Hi,

To get the length of an array, you have to use "array_name?size".

As per your case, use "${array_name?size}"

Please try with this code-


<#function get_array my_father my_son>
        <#if my_father?is_hash>
                <#if my_father[my_son]?exists>
                        <#if my_father[my_son]?is_sequence>
                                <#assign my_array = my_father[my_son]>
                        <#else>
                                <#assign my_array = [my_father[my_son]]>
                        </#if>
                <#else>
                        <#assign my_array = []>
                </#if>
        <#else>
                <#assign my_array = []>
        </#if>
        <#return my_array>
</#function>

<#assign my_entries = get_array(P_result.feed,"entry")>

<#list my_entries as x>
${x.oano?size}
</#list>

If you still face any problem, please feel free to ask.

Thanks & Regards
Sweta


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.

ideasandinno...@gmail.com

unread,
Jul 12, 2014, 6:39:07 AM7/12/14
to suppor...@runmyprocess.com
Hi

The following error gets throws up when I use the code as you mentioned

2014-07-12T10:37:55+0000 - Task "" (id: 3[0] - status: ABORTED): Error while processing <#function get_array my_father my_son>


<#if my_father?is_hash>
<#if my_father[my_son]?exists>
<#if my_father[my_son]?is_sequence>
<#assign my_array = my_father[my_son]>
<#else>
<#assign my_array = [my_father[my_son]]>
</#if>
<#else>
<#assign my_array = []>
</#if>
<#else>
<#assign my_array = []>
</#if>
<#return my_array>
</#function>
<#assign my_entries = get_array(P_result.feed,"entry")>
<#list my_entries as x>

{x.oano?size}
</#list>

Expected extended-hash or sequence. x.oano evaluated instead to freemarker.template.SimpleScalar on line 19, column 3 in temp.

Sweta Suman

unread,
Jul 12, 2014, 7:27:19 AM7/12/14
to suppor...@runmyprocess.com
Hi,

Please try with this code-

<#function get_array my_father my_son>
        <#if my_father?is_hash>
                <#if my_father[my_son]?exists>
                        <#if my_father[my_son]?is_sequence>
                                <#assign my_array = my_father[my_son]>
                        <#else>
                                <#assign my_array = [my_father[my_son]]>
                        </#if>
                <#else>
                        <#assign my_array = []>
                </#if>
        <#else>
                <#assign my_array = []>
        </#if>
        <#return my_array>
</#function>

<#assign my_entries = get_array(P_result.feed,"entry")>

<#list my_entries as x>
${x.oano?length}  // This will give the length of your result.
</#list>

Please let me know, if you still facing any problem.

Thanks & Regards
Sweta


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.

ideasandinno...@gmail.com

unread,
Jul 12, 2014, 7:53:05 AM7/12/14
to suppor...@runmyprocess.com, ideasandinno...@gmail.com
Hi

Thanks Sweta for your quick response.
I would like to know about the looping issue that I had told you before.

Reply all
Reply to author
Forward
0 new messages