| View previous topic :: View next topic |
| Author |
Message |
The Unknown Jobber
Joined: 19 Nov 2009 Posts: 161 Location: Florida
|
Posted: Thu Feb 11, 2010 3:29 pm Post subject: Function call |
|
|
Is there a better way to write this?
This first code works....
| Code: |
selection := OMSeTopMenu("LSROrder")
OMSeTopMenu(action)
{
;NoMenu = 1
if(action = "CSRInquiry")
{
action = 2
}
if(action = "Search")
{
action = 3
}
if(action = "OrderSearch")
{
action = 4
}
if(action = "OrderSearchAll")
{
action = 5
}
if(action = "TaskManagement")
{
action = 6
}
if(action = "ServiceQuery")
{
action = 7
}
if(action = "SeasonalAccounts")
{
action = 8
}
if(action = "QCCTaskManagement")
{
action = 9
}
if(action = "QCCSearch")
{
action = A
}
If(action = "Create")
{
action = S1
}
If(action = "DigitalPhoneOrder")
{
action = T1
}
If(action = "LSROrder")
{
action = U1
}
If(action = "ProvisioningOrder")
{
action = V1
}
If(action = "PortOutOrder")
{
action = 02
}
if(action = "PICChangeOrder")
{
action = 12
}
if(action = "ResetPIN")
{
action = 22
}
if(action = "RefreshService")
{
action = 32
}
if(action = "SeasonalOrder")
{
action = 42
}
if(action = "TransferDevice")
{
action = 52
}
Return action
} |
I originally had OMSeTopMenu written like this but this does not work it just returns the word:
| Code: |
OMSeTopMenu(action)
{
Search = 3
OrderSearch = 4
OrderSearchAll = 5
TaskManagement = 6
ServiceQuery = 7
SeasonalAccounts = 8
QCCTaskManagement = 9
QCCSearch = A
Create = S1
DigitalPhoneOrder = T1
LSROrder = U1
ProvisioningOrder = V1
PortOutOrder = 02
PICChangeOrder = 12
ResetPIN = 22
RefreshService = 32
SeasonalOrder = 42
TransferDevice = 52
Return action
} |
What I wanted was when I put say for example LSROrder in as the action, I wanted to return LSROrder's value which is U1. Same thing if I put in ProvisioningOrder it should return V1....Make sense?
Maybe I'm just not understanding something or I'm missing something. I tried ByRef and I don't get any value at all. |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Thu Feb 11, 2010 3:36 pm Post subject: |
|
|
| Code: |
MsgBox % OMSeTopMenu("OrderSearchAll")
MsgBox % OMSeTopMenu("WhatIsThis")
MsgBox % OMSeTopMenu("ResetPIN")
OMSeTopMenu(action)
{
Actions=
(
Search=3
OrderSearch=4
OrderSearchAll=5
TaskManagement=6
ServiceQuery=7
SeasonalAccounts=8
QCCTaskManagement=9
QCCSearch=A
Create=S1
DigitalPhoneOrder=T1
LSROrder=U1
ProvisioningOrder=V1
PortOutOrder=02
PICChangeOrder=12
ResetPIN=22
RefreshService=32
SeasonalOrder=42
TransferDevice=52
)
Loop, Parse, Actions, `n, `r
{
StringSplit, Action, A_LoopField, =
If (Action1 = action)
Return Action2
}
Return 0
} |
_________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Thu Feb 11, 2010 4:03 pm Post subject: |
|
|
| Code: | MsgBox % OMSeTopMenu("QCCSearch")
. "`n" OMSeTopMenu("PortOutOrder")
. "`n" OMSeTopMenu("Bet This Won't Work")
OMSeTopMenu(action) {
return (action = "CSRInquiry") ? 2
: (action = "Search") ? 3
: (action = "OrderSearch") ? 4
: (action = "OrderSearchAll") ? 5
: (action = "TaskManagement") ? 6
: (action = "ServiceQuery") ? 7
: (action = "SeasonalAccounts") ? 8
: (action = "QCCTaskManagement") ? 9
: (action = "QCCSearch") ? "A"
: (action = "Create") ? "S1"
: (action = "DigitalPhoneOrder") ? "T1"
: (action = "LSROrder") ? "U1"
: (action = "ProvisioningOrder") ? "V1"
: (action = "PortOutOrder") ? "02"
: (action = "PICChangeOrder") ? 12
: (action = "ResetPIN") ? 22
: (action = "RefreshService") ? 32
: (action = "SeasonalOrder") ? 42
: (action = "TransferDevice") ? 52
: "an appropriate selection was not made"
} |
_________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
The Unknown Jobber
Joined: 19 Nov 2009 Posts: 161 Location: Florida
|
Posted: Thu Feb 11, 2010 4:20 pm Post subject: |
|
|
Don't I feel dumb...
both of those worked...
Thanks for the help!!! |
|
| Back to top |
|
 |
|