HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Concentate strings ((or something)) lol

10-18-2006, 07:42 AM#1
Fr0zenLord
i've been trying to concentate strings in jass

I need to do this

Collapse JASS:
local integer s = 0
 local integer m = 0
 local integer h = 0
 local integer d = 0
 local integer mn
 local string seconds = "Seconds"
 local string minutes = "Minutes"
 local string hours = "Hours"
 local string days = "Days"
 local string months = "Months"
     loop
         if s >= 60 then
          set m = (m+1)
          elseif m >= 60 then
          set h = (h+1)
          elseif h >= 24 then
          set d = (d+1)
          elseif d >= GetRandomInt(28,31) then
          set mn = (mn+1)
          call PolledWait(1.00)
          set s = (s+1)
          set udg_time = (months+ (I2S(mn)+ (days+ (I2S(d)+ (hours+ (I2S(h)+ (minutes+ (I2S(m)+ (seconds+ (I2S(s)))))))))))
         endif     
    endloop

Now um, how do I put spaces between em, and do it correctly! lol
10-18-2006, 08:24 AM#2
oNdizZ
set udg_time = months + I2S(mn) + days + I2S(d) + hours + I2S(h) + minutes + I2S(m) + seconds + I2S(s)
first off, you dont need all those extra '(' and ')' that gui tends to give you, atleast not when you're dealing with strings.

what do you want it to show?
as it is now it would show something like:

months0days0hours0minutes0seconds0
10-18-2006, 09:01 AM#3
Fr0zenLord
I want it to show

Months: 0, Days: 0, Hours :0, Minutes: 0, Seconds: 0

How I do that O_O, and how can I do it w/o the (((((((((((((((((((((('s lol
10-18-2006, 09:19 AM#4
blu_da_noob
Just add strings inbetween? Eg:
set udg_time = months + ": " + I2S(m) + ", " + ....
10-18-2006, 09:45 AM#5
Fireeye
Collapse JASS:
set udg_time = ("months: " + I2S(mn) + ", " + "days: " + I2S(d) + ", " + "hours: " + I2S(h) + ", " + "minutes: " + I2S(m) + ", " + "seconds: " + I2S(s))
And are you sure you want it this way?
Collapse JASS:
if s >= 60 then
    set m = (m+1)
elseif m >= 60 then
    set h = (h+1)
elseif h >= 24 then
    set d = (d+1)
elseif d >= GetRandomInt(28,31) then
    set mn = (mn+1)
    call PolledWait(1.00)
    set s = (s+1)
    set udg_time = ("months: " + I2S(mn) + "days: " + I2S(d) + "hours: " + I2S(h) + "minutes: " + I2S(m) + "seconds: " + I2S(s))
endif 
I would make it like (without timer)
Collapse JASS:
if s >= 60 then
    set m = (m+1)
    set s = 0
elseif m >= 60 then
    set h = (h+1)
    set m = 0
elseif h >= 24 then
    set d = (d+1)
    set h = 0
elseif d >= GetRandomInt(28,31) then
    set mn = (mn+1)
    set d = 1
endif 
call PolledWait(1.00)
set s = (s+1)
set udg_time = ("months: " + I2S(mn) + "days: " + I2S(d) + "hours: " + I2S(h) + "minutes: " + I2S(m) + "seconds: " + I2S(s))
10-18-2006, 10:03 AM#6
Fr0zenLord
I see, thanks
10-18-2006, 11:59 AM#7
Toadcop
Fr0zenLord - it's extream simple... it would be better you would not have i-net like me so you would have time to think about this self...
10-18-2006, 02:01 PM#8
Chuckle_Brother
Not really all that relevant, but the proper word is concatenation...spelling?
10-18-2006, 07:56 PM#9
Fr0zenLord
Yes, i know, :) just couldnt remember how to spell it very well, (Not a word I've encountered much:P)