# Need a bit Help with the Function

**URL:** <https://forum.inductiveautomation.com/t/need-a-bit-help-with-the-function/19883>\
**Category:** Ignition\
**Created:** [September 28, 2018, 3:46pm UTC](https://forum.inductiveautomation.com/t/need-a-bit-help-with-the-function/19883 "2018-09-28T15:46:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [September 28, 2018, 3:46pm UTC](https://forum.inductiveautomation.com/t/need-a-bit-help-with-the-function/19883/1 "2018-09-28T15:46:49Z")

</div>

I am completely new in the field of programming Python and Ignition Scripting.  
I have a piece of code that I am trying to understand.  
Please help me out if you can,  
address = “”  
def getSLCFile( address ):  
end\_char = address.index(’:’)  
return address[:end\_char]

What will be the return value ?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 28, 2018, 3:50pm UTC](https://forum.inductiveautomation.com/t/need-a-bit-help-with-the-function/19883/2 "2018-09-28T15:50:16Z")

</div>

Nothing at all. You aren’t calling getSLCFile() anywhere, just defining it.

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [September 28, 2018, 4:11pm UTC](https://forum.inductiveautomation.com/t/need-a-bit-help-with-the-function/19883/3 "2018-09-28T16:11:26Z")

</div>

I have the similar function,  
def getSLCWord( address ) :  
end\_char = address.index(’:’)  
return int(address[end\_char+1:])

and I am calling it as ,  
start\_address = “”  
start\_word = getSLCWord(start\_address)

What will be the value of start\_word ??

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 28, 2018, 4:17pm UTC](https://forum.inductiveautomation.com/t/need-a-bit-help-with-the-function/19883/4 "2018-09-28T16:17:07Z")

</div>

You should get a ValueError, since the colon isn’t in the string passed to your function. See [this documentation](http://www.jython.org/docs/library/stdtypes.html#string-methods) for string methods in jython.  
Also, please edit your posts to format your code. Use triple backquotes on separate lines above and below a code block to make it format neatly. It is hard to follow python code when the indentation isn’t visible.
