cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Pondering Automation: Creating a List Part 2

357
Views
0
Helpful
0
Comments
Cisco Employee

Howdy out there in automation land! You might be wondering... where have I been!!!?? It's been 2 months since the last blog.... well we moved and with all that comes a delay in blogging. But we are pretty stable and I am back now! This blog is to talk about the other methods that I built into the List class for CPO. These include the following methods..

 

1) Destroy() - > destroys the list and it's run time user

2) Extend(L) -> this takes a List Name "L" and adds it to the list you invoked it on

3) Pop(i) -> this takes an optional index i and pops/removes the item from the list at that index. If "i" is not given, it pops off the last item in the list. It returns the item value as output

4) Index(item) -> this returns the first index of a item given. If no index, it errors

5) Get(index) -> this is like doing Array[Index] in a programming language. It returns the value of the item at the given index

6) Remove(item) -> this removes all items that are the same as the given item

 

These methods combined with the ones from before give a decently complete list class to help you in your coding. The only drawback is a little added overhead, but as I have said in the recordings, much of this is academic and meant to show you the power of target types and service oriented programming which is CPO's version of Object Oriented Programming. This blog will be short from a writing standpoint and the VOD is shorter. I'm trying to reduce the time so more will watch and be able to enjoy the full things!

 

I plan to do upcoming blogs on Strings, Conditionals, and more!!!

You can find the previous blog to this one at https://supportforums.cisco.com/blog/12550451/pondering-automation-creating-list-and-checking-it-twice

 

This includes the downloads for the list class.

now, ONTO THE VIDEO!

Play recording

 

Enjoy!

 

Shaun's Monthly Q/A

 

No questions this month! Hopefully we'll get some in to answer for next time!

 

 

Every month I will pick a handful of questions from you, the reading CPO public, to answer in this part of the blog. Please post comments/questions below. I will no longer be using the external e-mail from previous blogs.

 

Please also let me know if you like the format of this blog and what else you would like to see/know about. Feel free to give any ideas as to future blog posts, etc and I will be happy to post them. I hope to  do more how-tos, best practices, tips, tricks, and hopefully some interviews of the important people behind the scenes of CPO.

 

 

AUTOMATION BLOG DISCLAIMER: As always, this is a blog and my (Shaun Roberts) thoughts on CPO and automation, my thoughts on best practices, and my experiences with the product and customers. The above views are in no way representative of Cisco or any of it's partners, etc. None of these views, etc are supported and this is not a place to find standard product support. If you need standard product support  please do so via the current call in numbers on Cisco.com or email tac@cisco.com

 

 

Thanks to all for reading and happy automating!

 

 

-Shaun Roberts

 

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards