-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrayDemo.fprg
More file actions
40 lines (40 loc) · 1.99 KB
/
arrayDemo.fprg
File metadata and controls
40 lines (40 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="admin"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2019-10-05 07:01:10 "/>
<attribute name="created" value="YWRtaW47QURNSU4tUEM7MjAxOS0xMC0wNTsiMDY6MTE6NTQgIjsyMjY0"/>
<attribute name="edited" value="YWRtaW47QURNSU4tUEM7MjAxOS0xMC0wNTsiMDc6MDE6MTAgIjsyOzIzNjU="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="n" type="Integer" array="False" size=""/>
<output expression=""Please enter the array size:"" newline="True"/>
<input variable="n"/>
<declare name="friends" type="String" array="True" size="n"/>
<declare name="friendInput" type="String" array="False" size=""/>
<declare name="i" type="Integer" array="False" size=""/>
<for variable="i" start="0" end="Size(friends) - 1" direction="inc" step="1">
<input variable="friendInput"/>
<assign variable="friends[i]" expression="friendInput"/>
</for>
<output expression=""Filled array : " & arrayToString(friends)" newline="True"/>
</body>
</function>
<function name="arrayToString" type="String" variable="output">
<parameters>
<parameter name="stringArray" type="String" array="True"/>
</parameters>
<body>
<declare name="i" type="Integer" array="False" size=""/>
<declare name="output" type="String" array="False" size=""/>
<assign variable="output" expression=""""/>
<for variable="i" start="0" end="Size(stringArray) - 1" direction="inc" step="1">
<assign variable="output" expression="output & stringArray[i] & ",""/>
</for>
</body>
</function>
</flowgorithm>