Jump to content

Showing a default value in 'Inputs'


Delta68

Recommended Posts

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 by Delta68
Link to comment

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. :D

Link to comment

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 :unsure:

 

 

 

Thanks

 

Mark

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...