Log in

View Full Version : Need Help - Beginner



Plessey
06-05-2012, 05:54 PM
Alright, well I always seem to be getting this [Error] (113:36): Type mismatch at line XX
Compiling failed.

When I type the line: (TimeRunning)/(60)*(300*(Fish_Caught)); Where 300 is the amount of xp per fish, and 60 is equal to an hour.
I looked at how to get this to work but it never seems to work no matter what I do... is it just a problem with the line of code? (This is to find out the amount of XP per hour btw)

Thank you for any help ...

P1ng
06-05-2012, 06:01 PM
WriteLn(IntToStr(round(3600000/ GetTimeRunning * xp)));
IntToStr - Changes the number you return into a string for the procedure to write into the debug box.
round - Stops it writing an insane number of digits after the decimal
360000 - # of milliseconds in an hour
GetTimeRunning - does what it says
xp - how much xp you have gained thus far.

Try -
WriteLn(IntToStr(round(360000 / GetTimeRunning * 300 * (Fish_Caught))));

Plessey
06-05-2012, 06:12 PM
Didn't seem to work and I don't feel good about getting you or any other people to waist their time trying and fix my problem that is probably caused by something else rather then how the numbers or brackets are placed ...
I'll look into it more, it may be something I missed aha

P1ng
06-05-2012, 06:14 PM
If you don't mind posting the code surrounding the line in question (the whole procedure it's in would be helpful, if not the whole script) and exactly what is written in the debug box when it gives you the error, I am more than happy to help you out to the best of my ability.

Abu
06-05-2012, 07:35 PM
Type mismatch error....

Try this thread of mine: http://villavu.com/forum/showthread.php?t=82793