Mirage Source http://web.miragesource.net/forums/ |
|
Clear Player http://web.miragesource.net/forums/viewtopic.php?f=210&t=762 |
Page 2 of 2 |
Author: | Xlithan [ Mon Jan 22, 2007 2:31 pm ] |
Post subject: | |
Can the same method be used for the other Clear subs, like ClearNPC? |
Author: | William [ Mon Jan 22, 2007 2:33 pm ] |
Post subject: | |
GameBoy wrote: Can the same method be used for the other Clear subs, like ClearNPC?
yes it can. |
Author: | Xlithan [ Mon Jan 22, 2007 2:39 pm ] |
Post subject: | |
Cool, I can cut down on some lines then Also, I get a type mismatch on Player(Index), should it be PlayerRec(Index) or something? |
Author: | William [ Mon Jan 22, 2007 2:47 pm ] |
Post subject: | |
Then try the fillmemory instead. |
Author: | Spodi [ Mon Jan 22, 2007 2:53 pm ] |
Post subject: | |
I was giving a pseudo-code, not exactly how it should be. And yes, using ZeroMemory (or FillMemory) would be better and faster. Code: ZeroMemory Player(Index), Len(Player(Index))
Something like that. |
Author: | grimsk8ter11 [ Mon Jan 22, 2007 7:30 pm ] |
Post subject: | |
If PlayerRec is public them Dim EmptyPlayer as PlayerRec player(index) = emptyplayer would work |
Author: | Lea [ Sat Jul 21, 2007 5:06 am ] |
Post subject: | Re: |
Dragoons Master wrote: Well, I'm having a problem with the FillMemory being used w/ the player array. When it clears a fixed-size string is does not set its text to vbnullstring, it changes to a lot of boxes, you know? so I need to use a diferent sub, like this one: Code: Sub ClearPlayer(ByVal Index As Long) Call FillMemory(ByVal VarPtr(Player(Index)), LenB(Player(Index)), 0) Player(Index).Login = vbNullString End Sub REason for that is all the strings are being filled with the byte value 0, I believe the byte value for a space is 40-something. Go back through the few strings and do = vbNullString for them. |
Page 2 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |