regarding:- rounding option

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
JVM
Junior Coder
Posts: 40
Joined: Wed Oct 10, 2007 1:14 pm
Location: delhi (india)
Contact:

regarding:- rounding option

Post by JVM » Wed Oct 31, 2007 5:17 am

Hi dear friend,

facing a problem, well dear down i m attaching my script.
need to take input from user as CHF for currency JPY thae same script will remain for USD and EURO


i need that function which can count the mod as i mentioned. that will replace the green code.

Eg.
1. EUR100 ---> converted into CHF= 170 (CHF should is input from user)
2. 170 + 100 = 270 (CHF+100)
3. 270 up to first highest 100 ---> 300 (this is the amount that should come in place of EUR100)

Code: Select all


Run Program>L:\Visfare\ENTRY\ctexp.exe
WaitWindowOpen>CTree Explorer
Press CTRL

Send>o

Release CTRL
Wait>0.61
WaitWindowOpen>Open
Wait>0.5
Press Alt
Send>n
Release Alt
Send>C:\Visfare\ENTRY\CH_DATA\RULES.dat

Press Enter
WaitWindowOpen>CTree Explorer - [C:\Visfare\ENTRY\CH_DATA\RULES.dat]


//-- Process the RATIX_AD field
Input>Recordcount,Please Enter the no.of records to be processed,100
input>EURO,please enter the CHF 
input>usd1,Please enter the CHF
input>jpcu, please input the CHF
//------------------------------------RATIX_AD-----------------------------------------
Press CTRL
Press Home
Release CTRL
Press Right * 74
let>Recno=0
Repeat>Recno
	Let>Recno=Recno+1
Press F2
Press Shift
Press Home
Release Shift
Press CTRL
Send>c
Wait>0.38
Release CTRL

GetClipBoard>ratix
Length>ratix,length
Position>%,ratix,1,pos
if>{(%length%=0) or (%pos%>0)}
//do nothing
Else
	MidStr>ratix,1,1,check
	If>{(%check%=1) or (%check%=2) or (%check%=3) or (%check%=4) or (%check%=5) or (%check%=6) or (%check%=7) or (%check%=8) or (%check%=9) or (%check%=0)}
		Let>ratix=ratix+100
	Else
		Length>ratix,len
		MidStr>ratix,1,3,currency
		MidStr>ratix,4,len,amount
		if>currency=JPY
			[color=green]Let>amount=amount+10000[/color]
		Else
			[color=green]Let>amount=amount+100[/color]
		Endif
		Let>ratix=currency
		ConCat>ratix,amount
	Endif
Endif
PutClipBoard>%ratix%
SetFocus>CTree Explorer - [C:\Visfare\ENTRY\CH_DATA\RULES.dat]
Press CTRL
Send>v
Release CTRL
Press Enter
Press Down

Until>Recno=RecordCount
//------------------------------------RATIX_CH-----------------------------------------
Press CTRL
Press Home
Release CTRL
Press Right * 89

let>Recno=0
Repeat>Recno
	Let>Recno=Recno+1
Press F2
Press Shift
Press Home
Release Shift
Press CTRL
Send>c
Wait>0.38
Release CTRL

GetClipBoard>ratix
Length>ratix,length
Position>%,ratix,1,pos
if>{(%length%=0) or (%pos%>0)}
//do nothing
Else
	MidStr>ratix,1,1,check
	If>{(%check%=1) or (%check%=2) or (%check%=3) or (%check%=4) or (%check%=5) or (%check%=6) or (%check%=7) or (%check%=8) or (%check%=9) or (%check%=0)}
		Let>ratix=ratix+100
	Else
		Length>ratix,len
		MidStr>ratix,1,3,currency
		MidStr>ratix,4,len,amount
		if>currency=JPY
			Let>amount=amount+10000
		Else
			Let>amount=amount+100
		Endif
		Let>ratix=currency
		ConCat>ratix,amount
	Endif
Endif
PutClipBoard>%ratix%

SetFocus>CTree Explorer - [C:\Visfare\ENTRY\CH_DATA\RULES.dat]
Press CTRL
Send>v
Release CTRL
Press Enter
Press Down

Until>Recno=RecordCount
//------------------------------------RATIX_IN-----------------------------------------
Press CTRL
Press Home
Release CTRL
Press Right * 104
let>Recno=0

Repeat>Recno
	Let>Recno=Recno+1
Press F2
Press Shift
Press Home
Release Shift
Press CTRL
Send>c
Wait>0.38
Release CTRL

GetClipBoard>ratix
Length>ratix,length
Position>%,ratix,1,pos
if>{(%length%=0) or (%pos%>0)}
//do nothing
Else
	MidStr>ratix,1,1,check
	If>{(%check%=1) or (%check%=2) or (%check%=3) or (%check%=4) or (%check%=5) or (%check%=6) or (%check%=7) or (%check%=8) or (%check%=9) or (%check%=0)}
		Let>ratix=ratix+100
	Else
		Length>ratix,len
		MidStr>ratix,1,3,currency
		MidStr>ratix,4,len,amount
		if>currency=JPY
			Let>amount=amount+10000
		Else
			Let>amount=amount+100
		Endif
		Let>ratix=currency
		ConCat>ratix,amount
	Endif
Endif
PutClipBoard>%ratix%

SetFocus>CTree Explorer - [C:\Visfare\ENTRY\CH_DATA\RULES.dat]
Press CTRL
Send>v
Release CTRL
Press Enter
Press Down

Until>Recno=RecordCount

//-- End RATIX_AD Processing

Press ALT
Press F4
Release Alt

Code: Select all


hi every one.

JVM
Junior Coder
Posts: 40
Joined: Wed Oct 10, 2007 1:14 pm
Location: delhi (india)
Contact:

regarding:- rounding option

Post by JVM » Wed Oct 31, 2007 7:08 am

hi friends it's been completed.
hi every one.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts