Testing user input as valid geo-location
-
I tried to test
UI.inputbox
to validate the user_input location:result=shadowinfo["City"]=user_input
The API is as follows:
ShadowInfo.[=
The set value []= method is used to set the value in the array of shadow info options.
Arguments:
key The key of the shadowinfo value to set.
value The value to be set.
Returns:
value the value that was set if successful, or false if unsuccessful.]When the
user_input
is a bogus location, the value (return) is not false but the bogus location. The resulting longitude, and latitude are from the previous correct location.Am I doing something wrong? What method can be used to test the
user_input
for a real geo-location besides a convoluted test of previous against new longitude, and latitude? -
@honoluludesktop said:
result=shadowinfo["City"]=user_input
You're using the assign operation = instead of the evaluation operator ==
result == (shadowinfo["City"] == user_input
)(I'm not sure if the brackets are required to correctly evaluate that line, so I add it for safety and readability.)
-
This is going to take time, I can't get the code to work.
-
result = (shadowinfo["City"] == user_input)
There!
-
Thom made a very similar typo in his example. Should be:
result = (shadowinfo["City"] == user_input)
-
@honoluludesktop said:
The API is as follows:
ShadowInfo.[=SketchUp
The set value []= method is used to set the value in the array of shadow info options.
....]Delete the word "Sketchup" (you got it from the righthand version column. It's not part of the text.)
-
Done, Thanks Dan.
Haven't gotten back to working on this part of the code yet.
Advertisement