deef99 Posted July 20, 2009 Share Posted July 20, 2009 Yes, I am a newbie. Thank you in advance for any insight you can give me!I need to get a parameter from the command line which looks like this:"vbget.exe" %v %mAn example of the data that populates them [data coming from a phone switch]:%v = IB 1234567222 GR MA%m = 1234567890I need the script to simply look at the first 2 characters in %v and open a url if they are IV or IB. That part I have figured out. What I am struggling with is how to get the values of %v and %m onto the URL line, which needs to be:http://gr.com/orderentry/projfind.aspx?tfn=%v&ani=%mHere's what I have so far:#include <IE.au3>dim $mtfndim $mvdndim $mani$oIE = _IECreate ("http://gr.com/orderentry/projfind.aspx?tfn=");store FIRST command line parameter...which is %v...to mvdn variable.; Set field values _IEFormElementSetValue ($CMDLINE[1], $mvdn)_IEFormElementSetValue ($CMDLINE[2], $mtfn)_IEFormElementSetValue ($CMDLINE[5], $mani);check that first 2 characters of mvdn IB or IV...%v = IB xxxxxxxxxx XX XXIf $CMDLINE[1] = "IB" Then ;load IB Sales Script AND I AM STUCK HERE !!!!Else ;exit script without opening an IE window ExitEndIf Link to comment Share on other sites More sharing options...
Authenticity Posted July 21, 2009 Share Posted July 21, 2009 Look up StringLeft() fucntion in the help file. You can do something like: Switch StringLeft($CmdLine[1], 2) Case "IB", "IV" ; Process this case Case Else ; Process this case EndSwitch Link to comment Share on other sites More sharing options...
deef99 Posted July 21, 2009 Author Share Posted July 21, 2009 Getting alittle farther here... The code below gets me almost there...the line in red needs to be what I have in BOLD.#include <IE.au3>dim $mvdn = $CMDLINE[1]dim $mtfn = $CMDLINE[2]dim $ani = $CMDLINE[5];check that first 2 characters of command line are IB or IV...%v = IB xxxxxxxxxx XX XXIf $CMDLINE[1] = "IB" OR $CMDLINE[1]= "IV" Then ;load Screen Pops MsgBox(4096, "ani",$ani) _IECreate ("http://dr.xxxx.com/orderentry/IPAgent_answer.aspx?tfn="&$mtfn+"&ani="&$ani)Else ;exit script without opening an IE window ExitEndIfThis is what I get:http://dr.xxx.com/orderentry/IPAgent_answer.aspx?tfn=8003143948999999999Needs to Be:http://dr.xxx.com/orderentry/IPAgent_answer.aspx?tfn=8003143948&ani=999999999 Link to comment Share on other sites More sharing options...
Skruge Posted July 21, 2009 Share Posted July 21, 2009 _IECreate ("http://dr.xxxx.com/orderentry/IPAgent_answer.aspx?tfn="&$mtfn+"&ani="&$ani) This is what I get: http://dr.xxx.com/orderentry/IPAgent_answer.aspx?tfn=8003143948999999999 Needs to Be: http://dr.xxx.com/orderentry/IPAgent_answer.aspx?tfn=8003143948&ani=999999999 Your use of "+" converts the strings to numbers and adds the values. Use "&" instead to concatenate the strings._IECreate("http://dr.xxxx.com/orderentry/IPAgent_answer.aspx?tfn=" & $mtfn & "&ani=" & $ani)Oh, and spacing makes it easier to read. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
deef99 Posted July 21, 2009 Author Share Posted July 21, 2009 THANK YOU! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now