Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull String from macroA into macroB 2

Status
Not open for further replies.

2010noACAPS

Technical User
Mar 29, 2004
41
0
0
US
I have created a few macros to use at work to automate some repetitive tasks. I have 1 that I need to alter for a new process. When I'm in Extra I move from 1 "program" to another. My macroA is setup to get StringA from ProgramA, SendKeys, and then paste StringA. MacroB was created to put StringB just inside ProgramB.

My issue is I need to use macroA to get StringC and then send StringB and the new StringC inside macroB. I'm wanting to do that instead of going back into ProgramA to get StringC and then back into ProgramB to put StringB and StringC within macroB.

Is this possible? Or would it just be easier to have macroB go back into ProgramA to get StringC?

There is also the problem of once I get StringC I need the macro to be able to strip either 4 or 5 characters from the beginning of the string. There will always be 10 numerics behind the leading 4 or 5 characters and the 10 numerics is what I need to paste inside macroB. Is there a function that could do that?

Thanks.
T
 
A & B are two separate files.

Glad it fit your needs 2010.
 
Here's an excerpt of macroA, which both of you two's advice helped update:
Code:
Global g_Acct

......

Sess0.Screen.Sendkeys("<home>qcus<enter>")	' Get acct#
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
       
       g_Acct = Sess0.Screen.GetString(4,60,15)
        If Right(g_Acct,1) <> "_" then
            g_Acct = right(g_Acct,10)
        Else
            g_Acct = mid(g_Acct,5,10)
        End If

Sess0.Screen.WaitHostQuiet(g_HostSettleTime)        
	

ProgramA = Sess0.Screen.GetString(2,45,15)	    	' Copy reference number
 Sess0.Screen.WaitHostQuiet(g_HostSettleTime)

State = Sess0.Screen.GetString(3,24,2)		' Copy State code
Sess0.Screen.Sendkeys("<home>qnas<enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)

' Start STATE loop
        ' Start with CA
        If State = "13" then
	Sess0.Screen.SendKeys("<ATTN><Pf6><clear>comp 2500<enter><clear>acs<enter><Pf3>")
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
	Sess0.Screen.Sendkeys("<EraseEOF>")
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
	Sess0.Screen.Sendkeys(RefNbr)
	
	' CT
	ElseIf State = "02" then
	Sess0.Screen.SendKeys("<ATTN><Pf6><clear>comp 2072<enter><clear>acs<enter><Pf3>")
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
	Sess0.Screen.Sendkeys("<EraseEOF>")
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
	Sess0.Screen.Sendkeys(RefNbr)

Here's macroB:
Code:
        amount = Sess0.Screen.GetString(5,47,12)	' Copy check amount
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
         
	Sess0.Screen.PutString Payee,13,17
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.PutString g_Acct,13,26
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.PutString amount,13,49
	System.TimeoutValue = OldSystemTimeout
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top