Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




VB's Equivalent For "continue" ??


Hi Guys

Here's a very elementary question, to which I do not have an answer.

What is VB's equivalent for C's "continue" ?

( For those who are not familiar with C, let me tell you what "continue" does.

"continue" is used to re-route the control back to the first statement in a loop. )

So, is this possible in VB, without having to resort to GoTo ??


Thanks

Suhaib




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
"continue" And "break" Keywords ???
What's the equivalent of C++'s "continue" and "break" keywords in VBScript?

Here's a sample of what I mean:


while value > 0
if bSomething then
continue ???
end if

...
wend




Thanks!

"SendMouse" Equivalent For "SendKeys"?
VB has a powerful command called "SendKeys" where by you can emulate keyboard strokes in code.

But I need a way to simulate a mouse click in code. Something along the lines of a "SendMouse" command.

Any ideas, anyone?

D.

If I Use "SaveSetting App.Title, "Settings", "Font", "001122"" - Save Date In The Registry, Where Ca
If i use "SaveSetting App.Title, "Settings", "Font", "001122"" - save date in the registry, where can i find the value saved in the registry? Thanks

File Not Found : "C:windowssystem32ieframe.dll1"-- Continue Loading Project?
My friend made a project and sent it to me. It compiles fine on his system but when I try loading it I get:

File Not Found : "C:windowssystem32ieframe.dll1"-- Continue Loading project?


Any ideas?

Thanks!

--DB

File Not Found : "C:windowssystem32ieframe.dll1"-- Continue Loading Project?
So this error comes up when I try and load a project made by a friend:

File Not Found : "C:windowssystem32ieframe.dll1"-- Continue Loading project?


It works fine on his system. Any ideas?

Thanks!

--DB

Continue Asking The Experts About "displaying Results From A Crosstab Query "
It's great to find the topic "displaying results from a crosstab query" posted sometime ago. It can solve the problem with crosstab query that I stucked on quite a long time. But I still have one more problem: How about a crosstab query with parameters? SQL experts, please help

Thanks a lot in advance,

Viet

Check "FileExists" Before Continue With Procedure.
My program needs to extract Data from a text file, how can I check that the file "C:Myfile.txt" exists using a control button click before running the rest of the Procedure within the control.

If the File exists ( I want to continue with the procedure )
If not ( I wish to end the Procedure and show a different Form - telling the user the file does not exist etc. )

Can you please help.

What Is The Adodc Equivalent Of "data1.recordset.edit" ?
what is the adodc equivalent of "data1.recordset.edit" ?
please help

Convert Letter To VbKey Equivalent ("a" > VbKeyA)
I am using PostMessage API to send text to a certain program.
I've got my program to work when I use
VB Code:
PostMessage hWnd1, WM_KEYDOWN, vbKeyA, 0
But I need to send a string that will be defined at runtime, so I need a way to do something like
VB Code:
PostMessage hWnd1, WM_KEYDOWN, "something", 0
but that code doesn't work.
I need to send a long value of each letter so I need to know how to convert a letter to its vbKey equivalent

SQL Server Equivalent Of "SELECT ... FROM DUAL" ** Resolved **
In Oracle, you could do something like:

Code:SELECT "All Customers" AS CustName FROM DUAL

UNION

SELECT CustName FROM Customer

How do I do this in SQL Server?



Edited by - Shandy on 1/19/2004 9:51:33 AM

Equivalent Of '" && Text1.text && "' For An Integer?
i use '" & text1.text & "' to reference a string, but lets say i have an integer called years and i want to say:

where [Age] = years

what kind of punctuation do i need around it?

Equivalent Of "typdef TYPE Varname" In VB ?
Read the subject.

Regards,

el-nino

Problem With The "Continue Do" Statement. Help!
My Do...Loop Until works fine until I've added the "Continue Do" statement.
I've got a Syntax Error message box. Apparently, cannot run it.
The code is created as an excel macro. Could someone tell me what is wrong. Thanks!

Do
ArraySerialNumber = InputBox("ENTER ARRAY SERIAL NUMBER (0004, 0013, etc... Then press ENTER on the keyboard or Click OK)", "ARRAY SERIAL NUMBER INPUT", "XXXX")

If ArraySerialNumber = "" Then
End
End If

If ArraySerialNumber = "XXXX" Then
Response = MsgBox("NOT A VALID ARRAY SERIAL NUMBER. PLEASE RETRY", vbRetryCancel + vbExclamation + vbCritical, _
"Ooopsss!!!")
If Response = vbCancel Then
End
End If

Continue Do
End If


If Len(ArraySerialNumber) <> 4 Then
Response = MsgBox("ONLY 4 DIGITS ALLOW. PLEASE RETRY", vbRetryCancel + vbExclamation + vbCritical, _
"Ooopsss!!!")
If Response = vbCancel Then
End
End If

End If

Loop Until Len(ArraySerialNumber) = 4

Solution&gt; Error: """"&&H8007007E (-2147024770) The Specified Module Cannot Be Found"""
Hello

This is the error what i am getting after installing a package of one of my module on user testing machine.
The same module being working fine on others.


What can be the reason for this and what can be the probable solution for this?

Sandeep

VB-equivalent To "server.urlencode"
I am searching for an VB6-equivalent to ASP "server.urlencode"

what do I want to do?
I read out a string which contains special characters like "ë" and make a XML-string out of it. Then I want to load the string into a XMLDOMDoc40 and send it to a different database via ServerXMLHTTP40

Everything works fine with normal ASCII-text.

I already tried a lot of string parsing or working with a different encoding like
strResponseText = "<?xml version=""1.0"" encoding=""utf-7""?> "
strResponseText = strResponseText & vbNewLine & HttpReq.responseText
objDomdoc.loadXML BinaryToString(strResponseText)


regards
Raggi

Is There A Code Equivalent To "End Task" ??
I need to be able to close a program that has to be closed by using "End Task." (I do not know why this is .. it just is).

I know the handle and the caption of the window.

Does anyone know how to do this.

Thanks.

Method "SaveAs" Or "Save" Of Object "Excel.Workbook" Does Not Work.
Hi people.
I did for a long time a program that uses excel automation, so that from a template will create a final file with some data pulled from the database (with ADO). At the end and when the Excel file is ready to be saved I got in a couple of computers some problems. In the whole LAN have XP, but in these 2 computers we have SP2. I have checked the rights and are OK (I have even tried to save the Workbook under the Temp folder and also the same problem).
Working with Office 2003 (SP1).
I have searched in internet about any bugs but I don´t find anything.
Any ideas.
Thanks for your time
Jaime

"Setup Cannot Continue Because ......"
Hi,

I'm using VB 6 and Access db. I've created my 1st application, created a package and tried to install it on another pc.

During the installation on the target pc, it says:

"Setup cannot continue because some system files are out of date on your system. Click OK if you would like setup to update these files for you now. You will need to restart Windows before you can run steup again. Click Cancel to exit setup without updating system files."

It keeps giving the error eventhough I choose OK and reboot. Weird.

The Bootstrap files no. 3-7 are causing this error :

File1=@Vb6stkit.dll,$(WinSysPathSysFile),,,3/26/99 1:00:00 AM,101888,6.0.84.50
File2=@COMCAT.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,5/31/98 12:00:00 AM,22288,4.71.1460.1
File3=@STDOLE2.TLB,$(WinSysPathSysFile),$(TLBRegister),,1/13/03 2:49:54 PM,16896,2.40.4518.0
File4=@ASYCFILT.DLL,$(WinSysPathSysFile),,,8/31/99 4:55:18 PM,147728,2.40.4277.1
File5=@OLEPRO32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,1/13/03 2:49:54 PM,229376,5.0.4518.0
File6=@OLEAUT32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,1/13/03 2:49:54 PM,929792,2.40.4518.0
File7=@MSVBVM60.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,2/23/04 8:42:40 PM,1386496,6.0.97.82


If I remove 3-7, I get pass the installation, but upon running the program, I get an error, " The data binding DLL, 'VB5DB.DLL' could not be loaded." Probably caused by the removal of the above bootstrap lines.

Any thots will be appreciated on how I can solve the problem.

Gurdip

"Continue" Does Not Work!
Hello VB community,

I am trained in C++, and my current research requires me to do some VBA. Great, I am done with my little code, but I cannot get "continue" to work. I am pasting the loop in here, and my problem is in red characters. VB says: COMPILE ERROR: EXPECTED: EXPRESSION. And it highlights Continue For in red.

So, as you can see, if errorFlag1st and errorFlag2nd are TRUE, I do not want the counters to increment and I want to go the the next iteration, and try it out with a new random number. To do that, isn't "continue" the right command?

Please help! I am losing it!

Thanks, Sasha

----

Do While int500Counter < 500

For int100Counter = 0 To int100Counter = 100
tempRandValue = Int((lUpperBound - lLowerBound + 1) * Rnd + lLowerBound) 'generates a random value
Write #130, tempRandValue

'**FIRST CHECK: is tempRandValue found in DA field?
Do While Not EOF(120) 'loops until end-of-file reached
Input #120, testValue1
'if matching value is found, then exit loop, errorFlag1st remains FALSE
If testValue1 = tempRandValue Then
Exit Do
Else
errorFlag1st = True
End If
Loop

'**SECOND CHECK: has tempRandValue already occured within 2nd nested loop?
If errorFlag1st = False Then 'this loop will only execute if tempRandValue passes first integrity check
Do While Not EOF(130)
Input #130, testValue2
If tempRandValue = testValue2 Then
errorFlag2nd = True
End If
Exit Do
Loop
End If


If errorFlag1st = True Or errorFlag2nd = True Then
'Continue For
'so, if tempRandValue does not pass either of the two integrity checks, this loop (int100counter)
'will CONTINUE (that is, skip this iteration without incrementing any counters)
End If

Write #200, tempRandValue 'once again, this will only be done if tempRandValue passes both integrity checks

int100Counter = int100Counter + 1
Next

int100Counter = 0
int500Counter = int500Counter + 1

Loop

Header + "Continue"
The report is broken down by header and footer for each:
Month
  Plant
    PartNumber

The detail section is hidden, and each header has totals for QTY and VALUE.

However, here is an example for the month of April:
Page1
April
   Hanger
     11225                25        $25.00
     12351                30       $125.00
   Final Line
     12252               100        $522.00
     253585              2005       $1,256.95
   Construction
     16459               22         $80,025.00
     1254687             10         $154,125.00
Page2
April
   Header
     part
     part
   Header
     Part
     part
     part

                April totals:  xxxxx       xxxxxx
What I would like to do is for page2 to have the month header read April Continued

Is there anyway to do this?  I have tried putting a text box "recordcount" with control source =1 in a variety of places and =iif([recordcount]>1,"Continued","") beside [Month] in the month header.  However, since each line total is its own header it record count never goes above 1.
What I am thinking is that there needs to be away to write:
If this is the first time the month is used, do nothing, else if the current month does not appear in its footer on the previous page "Contined".
I would think this would be simple, but it is driving me crazy.

Thank you for any and all help,

PBrown

Using "continue" Command Like In C / C++
in a for loop :
Code:
for i=1 to 10
    if i=3 then continue ' *****
    debug.print i
next i

i want to do something like the continue in other languages
is this possible?
thnaks in adbvance
peleg

Israel - the best place to live in after heaven, but no one want's to go there so fast.

http://www.networked-toys.com/
http://www.nirlat.com/home_page.asp

How To Replace "Apple" With "Banana" In A String That Contains "Orange" In A TXT File
Whoa! Long thread title. Basically, how can I search for any string in a text file that contains "Orange", then replace "Apple" with "Banana" in that same string? Is this difficult? Thanks!

Data1.RecordSource = "select * From Salary Where &#22995;&#21517; Like " + S + " " * ""
Data1.RecordSource = "select * from salary where 姓名 like " + s + " " * ""
thanks in advance gentlemen and ladies..
firstly...I don't know what must add "++" between "s " variant..
who can tell me why?? thanks , ,, I really don't know why it does this..
maybe i am a beginner..please forgive me why add ++ between s..thanks

How To Change Boolean Field From Displaying "0" And "-1" To "Yes" And "No"
Hey there,

I have a data report, which displays a few fields from an Access table, one which is a boolean. At the moment if the boolean value is True, then on the data report it displays "-1", and if False "0".

How can I change this so it displays "Yes" if true and "No" if False?

Would be really grateful for any help.
Thanks.

ADO Equivalent Of DAO "nomatch"
In DAO, vb6, there is a property called "nomatch" to see if a record already exists. Does anyone know how to do this in ADO?

Help With Equivalent C++ "-&gt;" Command
Hi al. i am looking for a command that will do the same thing as the "->" in C++.
All help will be appreciated.

What Is VB Equivalent Of QB "Out &&H3BC, 255" .
I have been using Quick Basic to send commands to controller boards that I have installed in my PC. A typical Quick Basic command might be: Out &H3BC, 255. You probably know that this "Out" command writes the binary equivalent of "255" at memory address &H3BC.

Does anyone know an equivalent command in Visual Basic?

Edited by Greb1 on 02-27-2000 at 08:22 PM

Any Equivalent Of "CPtrList" In VB?
I want to make a linked-list of user Classes. Something like "CPtrList" in VC. I know that "Collections" doesn't work, because it only groups together controls under a common heading. Unlike "CPtrlist" I want to add the classes, not their addresses. Is there any Control for what I have in mind? (The classes are of the same type, but just have different data in them).

Deepak.

Extract Local Names For "OK", "Cancel" And "Apply"
Hi!

I noticed that some programs written in C++ have an English language, but the captions of the buttons "OK", "Cancel" and "Apply" are in German, Swedish or whatever localized Windows version the user utilizes. Any idea how to obtain the captions of those buttons in VB? The only method which comes into my mind is to get the locale ID and have an array with strings for the the various language versions, but I doubt that those programs do it in that way.

Regards,
Sebastian

&lt;input Type="submit" Name="op-savefile" Value="Save"&gt; - How To S
<input type="submit" name="op-savefile" value="Save"> - How can you submit this button through visual basic in a webbrowser?

Disabling "wake Up", "sleep" && "power" Button
hello there, how to disable "wake up", "sleep" & "power" button with visual basic? thanks

Pleez, Read This!!! Matter Important! "Printing In "DOS Mode" Using "Shell" -not Happening, I Wonder
Hi

[I had to repost it since I have not received any replies for my earlier post]

I have a problem.

Following is the code :

Shell("c:windowscommand.com /c type " & App.path & "matrix.txt &gt;prn")

where App.path is C:XYZ

when the above line is executed, the contents of "matrix.txt" is not printed on the printer. Instead, control just passes on to the next line.

So, to find out why, I modified the line thus.

Shell("c:windowscommand.com /K")

The above command takes me to the "command prompt". Here, when I give the command "type c:xyzmatrix.txt &gt;prn", which is what the vbcode does, I get the message "file creation error".

So, I have identified the problem. Can anyone tell me why this "File creation error" occurs, And how to solve the problem?

Thanks for reading through.

"Setup Cannot Continue Because Some System Files Are Out Of Date On Your System"
Hello,

I've created an install program with the package & deployment wizard that ships with vb6. When i try to intall my program on windows 2000 (can't really say if it is just windows 2000 at this point) I get the error:

"Setup cannot continue because some system files are out of date on your system. Click OK if you would like setup to update these files for you now. You will need to re-start windows before you can run setup again. CLick cancel to exit setup without updating these files."

It seems no matter how many times I click ok and re-start the system, the message continues to pop up and wont let me install the program. Any suggestions?

Also, when i do successfully get the install to work on certain machines, it displays:

"An error occured while trying to register the file "C:windowssystem32msado25.tlb"

Ideas?

Thank you.

Getting The File "Type" Descriptions (i.e., "doc" = "Microsoft Word Docume
Hello there,
I am creating an Explorer-type Listview to display the files in a directory, and one piece of info I need to know how to obtain is the file "type" (i.e., "doc" = "Mircosoft Word Document", "xls" = "Microsoft Excel Worksheet", etc.). Is there an API, or does anyone have a technique to do this? Thanks.

Changing The "title" Of A VB Created Word Doc From "Document1" 2 "BadgerBai
Ok, when I create a new word doc it automatically takes on the name "DocumentX", where X is a number greater than 1.
What I want to do is change this by using something like:

VB Code:
Dim objWoof As New Word.ApplicationDim objGrowl    As Word.Document    Set objGrowl = objWoof.Documents.Add    objGrowl.[What Property] = "Badger Baiters R Us"

Is this possible?

Oh, and b4 anyone mentions it, I do NOT want to save it, that is NOT an option...just getting that out the way now

Rarararrrrrrrrr

Woka

Resubmitting: "BeginTrans" , "CommitTrans" And "Rollback With Data Environments
----- Original Message -----


From: shankar [ babu ]


To: visualbasic-l@OpenITx.com


Sent: Wednesday, February 26, 2003 12:24 PM
Subject: "BeginTrans" , "CommitTrans" and "Rollback with dataenvironments



hello everybody,
I am using data enviroment designer in my project.


I am getting error while using
"BeginTrans" , "CommitTrans" and "Rollback"
of the DataEnvironment 's connection properties



kindly let me know the solution
thanks in advance
bye
shankar

Can Someone Guide Me On How To "PUT" A "CHECKBOX" Inside A "Datagrid" For VB6.0?
Can someone guide me on how to "PUT" a "CHECKBOX" inside a "Datagrid" for VB6.0?
please i need these to complete my program security....................for my thesis? please please!!Can someone guide me on how to "PUT" a "CHECKBOX" inside a "Datagrid" for VB6.0?

Combobox Help """""""""""""'Urgent"""""""&&quo
Hi Guys,,,,,,

This may be the stupid way.But i need this.................

   I am using combobox in my form. I set the style to Dropdown combo.

Here we can exter text in combobox b'coz of the style Dropdown combo.
But i don't want to allow user to enter ......allowed only to select.....

For that i can set the style to Dropdownlist.

But i don't want this style. B'coz i can't clear the text at run time.

Tell me if dropdown combo means, User shouldn't enter at runtime
Tell me if dropdown list means, how to clear the text at runtime...


Pls help me out.....Urgent
sangeetha

"BeginTrans" , "CommitTrans" And "Rollback With Data Environments
hello everybody,
I am using data enviroment designer in my project.


I am getting error while using
"BeginTrans" , "CommitTrans" and "Rollback"
of the DataEnvironment 's connection properties



kindly let me know the solution
thanks in advance
bye
shankar

"continue" In Vb6?
hello guys

is there a way to continue the llop in vb6
like we do in c++
i know theres a way of doing that in vb2005
but i want to know if that is possible in slightly older version
im using vb6
thanx
rockbold

May I "continue"?
Here's yet another easy question from a VB novice. In VB what's the equivalent of the "continue" statement used in C++?

Thanks,
Alvaro

Export Table From MS Access To Outlooks Contacts "Standard Field" - With Conatct Item "Notes"
Export table from MS Access to Outlooks Contacts "Standard Field" - with Conatct Item "Notes" ...?

Inverted Commas In String "etc" && Variable && """
I need to include a double inverted comma in a string, here's some more detail...

MsgTitle = "RaceControl 2003"
MsgText = "Enter password."
rcvarValueString1 = InputBox(MsgText, MsgTitle)
rcvarValueString2 = "MS Access;PWD=" & rcvarValueString1 & """
Set dbRacecontrol = OpenDatabase("RaceControl2003.mdb", False, False, rcvarValueString1)

The last part of the Set statement needs to read "MSAccess;PWD=password" including the double inverted commas (where password is the password for the database). However, I want to make the user type in the password... I suppose what i've done so far is correct, but I don't know how to include the double inverted commas in the variable rcvarValueString2. The rest of the Set statement is definitely correct.

Thanks in advance,
Mat

Creating Program "item" In Existing Start Menu "group"
Hi all,

I'm finally at the stage of packaging my application for distibution here at work. When it installs, I don't want it to create a new group in the start menu rather I want to ADD it to an existing group. All of our essential programs go in to a group called "Desktop Applications". During the P&DW, I created a new Group under Programs called "Desktop Applications" and put the program item under that group thinking it would recognize it as an existing group and just add it. Well, apparently I did something wrong because it doesn't add it to this group, nor does it add it anywere else.
Does anyone know how to do this?

How To Change All Cells Format Type From "General" To "Text" Using VB Code
Hi Guys,
I am new to VBA. If you see my code below, it gets the name from user to insert a new sheet into existing work book. Now, when I create this new worksheet, I want to change their all cells format from "General" to "Text". In that case, whatever I add it is saved as "text" not number or general.

How can I do that? Please help me.


Code:
On Error Resume Next
Dim count As Integer

If txtNewSheet.Text <> "" Then
wbDpiFavorites.Sheets.Add

' Get the sheet with the name selected in the Sheet combo box.
Set shtFavorites = wbDpiFavorites.Sheets.Item(1)

shtFavorites.Name = txtNewSheet.Text
cmbSheet.AddItem shtFavorites.Name

cmbSheet.ListIndex = cmbSheet.ListCount - 1

wbDpiFavorites.Save
Set shtFavorites = Nothing
End If

How To Reach Each File In A Folder In Order? With "FileSystemObject" - "Files" Class.
I know that I can reach any file(or filename) by using FileBox control with


Code:
'I can choose any file with its index. The Files are sorted by their names
File1.List(FileIndex)
I want to do the same without using FileBox control, else I tried to reach Files
with


Code:
Dim fso As New FileSystemObject, fil1 As File, fol1 As Folder, fc As Files

Set fc = fso.GetFolder(sFolderPath).Files
MsgBox fc.Count

'Nothing wrong up to here
'but this line gives error
MsgBox fc(1).name

I figured it out that

Code:
Msgbox fc(index) 'is wrong
Msgbox fc(key) 'this is the right one
So what is key here?

And Is it possible to reach each file with in order(as sorted by names)
(ex: I want to access the 6. file or 3. file) with FileSystem Object?

Ofcourse any other ideas will be wellcome.

Emulating The "APPLY" Button Within The Appearance Options "Refresh The New Settings"
Hi Guys,

I'm needing some help with this one. I've got a copy of the HKCUControl Panel hive and need to apply this to the registry and then "apply" the changes. The problem lies with "refreshing" the registry so that the changes apply.

Here's an example:

1. Open Regedit and change the following key = HKCUControl PanelColorsBackground to 0 0 0 (black, or any choice of color!) and close regedit.

2. To apply the changes, a user needs to log off and then back in. This is no good.

I've tried running TSKILL explorer.exe but this does not help either..

Any help would be great.

A Stupid Problem: "Error Accessing The System Registry" ("Solved") Thank You
This is a very silly problem. I tried to have a look of References from Project dropdown menu, it returned a critical error:

"Error Accessing the system registry".

I reinstalled VB6 but it seems that the problem still exists. Anybody please tell me how to solve the problem.

thanks in advance





Edited by - kenyiwei on 5/6/2004 2:07:51 AM

Copyright © 2005-08 www.BigResource.com, All rights reserved