Combining strings to create URL search
So I am sending GPS latitude and longitude data to my patch and would like to create a google search link of that data so people can see the location on a map.
My trouble is combining two message boxes to complete the URL,
The first contains the launch browser with google's search url, the second contains the lat & long.
I combined to floats successfully with sprintf, how can I do it with strings (and not have the browser launch until I have combined those two strings)?
The combine won't allow commas and semi-colons either...
Any help much obliged!
The tricks here are firstly to encode the space character as something that Google will understand, in this case it is %2C, then to escape the % sign in [sprintf] where it has a special meaning using a second percent sign and lastly to send this list to max all at once at the end.
P.S. Careful when scrolling through those number boxes, you'll end up opening LOADS of Google search tabs - perhaps try storing in [zl reg] and then using a [button] to send out your query when it is fully formed!
There are lots of ways to control when the search query goes out. The enclosed is one way: stash the floats in a pack object and then bang to explicitly send them when you're ready. The example uses an unpack to separate the data again, but there are tons of other ways to do this.
Luke's suggestion of [zl] is, of course, another to do this, but the zl object is relatively new (and constantly changing), whereas [pack] and friends are good, old, reliable objects.
Thank you both very much! I am starting to get a grasp of message formatting, this advice definitely shows some nice clear ways of dealing with it.
Thanks!