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

stupid question i guess

i had develop a GUI using vb6.0 and it source code but i really dont know whether my souce code is working or not. could somebody help me on this to check my souce code? one more thing, if i key in an integer in val(test) in the source code, the integer will be send to mscomm1 in hex format, right? thanks..
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.          Form1.Caption = "App1"
  3.          With MSComm1
  4.          MSComm1.Handshaking = 2
  5.          MSComm1.RThreshold = 2
  6.          MSComm1.RTSEnable = True
  7.          MSComm1.Settings = "9600,n,8,1"
  8.          MSComm1.SThreshold = 1
  9.          MSComm1.PortOpen = True
  10.          MSComm1.InputLen = 2
  11.          MSComm1.DTREnable = True
  12.  
  13.          End With
  14.          Command1.Caption = "&Send"
  15.          Text1.Text = Val(test)
  16.         End Sub
  17.  
  18.       Private Sub Command1_Click()
  19.          MSComm1.Output = Text1.Text
  20.       End Sub
Mar 24 '08 #1
8 1198
debasisdas
8,127 Expert 4TB
You need to check the code using Break points.
Mar 24 '08 #2
debasisdas
8,127 Expert 4TB
1.establish the break point using F9 in the line of code u want to debug.
2.run the code
3.Use F8 to check the execution of the code line by line.
Mar 24 '08 #3
ok. i already done that. there is no error. can i ask question. if i want only the integer to be put in my text box, what is the instruction should i include? if i put integer, the output at mscomm1 is in hex? thanks. you are helping me a lots. i tried to finish my final year project
Mar 24 '08 #4
QVeen72
1,445 Expert 1GB
Hi,

To Make TextBox to accept only numeric write this code in Textbox's KeyPress Event:

Expand|Select|Wrap|Line Numbers
  1. If KeyAscii <> 8 Then 'Allow BackSpace
  2.    If InStr("0123456789", Chr(KeyAscii)) = 0 Then KeyAscii = 0
  3. End If
  4.  
Regards
Veena
Mar 24 '08 #5
thanks veena but that not solve my problem yet. please check your PM. i had leave a message for you.please read...
Mar 25 '08 #6
Killer42
8,435 Expert 8TB
ok. i already done that. there is no error. can i ask question. if i want only the integer to be put in my text box, what is the instruction should i include? if i put integer, the output at mscomm1 is in hex? thanks. you are helping me a lots. i tried to finish my final year project
Are you talking about restricting what the user can type in there, or what?

Assuming test is a string containing a numeric value, the code shown should place the number in the textbox.

Although I'm not really familiar with the MSComm control, I'll be somewhat surprised if a number that you send to it is transmitted as a hex string. I would expect it to send out exactly what you give it.
Mar 25 '08 #7
that right. i'm try to restrict user to enter the numberic only. what shoul be adjusted to my source code? i'm really not sure about the about of mscomm. that why i'm aking the genius! i need number to send in hex string so that it can trigger my PIC circuit. thanks
Mar 25 '08 #8
Killer42
8,435 Expert 8TB
Filtering user input to accept only numbers has been covered a few times here recently - try the search box. Personally, I feel the MS Masked Edit control is probably your best bet, as it allows simple control over user input. I haven't used it in years, though.

If you have a number and want to convert it to a hex string, jsut use the Hex$() function.
Apr 1 '08 #9

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

Similar topics

6
by: John Wiese | last post by:
I am creating my first website and need some help desperatley. I have choosen to use Front Page XP for this simple Intranet project. All I am trying to do is: 1. Collect childrens names for a...
5
by: Ender | last post by:
Let's assume you are developing a database application and you have an ID field. You setup the ID field in the database as a 1 up increment starting at zero. Whenever I see programs, everyone...
7
by: Matthew Del Buono | last post by:
Don't try to solve the problem. I've found a way -- around or fixing it. I'm just curious as to whether this is Microsoft's problem in their compiler or if there's a standard saying this is to be...
16
by: Justin Hoffman | last post by:
This is a question concerning query optimisation. Sorry if it's a bit long, but thanks to anyone who has the patience to help - This is my first post here... If I have two tables:...
2
by: Lampa Dario | last post by:
Hi, where is this stupid error in this program? When I execute it, i receive a segmentation fault error. #include <stdio.h> int main(int argc, char *argv, char *env) { int i=0; int l=0; int...
4
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give...
5
by: StillStuckOnJava | last post by:
I'm having a stupid problem with V.S./C#. I've created a class and two subclasses, and I want to instantiate either of hte subclasses after users make a selection. Then I want to use that class to...
4
by: K8CPA | last post by:
Hi Guys, I've got a question from a stupid question from a clueless computer operator's standpoint. I use Windows XP. SP2, and I've got all these neat little programs. What language do they...
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
1
by: catalinfest | last post by:
I see on this link "# Python is Stupid" http://schlake.livejournal.com/809567.html Code is #!/usr/bin/env python for flour in range( 50, 1000 + 1, 5): # Python is Stupid print '%.2f %.2f %.2f'...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
0
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
0
BarryA
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...
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...

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.