473,386 Members | 1,652 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,386 software developers and data experts.

what is wrong with this code

kirubagari
158 100+
Private Sub Command1_Click()

dim i as long
dim arrbyte() byte


For i = 1 To mFileSize

rich1.Text = rich1.Text & Hex$(arrByte(i)



this coding gives the error over flow.why overflow occur and what is the solution.the file that read by the progarm got 600000.What is the solution and one more thing i would like to ask.

if i make the file size i=1 to 100
the output as shown

1FF10002FFB8A103FF8D0(hexdecimal form)

i want to read it as 01 FF 01 00 00 00 02 FF 0B 8A 01 00 03 FF 8D 00

normaly in the haxadecimal we read it 2 valus.It cant raed the 0.JUST READ ONE OF THE VALUE
Jul 12 '07 #1
3 1003
hariharanmca
1,977 1GB
if i make the file size i=1 to 100
the output as shown

1FF10002FFB8A103FF8D0(hexdecimal form)

i want to read it as 01 FF 01 00 00 00 02 FF 0B 8A 01 00 03 FF 8D 00

Expand|Select|Wrap|Line Numbers
  1. rich1.Text = nothing
  2.  
  3. For i = 1 To mFileSize
  4.  
  5. rich1.Text = rich1.Text & Hex$(arrByte(i) & " "    '(Space after value)
  6.  
  7. next
Jul 12 '07 #2
hariharanmca
1,977 1GB
Private Sub Command1_Click()

dim i as long
dim arrbyte() byte


For i = 1 To mFileSize

rich1.Text = rich1.Text & Hex$(arrByte(i)



this coding gives the error over flow.why overflow occur and what is the solution.the file that read by the progarm got 600000.What is the solution

usualy this over flow error will come if the value is not in the size of datatype size
Jul 12 '07 #3
Killer42
8,435 Expert 8TB
Perhaps there is a limit on the length of the text in a richtextbox? After all, you're trying to put anything up to about 1.2 million characters in it. As for the format, just add a space after each one, as shown by hariharanmca, and use my "fixed-length Hex$" function (posted in another of your threads today) to force two digits.

One thing you could do to try and debug the overflow is break things down into simpler steps, so you can pinpoint what is causing it. Then we can try to work out why. For instance, is the overflow occurring in:
  • The Hex$() function, or
  • the concatenation to Rich1.Text, or
  • the indexing of the arrByte array, or
  • The FOR statement, or
  • something else you haven't shown us?
Jul 12 '07 #4

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

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
72
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
46
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
1
by: GS | last post by:
I got a combobox box that I load at load time. the Item and vales ended up in reverse order of each other, what went wrong? the database table has the following row code value ebay ...
98
by: tjb | last post by:
I often see code like this: /// <summary> /// Removes a node. /// </summary> /// <param name="node">The node to remove.</param> public void RemoveNode(Node node) { <...> }
9
by: Pyenos | last post by:
import cPickle, shelve could someone tell me what things are wrong with my code? class progress: PROGRESS_TABLE_ACTIONS= DEFAULT_PROGRESS_DATA_FILE="progress_data" PROGRESS_OUTCOMES=
20
by: Daniel.C | last post by:
Hello. I just copied this code from my book with no modification : #include <stdio.h> /* count characters in input; 1st version */ main() { long nc; nc = 0;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.