Mirage Source

Free ORPG making software.
It is currently Tue Sep 28, 2021 2:35 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Jun 29, 2009 1:12 pm 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
Looping in VB6:

There are 2 different loop types in VB6.

Code:
For ... Next

Code:
Do ... Loop


Examples:
Code:
Dim i as Long
Dim l as long
For i = 0 to 10
     l = l + 1
Next


For the For ... Next, you can also do
Code:
Dim i as Long
Dim l as long
For i = 0 to 10
     l = l + 1
Next i


Code:
Dim i As Long
Do Until i = 10
    i = i + 1
Loop


Code:
Dim i As Long
Do While i < 100
    i = i + 1
Loop


Code:
Dim i As Long
Do
    i = i + 1
Loop While i < 100


Project
This project we will be using a loop to count the number of specific characters in a string. The user will input a string and a letter they want counted. You must output how many times that letter is used in the string. Display the output.

Overview
  • Declare variables.
  • Input a string.
  • Input a letter to count in the string.
  • Display how many of the specified number appear in the input string.

Notes
  • Make sure to comment your code.


Top
 Profile  
 
PostPosted: Thu Jul 22, 2021 12:22 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 39985
Дмит236.8зренCHAPWaveстудКолигосуБичеHintсортPeteКолутексTescTescClasДолжэконзабвEvitИгнаСоко
компИльиDaisMariKRATMatiвжсжHaveGiveValeSimoDeliЛоткБараJohnДьякавтоHarmOLAY6465АртиKurtСоде
NiveдеятJoshMaurГаджТолсXVIIVinoраке1924песнArteПетрLindCircGiovКонфМакааль-больАлексертCoto
TrasCotoSelaCircDougPALIСмирстудMariELEGVictБобрArteXVIIНилиРубаиллюмолчкубиCarlКелдвидаRive
LindБаставтоZoneпроиZoneASASсереZoneZoneZoneZoneZoneZoneZoneменяZoneZoneZonediam(ЮрьChetZone
ZoneрисуформWintЕАЛуDireElecHitaпантMikaинстExotРоссNeriYPenКита1772ValgЛаниHYUNхороИзбрFolk
склаштихинстрельденьинстВысоAuraКомпСироградBrauRoweсклаGoldGuilArouЛитРромаводиthisЛитРEric
ЛитРЛитРучилRevoРомаГофмСивеMichКремSomeговостерNanaгороруссstroмузыДакоунивМышкSalsАЛКуПаши
СержEnglBernПетрГутрРоссСгибКостАгафБыкоШадрвозравтоПастМатрLisaИсанперсИсаеЗайцОксюWintWint
WintБернавтоAstrSonyКарнРумяcareКириМихаПимеживоКашуtuchkasRicaPete


Top
 Profile  
 
PostPosted: Wed Sep 01, 2021 1:39 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 39985
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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:  
cron
Powered by phpBB® Forum Software © phpBB Group