Mirage Source

Free ORPG making software.
It is currently Mon Apr 29, 2024 3:53 am

All times are UTC




Post new topic Reply to topic  [ 976 posts ]  Go to page 1, 2, 3, 4, 5 ... 40  Next
Author Message
 Post subject: aLen use?
PostPosted: Sun Jan 14, 2007 7:42 pm 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 7:22 pm
Posts: 101
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
    On Error Resume Next
   
    aLen = (UBound(dBytes) - LBound(dBytes)) + 1
 
    If Err.Number <> 0 Then
      aLen = 0
      Err.Clear
    End If
End Function


Use would be ...

Code:
Dim Buffer() as byte

Erase Buffer
Buffer = ""
Buffer = AddByteToBuffer(Buffer, 1)


The above always result in a runtime error ... now according to the instructions :

Quote:
'One thing to note, always initialize your byte array to "".
'i.e. dBytes = ""
'This sets the UBound of the byte array to -1, allowing us
'to have a size of 0. If the array is not initialized, or
'you have emptied the array, aLen will cause a RT error.


Doesn't seem to be accurate. As shown by the code above, I shouldn't receive a runtime error.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 7:57 pm 
Offline
Pro

Joined: Mon May 29, 2006 2:15 am
Posts: 368
yeah i had that same problem. It's weird, but when i quit using "Erase Buffer", the error went away...

_________________
Image
Image
The quality of a man is not measured by how well he treats the knowledgeable and competent, but rather how he treats those less fortunate than himself.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 8:00 pm 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 7:22 pm
Posts: 101
Perfect, thanks

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 8:11 pm 
Offline
Pro

Joined: Mon May 29, 2006 2:15 am
Posts: 368
Are you rewriting ver's tutorial and/or releasing a code with working byte arrays?

_________________
Image
Image
The quality of a man is not measured by how well he treats the knowledgeable and competent, but rather how he treats those less fortunate than himself.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 8:28 pm 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 7:22 pm
Posts: 101
Im shifting through the Kingdom of Cryshall code as well as the VBGore code :) To answer your question, I'm using Socket Tools for my project, and figured i'd try out the byte based networking route for this bugger.

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.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 10:15 pm 
Offline
Knowledgeable
User avatar

Joined: Mon Jul 24, 2006 2:04 pm
Posts: 339
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.

_________________
NetGore Free Open Source MMORPG Maker


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 2:26 am 
Offline
Pro

Joined: Mon May 29, 2006 2:58 pm
Posts: 370
Shan you cant set buffer =" " has to be buffer = ""

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 4:31 am 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
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.

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 3:58 pm 
Offline
Pro

Joined: Mon May 29, 2006 2:58 pm
Posts: 370
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.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 4:14 pm 
I was talking to Shan about that last night, he said he fixed that issue long ago. Lol.


Top
  
 
 Post subject: Re: aLen use?
PostPosted: Wed Dec 01, 2021 1:21 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruhttp://magnetotelluricfield.ruhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruинфоhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.rutaskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruсайтhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:24 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Crea


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:25 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
202.92


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:26 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
PERF


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:27 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
PERF


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:28 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Juli


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:29 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Heat


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:31 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Miss


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:32 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Yash


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:33 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Esma


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:34 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
OZON


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:35 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
John


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:36 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Atta


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:37 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Deko


Top
 Profile  
 
 Post subject: Re: aLen use?
PostPosted: Mon Jan 31, 2022 1:38 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 491334
Fisk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 976 posts ]  Go to page 1, 2, 3, 4, 5 ... 40  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 90 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group