Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Type mismatch trying to say time?

Dave Chesnokov
Registered User
Join date: 4 Dec 2007
Posts: 1
03-22-2008 04:26
Hi all,

Totally lost here, I can't see anything wrong with the following but it gives me a type mismatch that I can't resolve, any suggestions? Explicit casting to integer in the llSay statement just gives a syntax error. Shouldn't be necessary anyway.

integer t;

integer hours;
integer minutes;
integer seconds;

t = (integer)llGetWallclock();

hours = t / 3600;
minutes = (t % 3600) / 60;
seconds = t % 60;

llSay(0, "Current time: " + hours + ":" + minutes + ":" + seconds + ".";);

Any assistance appreciated.
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
03-22-2008 05:12
... use this:


llSay(0, "Current time: " + (string)hours + ":" + (string)minutes + ":" + (string)seconds + ".";);
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
03-22-2008 05:20
From: Dave Chesnokov
Hi all,

Totally lost here, I can't see anything wrong with the following but it gives me a type mismatch that I can't resolve, any suggestions? Explicit casting to integer in the llSay statement just gives a syntax error. Shouldn't be necessary anyway.

integer t;

integer hours;
integer minutes;
integer seconds;

t = (integer)llGetWallclock();

hours = t / 3600;
minutes = (t % 3600) / 60;
seconds = t % 60;

llSay(0, "Current time: " + hours + ":" + minutes + ":" + seconds + ".";);

Any assistance appreciated.


You should typecast to string in the llSay statement.

llSay(0, "Current time: " + (string)hours + ":" + (string)minutes + ":" + (string)seconds + ".";);
Ruadhri Otoole
Registered User
Join date: 6 Apr 2007
Posts: 2
03-27-2008 12:40
From: Haruki Watanabe
... use this:


llSay(0, "Current time: " + (string)hours + ":" + (string)minutes + ":" + (string)seconds + ".";);


Just wanted to thank you for this, it worked perfectly.