473,394 Members | 1,221 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

stop scanning and display msg box after scanning reach EOF

158 100+
For i = 49 To mfilesize Step 6

rich1.SelStart = Len(rich1.Text)

rich1.SelText = "Before : " & HexByte2Char(arrByte(i)) & _
" " & HexByte2Char(arrByte(i + 1)) & " " _
& HexByte2Char(arrByte(i + 2)) & " " _
& HexByte2Char(arrByte(i + 3)) & " " _
& HexByte2Char(arrByte(i + 4)) & " " _
& HexByte2Char(arrByte(i + 5)) _
& vbNewLine

If arrByte(i) <> a Then
arrByte(i) = a
changeMade = True

End If
If arrByte(i + 1) <> b Then
arrByte(i + 1) = b
changeMade = True
End If
If changeMade Then
AnyChanged = True
rich1.SelText = "After : " & HexByte2Char(arrByte(i)) & _
" " & HexByte2Char(arrByte(i + 1)) & " " _
& HexByte2Char(arrByte(i + 2)) & " " _
& HexByte2Char(arrByte(i + 3)) & " " _
& HexByte2Char(arrByte(i + 4)) & " " _
& HexByte2Char(arrByte(i + 5)) _
& " <--- Corrected" _
& vbNewLine

End If


i want to popup msg box that will be display a msg that saying the scanning reach the last byte. It mean the scanning is finished.

this is the coding.is it correct?

if i=mfilesize then

end if

and another question how to stop scanning when we wish to stop when the scanning is going on.what is the code
Jul 19 '07 #1
1 1517
8,435 Expert 8TB
I don't think there's any need to check the value of your loop counter. Just put the MsgBox after the end of the loop. That is, after the Next statement.

Ok, here's a brief description of the sort of technique I use to interrupt a long-running process. I don't think there is really any "right" or "wrong" way (unless it doesn't work, of course, in which case it is wrong). But here's my way.
  • Create a global (or form-level) variable called UserWantsOut.
    The name is up to you, of course - that's just what I use. To make it global, place it in a code module (not a form) and use...
    Public UserWantsOut As Boolean
  • Place a button on your form labelled "Stop" or "Abort" or similar.
  • At the start of your process, show and/or enable the button, and set UserWantsOut to False.
  • At the end of your process, hide and/or disable the button.
  • In the click event procedure for the button, just do this...
    Expand|Select|Wrap|Line Numbers
    1. UserWantsOut = True
  • In your potentially long-running procedure, each time around the loop (or every 100 times, or 1,000 times or whatever), execute something like this...
    Expand|Select|Wrap|Line Numbers
    1. DoEvents ' <-- This is important.
    2. If UserWantsOut Then
    3.   Exit For
    4. End If

And in this case, after the Next statement I would do something like...
Expand|Select|Wrap|Line Numbers
  1. If UserWantsOut Then
  2.   MsgBox "Aborted by user!"
  3. Else
  4.   MsgBox "Finished!"
  5. End If
Jul 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: W. Cerven | last post by:
I have a list of n inputs of varying type I wish to read from a file: For example: string string int int double double int int int double ... My input file gives its values on a single line,...
by: Chris | last post by:
How do I stop displaying "undefined" when using the code below. The problem occurs as I want to display 5 items per page using setInterval but this causes 'mycars' to reach a value that doesn't...
by: S. Nurbe | last post by:
Hi, I have programmed a while loop. At the end of this loop I want to stop it until someone hit a key. When someone hits the right key the loop shall start again. Actually I thought this would...
by: Timo Haberkern | last post by:
Hi there, i have some troubles with my TSearch2 Installation. I have done this installation as described in http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_compound_words...
by: Bob Alston | last post by:
I am looking for others who have built systems to scan documents, index them and then make them accessible from an Access database. My environment is a nonprofit with about 20-25 case workers who...
by: shai | last post by:
I am working at .net 1.1, writing in c#. I have windows service with a COM object. Every unexpected time The COM object throw an error that make my service get stuck (do not respond). I can catch...
by: tshad | last post by:
We have a few pages that accept uploads and want to scan the files before accepting them. Does Asp.net have a way of doing a virus scan? We are using Trendmicro to scan files and email but don't...
by: mageshwar | last post by:
hi, i have using three functions to scan registry keys (like emptykeys,applicationpatherrors).once the function starts from my button click event, i cant...
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, We have many forms on our site that users can fill out and ask questions, request information etc. but somehow, we receive a lot of junk mails (more than two hundreds) within two weeks...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.