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.. -
Private Sub Form_Load()
-
Form1.Caption = "App1"
-
With MSComm1
-
MSComm1.Handshaking = 2
-
MSComm1.RThreshold = 2
-
MSComm1.RTSEnable = True
-
MSComm1.Settings = "9600,n,8,1"
-
MSComm1.SThreshold = 1
-
MSComm1.PortOpen = True
-
MSComm1.InputLen = 2
-
MSComm1.DTREnable = True
-
-
End With
-
Command1.Caption = "&Send"
-
Text1.Text = Val(test)
-
End Sub
-
-
Private Sub Command1_Click()
-
MSComm1.Output = Text1.Text
-
End Sub
8 1198
You need to check the code using Break points.
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.
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
Hi,
To Make TextBox to accept only numeric write this code in Textbox's KeyPress Event: -
If KeyAscii <> 8 Then 'Allow BackSpace
-
If InStr("0123456789", Chr(KeyAscii)) = 0 Then KeyAscii = 0
-
End If
-
Regards
Veena
thanks veena but that not solve my problem yet. please check your PM. i had leave a message for you.please read...
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.
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
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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:...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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'...
|
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...
|
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: 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...
|
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,...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |