+Delta68 Posted November 29, 2009 Share Posted November 29, 2009 (edited) Is it possible to re-display a previously entered value as the default value if an input is called a second time? eg like the java script: strTxt = prompt("Message", strTxt); or the Visual Basic: strTxt = InputBox("Message", , strTxt) thanks Mark Edited November 30, 2009 by Delta68 Quote Link to comment
+sTeamTraen Posted November 29, 2009 Share Posted November 29, 2009 I don't know how to do that using the visual interface of the Groundspeak builder, because that prompts you for a constant string text when you build a Message element. It's perfectly possible in Lua, because a Message is simply Wherigo.MessageBox{Text=sometext [, Media=someobject]} So you can say mytext = "Old value=" .. value Wherigo.MessageBox{Text=mytext} That will either require editing the Lua file (disadvantage: you can't read it back in; if you do, the builder will crash at worst, drop your code at best), or an upgrade to Earwigo, where you can mix arbitrary Lua statements with visually-generated code, anywhere you like. Quote Link to comment
+Delta68 Posted November 30, 2009 Author Share Posted November 30, 2009 Thanks for the reply that's not quite what I wanted. What I wanted was the input textbox on an 'Input' to be pre-populated. I think what I might do is set display text dynamically showing the current value and then only update the variable if something is actually entered Thanks Mark Quote Link to comment
+sTeamTraen Posted November 30, 2009 Share Posted November 30, 2009 What I wanted was the input textbox on an 'Input' to be pre-populated. Ah. I suspect that I "knew" that wasn't possible, and fast-forwarded to the workaround using the prompt. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.