In my Python GP tool getParameterInfo method I want to declare a string parameter like this:
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">getParameterInfo</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="string token">"""Define parameter definitions"""</SPAN>
paramName <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Parameter<SPAN class="punctuation token">(</SPAN>
displayName <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Name'</SPAN><SPAN class="punctuation token">,</SPAN>
name <SPAN class="operator token">=</SPAN> <SPAN class="string token">'in_name'</SPAN><SPAN class="punctuation token">,</SPAN>
datatype <SPAN class="operator token">=</SPAN> <SPAN class="string token">'GPString'</SPAN><SPAN class="punctuation token">,</SPAN>
parameterType <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Required'</SPAN><SPAN class="punctuation token">,</SPAN>
direction <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Input'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">return</SPAN> <SPAN class="punctuation token">[</SPAN>paramName<SPAN class="punctuation token">]</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Can I specify maximum length of it her? I want 255 as this input will go to the table attribute of varchar(255).
Or I should deal with such validation myself in updateParameters/updateMessages methods?