vb.net - Creating a Variable with StreamReader Split Results -
i've been exposed vb.net scripting , having trouble figuring out how accomplish task. i'm supposed create program automate end user process right works 1 specific id(because i've hardcoded value make script run). i've scripted use of streamreader loop through possible entries, can't figure out how put result variable program automatically read id selected , proceed through steps, loop until id's identified via streamreader have been processed. apologize if has been asked before, not familiar terminology.
private sub form1_formclosed(byval sender object, byval e system.windows.forms.formclosedeventargs) handles me.formclosed application.doevents() end end sub private sub form1_formload(byval sender object, byval e system.eventargs) handles mybase.load uxnote.text = "starting" me.update() runapp() me.close() end sub sub runapp() dim b new bostonworkstation dim myhandle long b.shell_("c:\software\application.exe") b.activate("appcaption", true) b.connect("appcaption", enumstreamtype1.stwindows) uxnote.text = myhandle.tostring me.update() b.wait(2) b.pause("@378,423") b.tab_("user") b.enter("password") b.wait(2) b.shell_("c:\software\application2.exe") b.activate("app2caption", true) b.wait(4) b.connect("app2caption", enumstreamtype1.stwindows) uxnote.text = myhandle.tostring me.update() b.wait(4) b.smart.create("app2caption@726,1088", -1024, -633, 0) b.smart.click(false, false) b.wait(3) b.activate("patient lookup", true) b.connect("patient lookup", enumstreamtype1.stwindows) uxnote.text = myhandle.tostring me.update() b.wait(1) b.pause("@104,423") processpatients(b) b.enter("10001") 'hardcoded id variable pull in value b.wait(2) 'some more code steps here specific should done once patient id has been selected end sub sub processpatients(byval w bostonworkstation) dim record() string dim sr new streamreader("my path csv or txt file") while sr.peek > -1 record = sr.readline.split(cchar("|")) loop sr.close() end sub
i imagine this:
imports system.io public class form1 private sub form1_formload(byval sender object, byval e system.eventargs) handles mybase.load uxnote.text = "starting" end sub private sub form1_shown(sender object, e eventargs) handles me.shown runapp() end sub sub runapp() dim b new bostonworkstation dim myhandle long b.shell_("c:\software\application.exe") b.activate("appcaption", true) b.connect("appcaption", enumstreamtype1.stwindows) uxnote.text = myhandle.tostring me.refresh() application.doevents() b.wait(2) b.pause("@378,423") b.tab_("user") b.enter("password") b.wait(2) b.shell_("c:\software\application2.exe") b.activate("app2caption", true) b.wait(4) b.connect("app2caption", enumstreamtype1.stwindows) uxnote.text = myhandle.tostring me.refresh() application.doevents() b.wait(4) b.smart.create("app2caption@726,1088", -1024, -633, 0) b.smart.click(false, false) b.wait(3) b.activate("patient lookup", true) b.connect("patient lookup", enumstreamtype1.stwindows) uxnote.text = myhandle.tostring me.refresh() application.doevents() b.wait(1) b.pause("@104,423") processpatients(b) me.close() end sub sub processpatients(byval w bostonworkstation) dim id string dim record() string dim sr new streamreader("my path csv or txt file") while not sr.endofstream record = sr.readline.split(cchar("|")) id = record(0) ' <-- grab "id" somewhere in "record" w.enter(id) w.wait(2) 'some more code steps here specific should done once patient id has been selected loop sr.close() end sub end class
Comments
Post a Comment