karman Posted September 24, 2008 Share Posted September 24, 2008 func text($hWnd, $szText) for $i = 1 to $szText[0] step 1 _SendMessage($hWnd, 0x0102, $szText[$i], 0) sleep(10) Next return True EndFunc 0x0102 = WM_CHAR hwnd is valid.. $sztext is just an array of chars from stringsplit here is the code im using in c++ and it's working.. why doesn't the autoit one? tNx. for(int i=0;i<strlen(txt);i++) { SendMessage(hWnd, WM_CHAR, Text[i], 0); Sleep(10); } Link to comment Share on other sites More sharing options...
tgarr Posted September 24, 2008 Share Posted September 24, 2008 you wrote it wrong. Link to comment Share on other sites More sharing options...
Andreik Posted September 24, 2008 Share Posted September 24, 2008 (edited) func text($hWnd, $szText) for $i = 1 to $szText[0] step 1 _SendMessage($hWnd, 0x0102, $szText[$i], 0) sleep(10) Next return True EndFunc 0x0102 = WM_CHAR hwnd is valid.. $sztext is just an array of chars from stringsplit here is the code im using in c++ and it's working.. why doesn't the autoit one? tNx. for(int i=0;i<strlen(txt);i++) { SendMessage(hWnd, WM_CHAR, Text[i], 0); Sleep(10); }For $i = 0 To $szText[0]-1 If $szText is text length. Edited September 24, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
karman Posted September 24, 2008 Author Share Posted September 24, 2008 (edited) is sherlock in the house anyone know what's wrong with my code? cookies for good answers i wrote that $szText = a stringsplit'd array.. so my for loop is correct Edited September 24, 2008 by karman Link to comment Share on other sites More sharing options...
ProgAndy Posted September 24, 2008 Share Posted September 24, 2008 You can try to use StringToASCIIArray( or make AscW($szText[$i]) *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
jbg1978 Posted September 24, 2008 Share Posted September 24, 2008 func text($hWnd, $szText) for $i = 1 to $szText[0] step 1 _SendMessage($hWnd, 0x0102, $szText[$i], 0) sleep(10) Next return True EndFunc 0x0102 = WM_CHAR hwnd is valid.. $sztext is just an array of chars from stringsplit here is the code im using in c++ and it's working.. why doesn't the autoit one? tNx. for(int i=0;i<strlen(txt);i++) { SendMessage(hWnd, WM_CHAR, Text[i], 0); Sleep(10); } The way I loop through the rows in an array is: for $i = 0 to ubound($array) - 1 next you can omit step 1; it's implied Link to comment Share on other sites More sharing options...
karman Posted September 24, 2008 Author Share Posted September 24, 2008 (edited) noone has posted anything related to my question~~ im asking why my autoit code doesn't work (but the c++ does) not how you loop through an array. ty nvm got it working. Edited September 24, 2008 by karman Link to comment Share on other sites More sharing options...
trancexx Posted September 24, 2008 Share Posted September 24, 2008 noone has posted anything related to my question~~ im asking why my autoit code doesn't work (but the c++ does) not how you loop through an array.tynvm got it working.Do not share.It just wouldn't be appropriate, right?I'm sure it wasn't your mistake. ♡♡♡ . eMyvnE 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