exus Posted July 24, 2007 Share Posted July 24, 2007 I wrote a script that would take data from edit boxes in my works proprietary program and put it into an Excel spreadsheets, that we use as delivery paperwork. I got it to pull data and put it into cells just fine except for one small problem, there is a set limit that can be typed in the boxes and it takes the info plus all the blank spaces after it. This only gives me a problem in one spot, there are two edit boxes for location, one for city and one for state. Here's a snippet of my code that inputs the data into a cell in Excel. Send($LocationCity) Send(", ") Send($LocationST) But when it grabs the data for the city it takes what is typed in and all the set space available in the box (a limit of 20 characters) so I end up with an output of something like San Jose , CA (it was removing the extra spaces in my example automagically) Is there a way to get rid of the extra spaces at the end of the string I store the city data in so the comma will be next to the city name like it should be? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 24, 2007 Developers Share Posted July 24, 2007 Is there a way to get rid of the extra spaces at the end of the string I store the city data in so the comma will be next to the city name like it should be?StringStripWs() ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Monamo Posted July 24, 2007 Share Posted July 24, 2007 StringStripWs() ?Just be sure to use 3 as a flag to allow for spaces within the city name (ex: Kansas City). - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
exus Posted July 24, 2007 Author Share Posted July 24, 2007 Hahaha, thank you very much, worked perfectly. I knew there had to be an easy way to do this but seeing as how this is only the second script I've ever written in AutoIt I'm not familiar with all the functions yet. Link to comment Share on other sites More sharing options...
RDSchaefer Posted July 25, 2007 Share Posted July 25, 2007 Hahaha, thank you very much, worked perfectly. I knew there had to be an easy way to do this but seeing as how this is only the second script I've ever written in AutoIt I'm not familiar with all the functions yet.RTFM Link to comment Share on other sites More sharing options...
xcal Posted July 25, 2007 Share Posted July 25, 2007 RTFMWhat the hell was the point of that, so after the fact? How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now