how can I get an input from user with special characters and treat it like a string without using the "/" character?
For example:
Suppose there is a procedure proc a {input} {...}
that gets the following string "classA.arr2[0].classB"
.
If I don't add the character "/" next to "[0]" it will think that 0 is a command/procedure.
I will make it more clearly:
I added a code that is part of a Class A
method that evaluating the args.
public method config {args} {
if {[llength $args] > 1} {
foreach {option value} $args {
if {[string length $option] == 0 || [string length $value] == 0} {
puts "Runtime error::Bad Input: option flag or value is missing"
return ""
}
switch -- $option {
-scope {
if { [regexp {[A-Za-z]+} $value] } {
set _scope $value
} else {
puts "Runtime error::Bad Input: BAD SCOPE FORMAT"
return ""
}
} ...
Now I want to run the following code:
A a
a config -scope "string1.string2[0].string3"