Category talk:EasyLang: Difference between revisions
Replaced some procedures with equivalent functions
Jazzedpineda (talk | contribs) |
Jazzedpineda (talk | contribs) (Replaced some procedures with equivalent functions) |
||
(One intermediate revision by the same user not shown) | |||
Line 34:
===Lowercase===
<syntaxhighlight lang="easylang">
for i = 1 to len string$
code = strcode substr string$ i 1
Line 42:
result$ &= strchar code
.
return result$
.
</syntaxhighlight>
===Uppercase===
<syntaxhighlight lang="easylang">
for i = 1 to len string$
code = strcode substr string$ i 1
Line 54 ⟶ 55:
result$ &= strchar code
.
return result$
.
</syntaxhighlight>
Line 60 ⟶ 62:
This function is for number arrays:
<syntaxhighlight lang="easylang">
for i = 1 to len array[]
if array[i] = item
index = i
.
.
return index
.
</syntaxhighlight>
This function is for string arrays:
<syntaxhighlight lang="easylang">
for i = 1 to len array$[]
if array$[i] = item$
index = i
.
.
return index
.
</syntaxhighlight>
Line 85 ⟶ 87:
==Sum and product of arrays==
<syntaxhighlight lang="easylang">
func sum array[]
for item in array[]
.
return result
.
func product array[]
for item in array[]
.
return result
.
</syntaxhighlight>
|