Changeset 12546 for trunk/gsdl/perllib/parse2.pm
- Timestamp:
- 2006-08-24T16:19:13+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/parse2.pm
r11650 r12546 185 185 # Parameters: 1.(Array pointer of the user given argument) 186 186 # 2.(Array pointer of plugin pre-defined argument list) 187 # 3.( Selfpointer, where we store all the argument value)187 # 3.(Hash pointer, where we store all the argument value) 188 188 # Pre-condition: Plugin gives the parameters to parse function in parse2 189 # Post-condition: Store all the default or user given values to the $self->{$ArgumentName}. 190 # Since $self is a pointer from plugin, plugin will have every values we set. 191 # Return value: 1 is parsing successful, 0 is failed. 189 # Post-condition: Store all the default or user given values to the hash->{$ArgumentName}. 190 # Since hash may be a plugin $self, plugin will have every values we set. 191 # 4. Optional "allow_extra_options" argument. If this is set, then 192 # its ok to have arguments that are not in the predefined list 193 # Return value: -1 if parsing is unsuccessful 194 # other value for success. This will be 0 unless "allow_extra_options" is set, in which case it will be the number of extra arguments found. 192 195 #----------------------------------------- 193 196 sub parse … … 239 242 if(processArg($hashArg{$strOneArg},$aryptUserArguList,\%hashInputArg) == 0){ 240 243 print STDERR "<BadArgumentValue a=$strOneArg>\n"; 241 return 0;}244 return -1;} 242 245 } 243 246 … … 254 257 print STDERR "<BadArgument a=$strOneArg>\n"; 255 258 print STDERR " Error: occur in parse2.pm::parse()\n Extra Arguments: $strOneArg\n"; 256 return 0;259 return -1; 257 260 } 258 261 } … … 271 274 { 272 275 print STDERR " Error: occur in parse2.pm::parse()\n Invalid Argument: $strOneArg\n"; 273 return 0;276 return -1; 274 277 } 275 278 } … … 294 297 if(defined $hashOneArg->{"range"}) 295 298 { 296 if(checkRange($hashOneArg->{"range"},$hashInputArg{$strArgName},$strArgName) == 0){ return 0;}299 if(checkRange($hashOneArg->{"range"},$hashInputArg{$strArgName},$strArgName) == 0){ return -1;} 297 300 } 298 301 if(defined $hashOneArg->{"char_length"}) 299 302 { 300 if(checkCharLength($hashOneArg->{"char_length"},$hashInputArg{$strArgName},$strArgName) == 0){ return 0;}303 if(checkCharLength($hashOneArg->{"char_length"},$hashInputArg{$strArgName},$strArgName) == 0){ return -1;} 301 304 } 302 305 $self->{"$strArgName"} = $hashInputArg{"$strArgName"}; … … 334 337 else 335 338 { 336 return 1;339 return 0; 337 340 } 338 341 }
Note:
See TracChangeset
for help on using the changeset viewer.