![]() | ![]() | ![]() |
| | |||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hi, I can send a single character when I press a command button in VB. Here is the code Code: Private Sub Command1_Click() MSComm1.Output = "A" + Chr(13) End Sub Thanks | |
| |
| | (permalink) |
| Try, Code: Private Sub Command1_Click()
MSComm1.Output = Text1.Text & vbCr
End Sub | |
| |
| | (permalink) |
| Hi Mike thats what I was looking, I couldn't find this on the net. Ahh this will send a string what I type in the Text1 box. I'll try to add your code.Can I change the character length also,I mean character length (Word) must not exceed 10 characters.Its never mind I'll try to solve that out. Thanks Mike | |
| |
| | (permalink) |
| You could do, Code: Private Sub Command1_Click()
Dim Temp As String
Temp = Text1.Text
If Len(Temp) > 10 Then Temp = Left(Temp, 10)
MSComm1.Output = Temp & vbCr
End Sub | |
| |
| | (permalink) |
| Hi Mike now I got it.Thanks for the superb code.All I understand except the Left(Temp, 10) part.Does it move left when it receive 11 characters?So every time it is a below 10 letter word. | |
| |
| | (permalink) |
| Left just returns a number of characters from the beginning of the string and so, Temp=Left("Hello World",5) would result in Temp containing "Hello". Mike. | |
| |
| | (permalink) |
| | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| String in pic16f877 and gsm | neelam29 | Micro Controllers | 1 | 19th March 2008 06:04 PM |
| float to string conversion for PIC | fzn10 | Micro Controllers | 6 | 10th August 2006 01:50 PM |
| Can chr$(0) be received using mscomm in VB? | StupidDum | Micro Controllers | 4 | 23rd May 2004 01:12 PM |
| String Variable? | Timmymna | Micro Controllers | 1 | 3rd May 2004 12:03 AM |
| mscomm help | xjackal | Micro Controllers | 3 | 22nd February 2004 09:50 PM |