PtokaX forum

Development Section => Your Developing Problems => Topic started by: kepp on 07 January, 2004, 17:12:02

Title: After each row, NewLine must be done
Post by: kepp on 07 January, 2004, 17:12:02
This works OK, but i would like it to read a new line like this,
etc:

Welcome to: bla bla bla
Online Users : 241
more
more

And not like this, Welcome to : bla bla bla  Online Users : 241  more  more

And while im on it, If there's a better way to line up evrything, So i can break the line for instance

OutPut = "Welcome to
                 bla bla bla"

function Main()
   SetTimer(10*60000)
   StartTimer()
   S1 = "Welcome To : "..frmHub:GetHubName()
   S2 = "Online Users : "..frmHub:GetUsersCount()
   S3 = "Hub Description : "..frmHub:GetHubDescr()
   S4 = "Redirect Address : "..frmHub:GetRedirectAddress()
   S5 = "Max Users : "..frmHub:GetMaxUsers()
   S6 = "Minimum Share : "..frmHub:GetMinShare()
   S7 = "Current Share Ammount : "..frmHub:GetCurrentShareAmount()
   OutPut = S1.."\r\n"..S2.."\r\n"..S3.."\r\n"..S4.."\r\n"..S5.."\r\n"..S6.."\r\n"..S7
end


function OnTimer()
   file = "test/test.xml"
   remove(file)
   local handle = openfile(file,"a")
   write(handle, OutPut, "\n\n")
   closefile(handle)
end
Title:
Post by: SaintSinner on 07 January, 2004, 17:20:11
try a

user:SendPM()
for every line
Title:
Post by: kepp on 07 January, 2004, 17:36:08
Well, im not gonna send PM to anyone...
it will store that information in a xml file
Thanks anyhow :D
Title:
Post by: pHaTTy on 07 January, 2004, 17:42:32
use /r/n i think it is :))
Title:
Post by: NightLitch on 07 January, 2004, 17:53:55
a little improvment for you istead of:

S1, S2 etc.

change it to this:


local msg = ""

msg = msg.."\r\n Lines here "
msg = msg.."\r\n Lines here "
msg = msg.."\r\n Lines here "
msg = msg.."\r\n Lines here "
msg = msg.."\r\n Lines here "

OutPut = msg


try it...
Title:
Post by: kepp on 07 January, 2004, 22:01:35
Thanks for that nightlitch!!

hmm.. Yea, i use \r\n But it won't end up like it when it's in that files :S
Title:
Post by: plop on 08 January, 2004, 00:49:07
play a bit with tabs  \t in scripted lines or normal tabs in the file.
that can make it all look nices but it can screw up if the user (i'm 1 of them) changed the default font.

plop