Testing user input as valid geo-location
-
I tried to test
UI.inputboxto validate the user_input location:result=shadowinfo["City"]=user_inputThe 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_inputis 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_inputfor a real geo-location besides a convoluted test of previous against new longitude, and latitude? -
@honoluludesktop said:
result=shadowinfo["City"]=user_inputYou'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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement