0 Members and 4 Guests are viewing this topic.
Hmm, yes that's even a better idea.I've got yet another question. Currently, the program should fit in a 640*480 screen resolution. If no-one here uses that old screen resolution anymore I could take it up to 800*600 so I can make those bars a bit wider, which will make the difference between them alot clearer. What do you think?Grtz, DePhille
that's a whole bunch of work to do in Visual Basic. There are currently already over 200 controls in the program, and making it scaleable would require me to calculate a relative width and height for every one of them.I'll switch to 800*600 though.It only brings one extra problem: How should I fill the general statistics now?Grtz, DePhille
Or move to VB.NET Scaling is so automatic there. Oh, and everything is so easy to do lolQuote from: mxyzptlk on June 27, 2007, 08:46:25 pmSo, if you got, say 153 Deagle kills, that would be considered 100%If you got 39 knife kills and 21 grenade kills, how would the program determine the percentages?153kills -> 100%39kills -> XX = 39kills * 100% = 25,490196078431372549019607843137% 153kills
So, if you got, say 153 Deagle kills, that would be considered 100%If you got 39 knife kills and 21 grenade kills, how would the program determine the percentages?
Quote from: PerroAZUL on June 28, 2007, 12:06:06 pmOr move to VB.NET Scaling is so automatic there. Oh, and everything is so easy to do lolQuote from: mxyzptlk on June 27, 2007, 08:46:25 pmSo, if you got, say 153 Deagle kills, that would be considered 100%If you got 39 knife kills and 21 grenade kills, how would the program determine the percentages?153kills -> 100%39kills -> XX = 39kills * 100% = 25,490196078431372549019607843137% 153killsA small problem with your calculations resulted in a number that is ENORMOUSLY too big.simply do 39/153. That takes you to that big decimal. Move the decimal over twice, tada:25.490196078431372549019607843137%; not with a comma x]
In PHP I could use arrays: $playerstats[$player]['kills']++; which doesn't work in Visual Basic. So I'll have to look for a very short and fast alternative there.Grtz, DePhille
Private Type TPlayer kills As Integer deaths As IntegerEnd TypeDim Players() As TPlayerPrivate Sub Form_Load() Players(1).kills = 10 Players(2).deaths = 234End Sub
Open "C:\logfile.txt" For Input As #1 Dim line As String Do Until EOF(1) Line Input #1, line 'parse the line DoEvents Loop Close #1
Uh... mate... Europe uses a comma, not a point, for their numbers.
The proper format would be ConvertCurrency <value>, <from>, <to>So it would be like this:ConvertCurrency 12.50, EU, USInstead, if you use a comma instead of a dot, it would be:ConvertCurrenct 12,50, EU, USSo it would give 50 as a flag for the function.
In VB you have to use types, for example:Code: [Select]Private Type TPlayer kills As Integer deaths As IntegerEnd TypeDim Players() As TPlayerPrivate Sub Form_Load() Players(1).kills = 10 Players(2).deaths = 234End Sub
Quote from: SpiltCoffee link=topic=16555.msg192644#msg192644Uh... mate... Europe uses a comma, not a point, for their numbers.In nearly every programming/scripting language you use . instead of , and that's because almost every function separates its arguments by a comma. For example, if there was a function that changes between currencies, it could be something like this (in VB):Code: [Select]The proper format would be ConvertCurrency <value>, <from>, <to>So it would be like this:ConvertCurrency 12.50, EU, USInstead, if you use a comma instead of a dot, it would be:ConvertCurrenct 12,50, EU, USSo it would give 50 as a flag for the function.
Thanks all for the help!What I meant with the PHP example is that I could use $players[$playername]['kills']++; where $playername is a string. This way I don't have to see if there already is an entry for that player and I can just add one to kills, deaths, suicides or whatever other value. The types might come in very handy already, though I'm still looking for something similar to the PHP-method, as it won't increase the parse-time alot. If I have to look up every name in every entry to see if it's already in the TPlayer array the parse time would be several minutes instead of one second.From what I've found on the internet, named arrays (or any equivalent) do not exist or are not possible in VB. However, I'm leaving this idea open for a few days, and if nothing comes out I might be thinking of having a long parsetime but saving the results instead of parsing all logs again (which will also be a pain in the ass, especially because I'd have to ship alot of OCX controls with the final release in order to avoid errors).Also, since the lack of interest for the beta-testing, I'll be launching a public beta-test (see main post).Grtz, DePhille