The Daily Click ::. Forums ::. Klik Coding Help ::. Line Breaks in the Expression Editor...
 

Post Reply  Post Oekaki 
 

Posted By Message

ChuckyT



Registered
  04/12/2004
Points
  21
10th December, 2004 at 05:29:12 -

Anyone know how I can add text to an edit box and put what is already in the edit box on a new line? In other words, inserting a line break into the edit box. I heard about some things for MMF, but what about TGF?

 
Bop it up, Rock it out!

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
10th December, 2004 at 06:11:12 -

For setting something with the edit box text + new line, it's something like:
on condition:
String - set text Edittext$("Edit") + "
"



 
My signature is never too big!!!

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
10th December, 2004 at 07:04:37 -

Yes, but the problem is finding the character that represents that new line. There is no "newline$" in TGF - what you could do is have a separate Edit object, or a string I suppose... (let's call it Newline Object for now) that contains only a new line (Enter) character, and use this on your Edit Object:

Set text of Edit Object to ("Here's some new text" + Gettext$("Newline Object") + Gettext$("Edit Object"))

Of course, there may be a far simpler way if there is another way of representing a newline character in TGF - but I don't know of one.

Image Edited by the Author.

 
http://www.davidn.co.nr - Games, music, living in America

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
10th December, 2004 at 09:52:46 -

does ctrl + enter not work in TGF? it does in MMF.

 
www.thenatflap.co.uk

Liquixcat

Administrator
Lazy Coder

Registered
  08/12/2002
Points
  201

VIP MemberLikes TDCKitty
10th December, 2004 at 10:27:27 -

The only way I know of is the way 'Wong' said. ctrl+enter doesn't work, at least not in TGF.

 
thinking is like pong, it's easy, but you miss sometimes.

ChuckyT



Registered
  04/12/2004
Points
  21
10th December, 2004 at 16:41:51 -

Hey, thanks wong! That sounds like a good idea... and it works too!

 
Bop it up, Rock it out!

ChuckyT



Registered
  04/12/2004
Points
  21
10th December, 2004 at 17:48:52 -

Well, actually it didn't work. But I did figure out how to do it... sort of.

I took an edit object, like Wong said, and told TGF to always set text of edit object to appdrive$ + appdir$ + "Game Files\carriage return.txt"

then I made the file itself, and put this into the file: (carriage return)...

so, combined with my game, it produces this effect:

Johnny Tatlock uses Greek Fire Grenade!
...Johnny Tatlock's turn.
...Johnny Tatlock is hit with 4 damage points!
...Urban the Flea uses Sauce!
...

where the line without the ... is the newest one. I tried just putting a return into the text file, but TGF displayed that as "||". Oh well. Thanks for the idea Wong!

 
Bop it up, Rock it out!

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
10th December, 2004 at 21:26:18 -

It'd be better just to press return in a string object on the frame. If someone edited or deleted your "carriage return.txt" file your app would stuff up.

 
- Tigerworks
   

Post Reply



 



Advertisement

Worth A Click