![]() |
aLen use? - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: aLen use? (/showthread.php?tid=644) |
aLen use? - William - 14-01-2007 Been looking through some sources, alen is being a pos, even though instructions followed .. bah ... Code: Public Function aLen(ByRef dBytes() As Byte) As Long Use would be ... Code: Dim Buffer() as byte The above always result in a runtime error ... now according to the instructions : Quote:'One thing to note, always initialize your byte array to "". Doesn't seem to be accurate. As shown by the code above, I shouldn't receive a runtime error. - Obsidian - 14-01-2007 yeah i had that same problem. It's weird, but when i quit using "Erase Buffer", the error went away... - William - 14-01-2007 Perfect, thanks - Obsidian - 14-01-2007 Are you rewriting ver's tutorial and/or releasing a code with working byte arrays? - William - 14-01-2007 Im shifting through the Kingdom of Cryshall code as well as the VBGore code ![]() I'm create a few classed for use with Socket Tools and the networking. Once I am finished with the conversion, I'm looking at releasing the classes and tutorial on how to use the classes on this forum. - Spodi - 14-01-2007 I just store a separate variable that keeps track of the array UBound(), this way you don't have to call for the UBound() along with don't have to worry about the array not existing (UBound returning an error). When you erase the array, you just set your UBound variable to -1. I would presume erasing is faster then redimming 0 since theres no memory it has to try and preserve, along with you free up that last index. - grimsk8ter11 - 15-01-2007 Shan you cant set buffer =" " has to be buffer = "" - grimsk8ter11 - 15-01-2007 Dave Wrote:You don't need to do Buffer="" for some things. If I remember correctly, if the packet has a string in it you need to do it. Haven't messed with it for a while, and instead of testing each packet it's easier to just include that lien. iw as jsut saying, since shan posted it as Buffer=" ", i believe its only used once. - Matt - 15-01-2007 I was talking to Shan about that last night, he said he fixed that issue long ago. Lol. |