Sign in to follow this  
Followers 0
deef99

_iecreate and passing variables from command line

5 posts in this topic

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 %m

An example of the data that populates them [data coming from a phone switch]:

%v = IB 1234567222 GR MA

%m = 1234567890

I 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=%m

Here's what I have so far:

#include <IE.au3>

dim $mtfn

dim $mvdn

dim $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 XX

If $CMDLINE[1] = "IB" Then

;load IB Sales Script

AND I AM STUCK HERE !!!!

Else

;exit script without opening an IE window

Exit

EndIf

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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 XX

If $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

Exit

EndIf

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

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

THANK YOU!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0