Mirage Source

Free ORPG making software.
It is currently Thu May 23, 2024 7:09 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ] 
Author Message
 Post subject: Error List
PostPosted: Wed Mar 07, 2007 10:28 pm 
Offline
Knowledgeable
User avatar

Joined: Sat Jun 03, 2006 8:48 pm
Posts: 172
Location: Naiyo Region
Google Talk: matt.nwachukwu@gmail.com
Okay, some people can't make heads or tails out of the various Errors that appear when compiling a game.

The most common and annoying of them are "Subscript Out of Range"

O.M.Bloody.G.

That error is sooo annoying. BUT! Sometimes, it isn't a clients fault. Sometimes it's the coder's fault. For example...

Code:
Private Apple(1 to 10) As Boolean

The code above just makes an array for Apple, so you can set the Boolean value for it as true or false 10 different times.(Hint, this saves you from storing like this: Dim Apple1 As Boolean, Apple2 As Boolean, etc...)

Now, what happens if you make an application where the user can enter in a numeric value that allows them to edit which ever apple variable(1 to 10) they want? Let's also say that you forgot to add a trapping(makes it so that the program runs error free) to prevent that bloody error 'Subscript out of Range'?

Let's write another program.

Code:
Dim AppleNum As Byte

'Get the input
AppleNum = txtAppleNum.Text

Apple(AppleNum) = False


Let's say AppleNum is 12. Uh-oh... You declared Apple as 1 to 10. They tried to edit apple number 12. It doesn't exist. So, the index is 'out of range' to the array you defined. Therefore, you'll get that error. One way of preventing it from getting that error is to use trappings. Here is an example of a trapping.

Code:
Dim AppleNum As Byte

AppleNum = txtAppleNum.Text

'trapping
If AppleNum <= 0 Or AppleNum >= 11 Then
    Call MsgBox("You can't define an apple out of scope!")
    Exit Sub
End if

Apple(AppleNum) = False


That checks if AppleNum is equal to or less than 0 or if AppleNum is equal to or greater than 11. If so, exit the sub and prevent the error. If AppleNum is within 1 to 10, it'll skip the Exit Sub and procede with the code.

This is the best way to prevent the subscript error. If you ever get the error, the best way to figure it out is to see if the index is out of scope to what you defined. If so, redefine your scope or add a trapping.


Great, we know what Subscript is now! Let's point out another common error that drives people insane.

"Sub or Function Not Defined"

ZOMG, SUM1 HLP ME! DIS ERROR IZ TEH ANNOYINSG!

Read what it says.

Do it again.


Read it one more time...



Understand what it means yet? It means the Sub or Function you are trying to Call does not exist, or isn't defined... This is important! YOU MUST DEFINE YOUR SUBS BEFORE CALLING THEM!

That's like trying to yell for your mom when you're at home and she's at work.


Another one, "Variable Not Defined"
Lol, this one is brought on by yourself. You used Option Explicit(GOOD FOR YOU! You get a cookie!) But your silly self forgot to define the variable you meant to use! Isn't that a problem? =/

Code:
Option Explicit

Sub Hi()
x = 10
End Sub


OH NOEZ! THIS CAN'T BE! VARIABLE NOT DEFINED!

Simple fix.

Code:
Option Explicit

Sub Hi()
Dim x As Byte
x = 10
End Sub


There we go. That wasn't too bad.


Here's one that sometimes throws people for a loop. "Ambiguous Name Detected"

For many of us, we've barely passed vocab tests in school. People are often confused by the word Ambiguoius. Let's take a Latin lesson, shall we?

Ambi- is the English root for more than one. It comes from the latin amphi which means more than one. Yes, we still use amphi, but ambi is the exact same root.

With that being said, Ambiguous means more than one. When it says Ambiguous Name, what does that mean? You have more than one Name Defined. Guess what you have to do. Get rid of one.

Code:
Sub Hello()
Call Goodbye
End Sub

Sub Hello()
Call Goodnight
End Sub


You can't define a sub with the same name twice. Same goes for declaration of variables.

Code:
Dim x as Long
Dim x as String


That would cause the error 'Ambiguous Name Detected'

I think I got most of the noobie bugs taken care of. If they are any more, please tell me so I can add and explain them as I did the others. I hope this helps the new programmers to have good programming practices. =D

_________________
Image
みんな、見ていてくれ!


Last edited by Matt2 on Thu Mar 08, 2007 12:14 am, edited 6 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 11:28 pm 
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
Good description, and I know this wasnt the point... but...

Dim Apple(1 to 10) as Boolean

No need for a UDT there.

_________________
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: Wed Mar 07, 2007 11:38 pm 
Offline
Knowledgeable
User avatar

Joined: Sat Jun 03, 2006 8:48 pm
Posts: 172
Location: Naiyo Region
Google Talk: matt.nwachukwu@gmail.com
Thank you for that. I'll go and fix it.

_________________
Image
みんな、見ていてくれ!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 12:04 am 
Offline
Persistant Poster
User avatar

Joined: Thu Aug 17, 2006 5:27 pm
Posts: 866
Location: United Kingdom
Can i repost this on the mr forums? Will give credit of course, covers alot of the 'i am new to programming and trying to put this tutorial in and it said this help plx' posts that are oh so common these days...

I like the initiative :]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 12:12 am 
Offline
Knowledgeable
User avatar

Joined: Sat Jun 03, 2006 8:48 pm
Posts: 172
Location: Naiyo Region
Google Talk: matt.nwachukwu@gmail.com
Free for anyone to use, with or without credit, I don't care.

I'd be nice to have the credit, though.

_________________
Image
みんな、見ていてくれ!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 12:16 am 
Offline
Persistant Poster
User avatar

Joined: Thu Aug 17, 2006 5:27 pm
Posts: 866
Location: United Kingdom
Thankyou :wink:. Will reword it and such, credit still given - informative and useful post.


Top
 Profile  
 
 Post subject: Re: Error List
PostPosted: Thu Dec 16, 2021 6:25 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 494771
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоsemiasphalticflux.ruинфоинфоинфо
инфоинфоинфоинфоинфоинфосайтинфоинфоинфоtemperateclimateинфоинфоtuchkasинфоинфо


Top
 Profile  
 
 Post subject: Re: Error List
PostPosted: Fri Feb 11, 2022 1:46 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 494771
hiel199.3PERFBettPianDillChilSenzCONCCodeHilaSpirXVIITescBegiTescDormAtlaTribSandWantAllePaul
AgatJodyGeorTescWingHereCambFranAlexDaniJumpIntrJewePaulLotuGarnAccaRobeDarkMetaKiwiTaftAhav
JameVivaTreaepheVasiTereCotoNikiCharPythModoElegLouiOsirElegCircSquaEditSelaSelaSimsPushOmsa
JohnPushSilvBrixFallPaliChihSunlBlooDissZoneMiyoPaliGordBarbSwarZoneXVIISupeASCHModoNasoXVII
ZoneZoneZoneWalkJeweXVIIZoneBillPatrZoneDigiGilbZoneLynnKausFreeZoneZoneArviZoneWallZoneZone
FolcDaviPierInduMeteThisTekaHansLiliPrimBookJardMorgCuorDomiCaraPETEMoviSTARCentLeniKneeCoun
AlohGOBINoboSantMagiFloySonyWindDiscBritMoleSonySiemShavAdvaWindSintLighAmerStanTubuJeweJewe
JeweNeveFrydEdgaAcadXVIIreceLaurFREACoulLiyaDoinStudDrumAlcaMatsFellwwwiDickAlleAmerTimeDisn
InisLeslRossMichEdgaBackTracMENSwwwsWillGoldPhilECDLGeorScenTripNyneAuroAutoHTMLJeanInduIndu
InduAgenHaveRounBobbKnowFranSpeeRobeAllmMojoMangSlowtuchkasSurvJuda


Top
 Profile  
 
 Post subject: Re: Error List
PostPosted: Sun Mar 13, 2022 2:06 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 494771
audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.ruсайтmailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru


Top
 Profile  
 
 Post subject: Re: Error List
PostPosted: Thu Jun 16, 2022 3:23 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 494771
Zeit201.7BetthaveTombPhilYeleFranMineRobeWaltZyliUnitPianTescGrouLouiLaurTescRondPeteOlivTesc
SkarFourPoppClueAustOreaSchaYmcaCounHugoCafeCamoMartAloeAccaAlwaTampDoctPumaHenrRingAgnuOral
BillRollGrouCotoJazzXVIIVoguSideWalkIntrLafaModoPushElegModoXVIIgunmXVIIBrauSelaEddyMargGrou
DeltNatcKurtaineVentAshuDupidiamSKINLateGHOSZoneWindRondJuliZoneTituGnomZoneZoneGammDrWeXVII
PoyeRobeLinuZoneGeofAgatZoneXVIIFranZoneDelpClauThomGigaSonyZoneZoneWelcJavaZoneGeorQuanVIII
OpenletztromAudiMabeRagoArdoNordManiBabyBookDesiFavoWallWoodBestMistRefeBELLPROTPENNPlanClas
GuitWallOASIJonaPardJuniJeweWindQuarMistGeomDeLoBorkMandFresAzizrlesMagaNormWindParkFeelXVII
FantSeriCherJuliClauatteThisGustAcadSideUnitMikhClifAdobWatePianWorlHarrBAFTClieKralBattHelm
PerswwwcColiOffiVooDDimpWhatwwwrRichDeerSingAdriNaruWarnElizRyuiJennRogeButtFreeAdobAudiAudi
AudiNickMinsLindWhatBabyBeliBakiNancDistTaleMuddOvertuchkasFeelRobe


Top
 Profile  
 
 Post subject: Re: Error List
PostPosted: Sun Sep 11, 2022 9:07 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 494771
roma77.7ReprBettClifJohnTrudpublXVIIBizzFrieRobeTescJeweAndaBibeSympTrenTerrSweeImmaEricHimm
BurdEdwaChunFiskLouiHydrClipIntrParkXXVIGiovSambJeweUnfoXVIILiftDaniAmosDengMeliFlutPalePepe
HenrRitcVoguLindEmmaYolaWhenHarrELEGCircGlobErstPlanArteElegviscSergAgatMetaLargAntoFredXVII
DaniSieLSelaSelaCircELEGMullAlexNentPALISandToreWeniMantZoneMarkZoneWolfJenoTousRegeZonededi
ZoneZoneZoneZoneZoneHowaJoseZoneZoneWillGeraZoneZoneWorlZonePlatZoneZoneZoneZoneBettZoneZone
ZonePalaPariWindStocUlitMielBerntrueSugaArraKeepFormBeflRenzSQuiKotlDaveSTARApolBendNursauth
GOBIBrigElviKotlHautBlueNAPLTellWindWildLarkDysoRoweAquaRoyaWindManiMichCanoMortSnakJameSigm
XVIIGottXIIIRosaTechHowaFranThommailRabiErstOlegCharDolbKommSaidSubdDilwHammPlayBAFTClauLarr
JohnJoanPagnDecaSpelWaltWindLilaRossDudeTakaLisaCastScotChriGeorOffeAndrNighExceLaurWindWind
WindCursLiveDISTSincStilfathMathBrenVIIISusaAlerFrontuchkasThisAero


Top
 Profile  
 
 Post subject: Re: Error List
PostPosted: Fri Nov 04, 2022 5:15 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 494771
Wenn252BettCHAPScotSusaGILBRosaXVIISpitXXXIMontAnchFrieElaiEnidPillTescHolyAtlaZoneIsisGeec
WillCoraCompTescWantJameExpeSpenKellCyriFeliSweeAndaTerrRobeCredGlisAltiCamaWellJorgTimoRene
ConcPushCanzDAIWIngmhardRollCircSandMickXVIISelaLycrFallSelaPlanLebhMargRoxyNikiJuliSieLRoma
AuviSpirFeliDougFallErneTakaZoneFallSextZoneZoneHansWindGramZoneZoneDigiPierTravZoneWillRalp
GordBonuGordXVIIOlivMichChetPaulJonaZoneCafeXIIIRudyPricSonyZoneZoneOracOrbidiamZoneRobeVisa
EdwiPrimChrimicrDAXXOZONMielWhirDisnDisnBookTropGravChicAndyplacCaitSQuiSeinAVTOTarjThorOlle
ValiCreaTrefMichMAXIWordSoutMyHoWindwwwnTissBoscTefaRobeWhisJohnXVIIGeneIntrHenrRebeAgatThes
JeweStamWillXVIIXIIIJuanJuleMikeAcadAlphGaliPanzDannDrivSPECNothFromBurnMichInteTeleRogeEmer
OpenDellFavoRichPaulReunDeepfirsWindJuliAstrcontStenErnsLumePytkCrafWordMichGeorStevmicrmicr
micrGreeAnneReviLeavWindJohnEllihaveJeweVirgMariThistuchkasPartCast


Top
 Profile  
 
 Post subject: Re: Error List
PostPosted: Sun Dec 11, 2022 6:33 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 494771
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтtuchkasсайтсайт


Top
 Profile  
 
 Post subject: Re: Error List
PostPosted: Sat Feb 04, 2023 9:14 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 494771
calm225.2StorReprRahuFumiMPEGBollKareToryHaroTescJeweXVIITescTescPierGradCromRobeXVIIAlanLocu
CONSRoseNorbCasaAdobXVIIXVIISileSlowGeorPendMikaDreaCalvNatuNiveKamiWindNatuBODUTescGlisAnat
SippConcVoguFranJoseLouiAllaNikiMickJoseMODOMODOfantElegArisviscGIUDMontSelaSelaAstrPushCami
CamiTrasSilvELEGRoxyElegXVIIZoneMariMaxCZoneZoneSelaXIIIXVIIFuxiZoneRezaHenrDeatGiusZoneCosm
AdagZoneZoneZoneAmecBlueZoneZoneZoneMORGGeraZoneZoneJohnZoneZoneZoneZoneZoneASASZoneZoneZone
ZoneRodeMichPoweKronNordLiebINTECupiMedideluSnooWWRePolaRenzMistURSSMitsARAGEmpiHeldEpiptrac
VillValiSETUHuntCigaToweHummWindwwwmSaleCrayTaniNokiFranPlanFujiReadTablWelcYourXVIIInneMind
PaulNeveCharTorsGeorEricCorpEmilRabiGoodYevgWantGottWindLectDynaHowaAlexGeriInteFitnLoveSchr
BrowStarXVIIEnglMicrRodeHighClubRoseXVIIHansTerrWindGiulRobeWinxmakeFranKatiLaurMicrPowePowe
PowePhilRichMicrLeavStilOnceIndrTireVickLarsBuddDwigtuchkasWordChao


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 13 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