Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array declaration 1

Status
Not open for further replies.

ddrillich

Technical User
Jun 11, 2003
546
US
Good Day,

I have the following code segment. I would like to define the array In to have 10 items. Currently I use: In = [0,1,2,3,4,5,6,7,8,9]
Is there a better way to declare it?


# Mapping by position the array elements to their logical entities
inObject = 0
inName = 1
inDescription = 2
inCustomTypeList = 3
inCustomType = 4
inCloneable = 5
inNot_unattendable_folder = 6
inMonthly_email_folder = 7
inWeekly_email_folder = 8
inEmailAddress = 9

In = [0,1,2,3,4,5,6,7,8,9]

In[inObject] = criptSession.getParameter('object')
In[inName] = scriptSession.getParameter('name')
In[inDescription] = scriptSession.getParameter('description')
In[inCustomTypeList] = scriptSession.getParameter('customTypeList')
In[inCustomType] = scriptSession.getParameter('customType')
In[inCloneable] = scriptSession.getParameter('attrvalue_of_cloneable')
In[inNot_unattendable_folder] = scriptSession.getParameter('not_unattendable_folder')
In[inMonthly_email_folder] = scriptSession.getParameter('monthly_email_folder')
In[inWeekly_email_folder] = scriptSession.getParameter('weekly_email_folder')
In[inEmailAddress] = scriptSession.getParameter('emailAddress')

Thanks,
Dan
 
Code:
#########################################

inObject, inName, inDescription, inCustomTypeList, \
    inCustomType, inCloneable, inNot_unattendable_folder, \
    inMonthly_email_folder, inWeekly_email_folder, inEmailAddress = range(10)	

In = {}

In[inObject]            = criptSession.getParameter('object')
In[inName]            = scriptSession.getParameter('name')
In[inDescription]        = scriptSession.getParameter('description')
In[inCustomTypeList]        = scriptSession.getParameter('customTypeList')
In[inCustomType]        = scriptSession.getParameter('customType')
In[inCloneable]            = scriptSession.getParameter('attrvalue_of_cloneable')
In[inNot_unattendable_folder]    = scriptSession.getParameter('not_unattendable_folder')
In[inMonthly_email_folder]    = scriptSession.getParameter('monthly_email_folder')
In[inWeekly_email_folder]    = scriptSession.getParameter('weekly_email_folder')
In[inEmailAddress]        = scriptSession.getParameter('emailAddress')

#########################################
Note, that "In" will be a dictionary (key:value map), imho better solution in your situation.

 
Hi dvska,

Beautiful thing – thanks!

One thing that still bothers me is the fact that I can't seem to add a comment in these definition lines:

inObject, inName, inDescription, inCustomTypeList, \ # comment.....

Any thoughts?

Regards,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top