Ok, apparently Macro scheduler considers a period or decimal "." to be the same as a zero.."0". I"m trying to write a macro to filter out zeros and periods separatelym but it reads them the same. Here's a small example I made just to see if I was going crazy. Either one has the same result.
Let>a=0
Let>b=.
If>a=.,Here,There
Label>Here
Send>See???
Label>There
or example 2.....
Let>a=0
Let>b=.
If>b=0,Here,There
Label>Here
Send>See???
Label>There
Is there something obvious here that I'm not seeing??
Desperate! Please help..Decimals and zeros the same??
Moderators: JRL, Dorian (MJT support)
-
- Newbie
- Posts: 5
- Joined: Fri Oct 17, 2003 11:27 am
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Hmmm, curious...
1. I was able to duplicate funknugget results. Really surprised!
2. I tried Let>%a%=.,Here,There and got the same failing results
3. I then saw support suggestion to try Let>"%a%"=".",Here,There and got the correct result.
Are you suggesting that "quotes" are needed to force number characters to be interpreted as strings?
1. I was able to duplicate funknugget results. Really surprised!
2. I tried Let>%a%=.,Here,There and got the same failing results
3. I then saw support suggestion to try Let>"%a%"=".",Here,There and got the correct result.
Are you suggesting that "quotes" are needed to force number characters to be interpreted as strings?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
-
- Newbie
- Posts: 5
- Joined: Fri Oct 17, 2003 11:27 am
Thanks!
Hi Bob and support team. Thanks for your help. I haven't tried it yet, but I'm assuming it will work. I imagine I'll figure this out through trial, but I might as well ask. Do I need to use VAREXPLICIT before doing what's described above?
-
- Newbie
- Posts: 5
- Joined: Fri Oct 17, 2003 11:27 am
Ok, this is frustrating
Ok, I guess I'm still not getting this. Can you tell me exactly how this macro should look to make it work with the quotes and percentage symbols because I can't get it to? This is closer to what I'm actually using in my larger macro to remove zeros and periods.
GetClipboard>Clipboard
Let>MyVal=Clipboard
Let>k=0
Length>MyVal,lv
Let>NewVal=
Label>Trime
Let>k=k+1
if>k>lv,Done
MidStr>MyVal,k,1,char
If>char=.,Trime
ConCat>NewVal,char
Goto>Trime
Label>Done
Let>Clipboard=NewVal
Send>Clipboard
This macro DOES work for removing periods, but it will also remove any zeros in the string and I need it to leave the zeros, while still removing the periods.
GetClipboard>Clipboard
Let>MyVal=Clipboard
Let>k=0
Length>MyVal,lv
Let>NewVal=
Label>Trime
Let>k=k+1
if>k>lv,Done
MidStr>MyVal,k,1,char
If>char=.,Trime
ConCat>NewVal,char
Goto>Trime
Label>Done
Let>Clipboard=NewVal
Send>Clipboard
This macro DOES work for removing periods, but it will also remove any zeros in the string and I need it to leave the zeros, while still removing the periods.
Hi,
Change the macro to:
GetClipboard>Clipboard
Let>MyVal=Clipboard
Let>k=0
Length>MyVal,lv
Let>NewVal=
Label>Trime
Let>k=k+1
if>k>lv,Done
MidStr>MyVal,k,1,char
If>"%char%"=".",Trime
ConCat>NewVal,char
Goto>Trime
Label>Done
Let>Clipboard=NewVal
Send>Clipboard
Change the macro to:
GetClipboard>Clipboard
Let>MyVal=Clipboard
Let>k=0
Length>MyVal,lv
Let>NewVal=
Label>Trime
Let>k=k+1
if>k>lv,Done
MidStr>MyVal,k,1,char
If>"%char%"=".",Trime
ConCat>NewVal,char
Goto>Trime
Label>Done
Let>Clipboard=NewVal
Send>Clipboard
MJT Net Support
[email protected]
[email protected]