Grammar Naziism - right up my street!

Silver
msg ("What is your forename?")
get input {
player.forename = LTrim (result)
}
msg ("What is your surname, " + CapFirst (LCase (player.forename)) + "?")
get input {
player.surname = LTrim (result)
}
msg ("Nice to meet you " + CapFirst (LCase (player.surname)) + ", of the " + CapFirst (LCase (player.forename)) + " variety.")

jaynabonne
I just noticed: this code sample doesn't work properly. Did you want to fix it or remove it? (The surname query and get input should be *inside* the forename get input block, and the final msg needs to be inside *that* block.)

Edit: I thought this was in the Library section. Now that I see it isn't, I guess it's not important.

Silver
I think I was showing off and obviously got it wrong lol. What did I do wrong, it looks right to me?

jaynabonne
You need to nest the code so that the second part only happens within the first, etc. If you run it as is, you'll see all three messages print at once, and probably an error about trying to use "get input" more than once at a time.

Something like:
msg ("What is your forename?")
get input {
player.forename = LTrim (result)
msg ("What is your surname, " + CapFirst (LCase (player.forename)) + "?")
get input {
player.surname = LTrim (result)
msg ("Nice to meet you " + CapFirst (LCase (player.surname)) + ", of the " + CapFirst (LCase (player.forename)) + " variety.")
}
}

Silver
Oh right, yeah, that bit hasn't properly sunk in yet. :oops:

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums