start loading form codes if exit unloading form codes exit event handler codes if exit end note:...

4
Sta rt Loading Form Codes IF Exit Unloadin g form codes Exit Event Handler Codes IF Exit End Note: From the Strokerreader Script, I came up with this skeleton flow chart. There are seemingly 3 (sub) methods that to work together (probably in this order) to push information through. This is a just a start. Please provide your input if you see something wrong.

Upload: noel-may

Post on 13-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Start Loading Form Codes IF Exit Unloading form codes Exit Event Handler Codes IF Exit End Note: From the Strokerreader Script, I came up with this skeleton

Start

Loading Form Codes

IF

Exit

Unloading form codes

Exit

Event Handler Codes

IF

Exit

End

Note: From the Strokerreader Script, I came up with this skeleton flow chart. There are seemingly 3 (sub) methods that to work together (probably in this order) to push information through. This is a just a start. Please provide your input if you see something wrong.

Page 2: Start Loading Form Codes IF Exit Unloading form codes Exit Event Handler Codes IF Exit End Note: From the Strokerreader Script, I came up with this skeleton

Start

End

Close up of the flow.

Page 3: Start Loading Form Codes IF Exit Unloading form codes Exit Event Handler Codes IF Exit End Note: From the Strokerreader Script, I came up with this skeleton

Begin

sr.Port = 3 'Check your PC's serial port number!

sr.BaudRate = 9600 ' common barcode

scanners: 9600-n-8-1!

sr.Parity = NOPARITY

sr.DataBits = 8

sr.StopBits = ONESTOPBIT

sr.DataMode = Text ‘ incoming data as text strings not byte arrays

sr.RecvIntervalTimeout = 100 ‘allow for whole

barcode retrieval

sr.Connected = True 'Attach the ActiveX to

serial port

serial port

error?

Yes

NoExit

MsgBox sr.ErrorDescription

Loading Form Flow Chart Unloading Form Flow Chart

Begin

sr = Nothing 'Destroy the serial port ActiveX

when form is unloading

Exit

A closer look at the methods and how information flows inside each one.

Page 4: Start Loading Form Codes IF Exit Unloading form codes Exit Event Handler Codes IF Exit End Note: From the Strokerreader Script, I came up with this skeleton

Begin

ByVal Evt As StrokeReaderLib.Event

ByVal data As Variant

Yes

No

Exit

The serial port event handler - Flow Chart

Evt = EVT_DATA?

Yes

s = Replace(data, Chr(13), "") 'Remove <CR><LF> sequence

s = Replace(s, Chr(10), "“)

s = Replace(s, Chr(2), "")

s = Replace(s, Chr(3), "")

Forms[Asset Details - Comm Port] 'Search

the received barcode in the table

Found match?

Me.LastSeen = Now()

Me.Refresh

Output Message: "ID " + s + " not found.

Copying that number to the clipboard -

please assign to an existing or new part."