Jump to content
Sign in to follow this  
aslani

Identifying number: How to?

Recommended Posts

aslani

I have a variable that can have different values ranging from "A", "A1" - "A9", "AA", "AB",etc.

Example:

$var1 = "A"
;or
$var1 = "A1"
;or
$var1 = "AA"

Now I have this in place:

If StringRight($var1, 1) == "1" Then
    _ArrayDelete($m22bmp, 1)
EndIf

Now I'm stuck on the part that if the number is not "1". I need a command that if the StringRight($var, 1) is of any number, then delete it from the array. How do I write that command? My gut says to use StringRegExp(), but how would I write it?

Thanks in advance.


[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Share this post


Link to post
Share on other sites
herewasplato

Rather than deleting items from the existing array - consider just looping thru your data one time and building a new array with only the items that you want from the first array. Clear as mud?

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
aslani

Rather than deleting items from the existing array - consider just looping thru your data one time and building a new array with only the items that you want from the first array. Clear as mud?

Ok here's the whole story.

I have a list/array of all part numbers with revisions, I want to separate the parts with solid revisions from the parts with bumped revisions (i.e. "A1", "A2", etc). Since there's only few bumped revisions, I just want to simply delete them from the list, then have their own list/array (which I have not done yet because I'm still trying to figure out how to identify that number) later on.

Each list goes on to their own database later down the scripts.

I hope that's clear.


[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Share this post


Link to post
Share on other sites
SmOke_N

If StringIsDigit(StringRight(etc


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
herewasplato

... I hope that's clear.

Yep - my bad. I totally missed what you clearly stated in the first post. I'll blame it on my glasses - yes, that's it, my glasses :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×