473,325 Members | 2,442 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,325 software developers and data experts.

stop scanning and display msg box after scanning reach EOF

kirubagari
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

Next




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

msg box "SCANNNG IS FINISHED"
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 1509
Killer42
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

11
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,...
1
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...
14
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...
7
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...
6
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...
7
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...
4
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...
2
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...
4
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.