Sign in to follow this  
Followers 0
sshrum

Evaluating characters

7 posts in this topic

I'm writting a function to store/read multi-dim arrays to/from files

When I save the an array the first line is the array dimensions with the seperator char inbetween like this:

'20|5' or '234,12'

Basically it's <number><seperator><number>

When I read the file, I get the first line and evaluate it. Problem is I can't seem to get that seperator character...

What do I need to do to single out the seperator (non-numeric). I tried IsString and IsNumber on each char in the string but they all return back the same result.


Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Share this post


Link to post
Share on other sites



StringInStr + StringMid

or

StringSplit

?


"be smart, drink your wine"

Share this post


Link to post
Share on other sites

not a solution but a workaround: make another dimension that holds the seperator character.

Share this post


Link to post
Share on other sites

Or in case you want to get the separator out of that string, use

StringRegExpReplace($string, "[0-9]", "")


"be smart, drink your wine"

Share this post


Link to post
Share on other sites

Or in case you want to get the separator out of that string, use

StringRegExpReplace($string, "[0-9]", "")

I'm not sure I followed what the OP was wanting... but I understood it it to be something like:
#include <array.au3>
$aSeperate = StringRegExp($aString, '(\d+)\D(\d+)', 3)
_ArrayDisplay($aSeperate);Should show all the numbers [0] Contains before separator [1] contains after, the separator would be any "Non" digit character

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

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  
Followers 0