Community
SCI Programming => Mega Tokyo SCI Archive => Topic started by: Pikachu14 on July 24, 2002, 07:56:19 AM
-
In Larry 3, you could enter your own custom cussword and whenever appropiate, Larry would say it. But how is it done? EditPrint, obviously, but...
-
You save the "word" as a variable and use FormatPrint to print it.
For instance I beleive it was something like this:
FormatPrint("Don't you dare say %s to me again!" aString)
It will then replace %s with the word that is in aString.
Hope this helps.
-
Well, that's showing the cussword. But how does EditPrint fit in?
-
EditPrint is for entering a value into a edit field(just like the input for typeing.)
When it is called it opens a dialog window with the text you chose, the input box, and any text you want to be within the input box.
-
You simply use a combination of EditPrint() and FormatPrint().
You can use string variables:
/******************************************************************************/
(string
theName[41]
)
/******************************************************************************/
(instance public rm001 of Rm
(properties)
(method (init)
EditPrint(theName 40 "What is your name?")
FormatPrint("Well hello there %s! Have a good day!" theName)
or local variables:
/******************************************************************************/
(local
theName[41]
)
/******************************************************************************/
(instance public rm001 of Rm
(properties)
(method (init)
EditPrint(@theName 40 "What is your name?")
FormatPrint("Well hello there %s! Have a good day!" @theName)
or temp variables:
/******************************************************************************/
(instance public rm001 of Rm
(properties)
(method (init)
(var theName[41])
= theName[0] 0
EditPrint(@theName 40 "What is your name?")
FormatPrint("Well hello there %s! Have a good day!" @theName)
Each operate slightly differently, but all work.
-
YAY! It works! Thank you!
Enter new cuss word: Camelpoo
c -What are you going to do?- uss
"Camelpoo!" you shout, and feel much better...