I wonder if someone can help me with this:
currently my small app gets a mac address from an input box, now say the mac is in this format 001122334455 - my app changes it to 00:11:22:33:44:55 by checking the length when ctrl is pressed.
I'd like to change the way it checks though, so instead of using length it searches to see if the character ":" (excluding quotes) is used - if it is it does nothing and if it isn't it adds it - just like the code above.
However I can seem to find the way in apms to do this - if anyone has any idea that would be good if you could point me in the right direction - thanks.
currently my small app gets a mac address from an input box, now say the mac is in this format 001122334455 - my app changes it to 00:11:22:33:44:55 by checking the length when ctrl is pressed.
Code:
if e_Key == 17 then checkit = Input.GetText("Inputmac"); if String.Length(checkit) == 17 then --do nothing elseif String.Length(checkit) <= 16 then result = String.Mid(checkit, 1, 2); result2 = String.Mid(checkit, 3, 2); result3 = String.Mid(checkit, 5, 2); result4 = String.Mid(checkit, 7, 2); result5 = String.Mid(checkit, 9, 2); result6 = String.Mid(checkit, 11, 2); Input.SetText("Inputmac", result .. ":" .. result2 .. ":" .. result3 .. ":" .. result4 .. ":" .. result5 .. ":" .. result6); end end
However I can seem to find the way in apms to do this - if anyone has any idea that would be good if you could point me in the right direction - thanks.
Comment