pake fungsi mid aja mas, outputnya kan text biasa... salam, sodik On Wed, 07 May 2008 08:56:42 +0700, Noe <[EMAIL PROTECTED]> wrote:
> > dear all > > saya sedang membuat software untuk membaca timbangan. komponen yang > digunakan adalah MsComm (VB Poenya). output dari timbangan ke kompi > seperti ini : > > US,NT,+ 000000 KG > > gimana caranya ya biar yang dibaca hanya 000000 saja. berikut di bawah > ini contoh script yang digunakan : > > Private Sub Form_Load() > > > Form1.Caption = "App2" > With MSComm1 > .CommPort = 2 > .Handshaking = 2 - comRTS > .RThreshold = 1 > .RTSEnable = True > .Settings = "9600,n,8,1" > .SThreshold = 1 > .PortOpen = True > ' Leave all other settings as default values. > End With > Text1.Text = "" > > > End Sub > > Private Sub Form_Unload(Cancel As Integer) > > > MSComm1.PortOpen = False > > > End Sub > > Private Sub MSComm1_OnComm() > Dim InBuff As String > > Select Case MSComm1.CommEvent > ' Handle each event or error by placing > ' code below each case statement. > > ' This template is found in the Example > ' section of the OnComm event Help topic > ' in VB Help. > > ' Errors > Case comEventBreak ' A Break was received. > Case comEventCDTO ' CD (RLSD) Timeout. > Case comEventCTSTO ' CTS Timeout. > Case comEventDSRTO ' DSR Timeout. > Case comEventFrame ' Framing Error. > Case comEventOverrun ' Data Lost. > Case comEventRxOver ' Receive buffer overflow. > Case comEventRxParity ' Parity Error. > Case comEventTxFull ' Transmit buffer full. > Case comEventDCB ' Unexpected error retrieving DCB] > > ' Events > Case comEvCD ' Change in the CD line. > Case comEvCTS ' Change in the CTS line. > Case comEvDSR ' Change in the DSR line. > Case comEvRing ' Change in the Ring Indicator. > > > Case comEvReceive ' Received RThreshold # of chars. > > > InBuff = MSComm1.Input > Call HandleInput(InBuff) > > > Case comEvSend ' There are SThreshold number of > ' characters in the transmit buffer. > Case comEvEOF ' An EOF character was found in the > ' input stream. > End Select > > End Sub > > Sub HandleInput(InBuff As String) > > > ' This is where you will process your input. This > ' includes trapping characters, parsing strings, > ' separating data fields, etc. For this case, you > ' are simply going to display the data in the TextBox. > Text1.SelStart = Len(Text1.Text) > Text1.SelText = InBuff > > > End Sub > > > > mohon bantuannya > > NOE > > > -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ Send instant messages to your online friends http://asia.messenger.yahoo.com ------------------------------------ Wahana Programmer Groups Links <*> Untuk mengunjungi sponsor milis ini, klik link berikut: http://wahanaprogrammer.net <*> Untuk menghubungi owner milis ini, kirim email ke: [EMAIL PROTECTED] <*> Konsultasi pemrogramman bisa chat disini: Yahoo! Messenger: wahana.programmer Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Programmer-VB/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/Programmer-VB/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
