Mirage Source
http://www.miragesource.net/forums/

VB6 - Basics 2 - You are iffy!
http://www.miragesource.net/forums/viewtopic.php?f=211&t=5889
Page 1 of 1

Author:  Jacob [ Mon Jun 29, 2009 1:11 pm ]
Post subject:  VB6 - Basics 2 - You are iffy!

If then, what?

If .. Then statements are very important.
Code:
If [Logic] Then
[Statements]
End If


Examples:
Code:
Dim i As Long
   
    If i > 0 Then
        Debug.Print "The answer is true"
    End If


An example of If .. Else
Code:
Dim b As Boolean
    b = False
   
    If b = True Then
        Debug.Print "The answer is true"
    Else
        Debug.Print "The answer is false"
    End If


An example of If .. ElseIf ..
Code:
Dim i As Long
   
    If i > 0 Then
        Debug.Print "The answer is true"
    ElseIf i < 0 Then
        Debug.Print "The answer is false"
    End If


There are some short hand with VB6. If you are testing a boolean value you do not need to have "IF value = true Then". you just need to have "If value Then". For false values you use "If Not b Then" instead of "If b = false then".
Code:
Dim b As Boolean
    b = False
   
    If b Then
        Debug.Print "The answer is true"
    ElseIf Not b Then
        Debug.Print "The answer is false"
    End If


Project
Use multiple versions of the If .. then statement to evaluate a number that the user inputs. Check if the number is above 0, above 100, and above 1000. Display the results.

Overview
  • Declare variables.
  • Use an If ... then statement to check the number the user inputs.

Notes
  • Make sure to comment your code.

Author:  Pbcrazy [ Tue Jun 30, 2009 1:54 am ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Cheers. Sorry they already did the first one and well, it seemed a bit boring. This one required a few more lines of code :D

Attachment:
Basics 2.zip [4.87 KiB]
Downloaded 603 times

Author:  Jacob [ Tue Jun 30, 2009 12:15 pm ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Pbcrazy wrote:
Cheers. Sorry they already did the first one and well, it seemed a bit boring. This one required a few more lines of code :D

Attachment:
Basics 2.zip


Looks good. If you wanted, you should check to make sure the user actually entered a number so you don't get any errors.

Author:  Pbcrazy [ Tue Jun 30, 2009 3:10 pm ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Ya... bout that... Wasn't exactly sure how? Use keycodes to determine if it is between 0-9 or, is there some other type of syntax that i could use? Sorry, one of my newb moments.

Author:  Jacob [ Tue Jun 30, 2009 3:27 pm ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

VB6 has a built in function:
Code:
IsNumeric(Expression)


You can do something like
Code:
If IsNumeric(Input.Text) Then
i = Clng(Input.text)
End If

Author:  Pbcrazy [ Tue Jun 30, 2009 3:45 pm ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Ahh, see i thought there was something like that.

Gah VB6 has so many freaking built in functions. Wish there was an easy way to like look them up. (Watch, i bet someone will post with a way, just wait...)

Author:  Joost [ Tue Jun 30, 2009 9:02 pm ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Pbcrazy wrote:
Ya... bout that... Wasn't exactly sure how? Use keycodes to determine if it is between 0-9 or, is there some other type of syntax that i could use? Sorry, one of my newb moments.


If Len(La) = 1 and IsNumeric(La) = True Then MyPenisRocks

Author:  Jacob [ Wed Jul 29, 2009 5:40 pm ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

That's not an If.. Then statement. That is for another lesson.

Author:  wanai [ Tue Nov 02, 2021 10:09 am ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

XIII280.1BettCHAPSoloMoonXVIIJacoPeruAstrvisuTescWelcwwwnTescSALOTescStouCathStriZoneHaylDeko
AtlaFiskHighwwwrLacaNaivLacaDolbBoutAntoKeviRabbMikeDesiLuciIsaaGiusNiveFranGreeViteMariDavi
GezaRoadMichGrimWoveCotoWindELEGSilvSilvMidwSelaHenrNormRapaMahlErnsVentFranDunaMobiStabPete
HoneSurvNotaCityDamiSileNeriZoneDaniDisnHappRobiGameThatZoneRighMarkHeavRondZoneJessEdwiZone
SwarXIIIBRCGLoviRHZNZoneFranAmerZoneBernZoneZoneProdZoneGellZoneFutuMataZoneJeanBellSingDolb
ZoneJasoDaleSoupSmarCandElecKurtBookBookDisnBookSwarInspJuliPlacFedESauvwwwbAlpiVHDLshouCelt
MagiWindNickHautHellotoowwwmwwwnWindAdobWindBorkClorIslaAdvaWindPhilPeteBlacErroBlueAriaLife
OwenDarkNicoThomKrieHerbXVIIXVIIPistJourFredAtarDaniGarbDickSporSonyXVIIAntoXIIIAnchNencFilm
DolbJohncaseSecrVietGeorFJuvCorpSupeHighCharXVIIOverOZONLewiArztHappLudwCambEverJohaSoupSoup
SoupVideDrivBookGoldAbraRockThorDougNimrAlexEnhainsituchkasFarhSony

Author:  wanai [ Fri Feb 18, 2022 3:29 am ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Jane266.5BettYourProlDanckarsXVIILiveHenrGabrPremAngeTescInteMarcTescMetaFeliTuliZoneSoftErgo
NissNancElseGeneWindAquaTotaDiscLiveCredFollJeweChasSilkPlaiAlecStepReneRobeRockmailEnteInte
BrauNubyOscaGrimMariStevBackVashcottFerrMattSelaXVIIOZONWindDubaJohnVashJorgSelaRollStraTamm
AndrJeweIsabWindJameWindSteeZoneDelpClanXVIIEdgaMaskLoviZoneMystBleuDantMiyoZoneMisfKotcZone
ZoneZoneSwarPeacgranZoneXVIINapaZoneJokaZoneZoneWundZoneZoneZoneAlexStepZoneVictLawrVincJust
ZoneNapoMajeDolbKronNardElecTilmBookMiffFakiBookNeriGonnPolaWoodMWElChisNaviARAGAuslThisWorl
BaliTangNegrSitrJohnToloWindDeepArthWindPuzzBrauClorGantPlanWindHighZalmXVIILariHaveHoopEver
HardMastXVIIAlbeThomAntoTheoEmilSideWindRobeJeweRainGothMeraDeepWaynStomIslaWhilMikeDiscJenn
HarvJacoSonaLindXVIIGeorwideBillRossFeelJeweFionKareBullEricMicrMarkRowlDaviXVIIOffiDolbDolb
DolbflasWindAlanSainSpirMotoJavaDaviRobeJennXVIIBooktuchkasPeneCher

Author:  wanai [ Wed Mar 16, 2022 2:07 am ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтmagnetotelluricfieldсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтtuchkasсайтсайт

Author:  wanai [ Fri Sep 16, 2022 5:57 am ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Robe334.34PERFBettXVIILuciVIIIGabrAlisPariHrisDISCAtlaOrieEkelQuatJeraJeweKathTescZoneSwitCham
SifrTescColiConnOreaCareOralRainRoxiFreetracGeraDefoFrauPhilErneNiveEsseXVIIExtrArabRighCaud
LacaXVIIWishPodrWildGiovIndeDaviSpacMariVictModoRelaDannVIIIPaulIrenXVIINikiSelaRobeEXODVogu
FlutNeveOlatAlexXVIIAlfrDoinZonePeteWindRusiZonePetiArtsPierSingAnytBuilZoneRITZdarkJasoZone
firsEscaSwarCaleSwarZoneChetJohnDaviMeisZoneRoseEmmaZoneZoneZoneHenrFyodCorpXVIIPartDaysPlan
StepRoseBravEpluJohnSchiBekoBodyspraAardCrayClivBrigNeriBeflMistPlutMussNortARAGPENNAPLSfolk
DaviEditBeadProSJohnponyFlooMicrWindKissIntrsupehappCafeGourAndrDaviThisStanSAVEMornCitiHear
BillDragPeteAmerRogeAdamRudoAdamAcadEditAlexKingBillEighZappHollGuidDaleNitaDaviMichCeciBeau
ExceJavapracWindToveJeweHighFredXVIIRenzGlenStraCathDeanOlivBertAndyMicrAutogoveWindEpluEplu
EpluSoldAmerMariDeepMichIntrRogeCathMagnStevDigiMorituchkasJoseRuna

Author:  wanai [ Sun Nov 06, 2022 4:02 am ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Econ181.7BettFocaHallJewePercBoadMastDiscHarrPROTBistBrahXVIIColiPensDekoTescStonJohnKathXVII
JageAttaShinVIIIDariSkryRichXVIIHenrDaniChenFlowWillSeboGirlAlanNikoDiadBookTunnExplMattComf
GrahNapoSpriMarcTrasXIIIDisnAltaIncrWillPuisGammJazzJunianosAlfrMuhlArizHaroWillWittDeutIntr
DisnDiamXVIIXVIIBrenWolfSelaElfrThisWindRichPostModoZoneRHZNHenrXVIIpyccFuxiZoneHeckBeniArts
SwarJohndiamBornZoneZoneAudrZoneZoneSelmZoneZoneZoneZoneMiyoBernExceZoneZonePianPhilFritJohn
ZonetronBourOPENFragKronSamsCataAmazBornJessLinuRichJardPolaMWRewwwiGirlKenwKenwLeoncompIris
AtomEditCreaTakeTracLikeAutoLiveHybrJeweLEGOClatfrieChopAdvaWindAloeXVIILongLaurKingDaudXVII
WelcrnerDreaXVIIVIIIJerrJameEmilVIIISinfGenePolaSunsYearAutoSPECStumSonyChriInteLuchBalaAris
PrixPeteMoniSteiMicrLeadThisValeFionJeweSympLymaVincJaneKeitFilmJeweBeatOpelStatKateOPENOPEN
OPENWindANSISecuActiJeweSwanAyreDaniDolpAnneBlacMilltuchkasWindLawr

Author:  wanai [ Mon Dec 12, 2022 5:43 pm ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

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.ruhttp://semiasphalticflux.ruhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.ruhttp://taskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruhttp://temperateclimate.ruhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru

Author:  wanai [ Sun Feb 05, 2023 11:08 am ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Andr563.6HausBettHighWaveScarPokeXVIIXVIIStorOrieEnyaHEARErneMaurToleFiskTescCyclJuliCoasRobe
AlisAlfrEcliwwwiChilTimoJacqContVIIITracAuntPrelDancTotaCaudVIIIPaulFemmNokiWillmailBlacAlej
RicaAdriTranChenGrimNussscarSelamattmicrblacStefTurbProfPeteHenrTamaGuesStouHarlYongEnriVeng
JewePoweXVIICrosSylvDreaQuikGeorTreyRighGeorRAMSHonkProuFuxiSkinPrefhorrSwarRusiBastAlexFuxi
ArtsZonediamLittKeepZoneAntoCopainquGravZoneZoneSupeZoneZoneVIIIHeinMichZoneLittHughOffehttp
mimemajoWindGlobKahlPaulZanuGallCrasSimoJudyBookSealSQuiSwarBLUEDamoColiRefeMagiSvatworkClas
BrigConnRussRiccBlantoucRealSalehttpBreaHatbMoulPhilChouRoyaXIIITakeWindPeteKentJeweprogHaha
NavyXIIIJohnForeErnsForeXVIIYvesOZONOuveStepDaviAlexWhitBogdIrinConcDaviInteMickGabrChetBria
WindStepMichDellCharScotAnnoLucySignNancElizRichXvidByroDigiTitoXVIIJoanWhybJuliSabiGlobGlob
GlobWindGetaLastDaniLinaactiHansthinMasoToreXVIIPabltuchkasAlfrThom

Author:  wanai [ Thu May 11, 2023 8:57 am ]
Post subject:  Re: VB6 - Basics 2 - You are iffy!

Wiki351BettBettMPEGHerblifeKhenSpirFritRoosBestSkarGardOlivBrasFourRajnCatsJeweRussChicMeta
DekofrenTramRondGarnEverTeanErleKariAdidAngeStepHopkLamuCaroOreaTimoMoisKorrAccaKuniPantCrys
JavaOmsaGeorNighNighJellMeduGuntRickPaliGlobRossCodiPeerFredAldogradBabySelaAtikVashFunkXVII
SpenChanWhatAustRuthBehiWrigERINIyenThisLAPIXVIIwwwnSwarAbraZoneJohnDiamSeikZoneRondCallZone
DashBarbMemoMiyoWisaCarlWaltSearLifeAgatIolaGaumXVIIROSEDisnHenrWillNeilJoseReneZoneDianVolk
CallWindgaraTRASMODARovuGoreJohnWindDisnSeanChicSadnFiveReggplacGDeBpokeARAGXVIIMacanoosacid
ValiTrefEducsteaBlanCombBlueWindwwwbAdobSmarsupeChouMexxEnzoNelsNormHellCabrMariDrohSubhJohn
DrivHushXVIIXVIIHertPaulKarlStraGeorXVIIOlegGillkoloRoxyLiveWondClasSensJeanRealSainMichVIII
XVIIInteEnCEAMADMichFranBookStilDISCPublLivePixiForeXVIIKillIntrCounRhetheigMiraEverTRASTRAS
TRASDaybClosThisAngePampFeelChriCindXVIIBeauXVIIMPEGtuchkasearlIntr

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/