erikson Posted February 5, 2007 Share Posted February 5, 2007 hello codemasters i have a txt file generated by java. inside the file is something like this: Key: 1 Key: 7 Key: 8 Key: 9 Key: 14 Key: 20 Key: 24 Key: 25 Key: 29 Key: 35 i whant to make a gui window with radio buttons for each "key" . the txt file is not the same each time. it have maximul 32 line (32 "keys") another thing is that in the gui window it must apear not "Key: 14" but "14" or not "Key: 1" but "1" can you help me with this? Link to comment Share on other sites More sharing options...
/dev/null Posted February 5, 2007 Share Posted February 5, 2007 1.) Read the file: _FileReadToArray() 2.) Extract only the key values: StringSplit() 3.) Create a GUI. Size is based on the number of keys !!: GUICreate() 4.) Create n Radio Buttons. n = number of keys. GUICtrlCreateRadio well, basically that's it. __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
erikson Posted February 5, 2007 Author Share Posted February 5, 2007 can you give me an example please? i read many posts, i try some combinations but i still have no results Link to comment Share on other sites More sharing options...
/dev/null Posted February 5, 2007 Share Posted February 5, 2007 can you give me an example please? i read many posts, i try some combinations but i still have no results examples are all in the help file. Just search the functions I mentioned and have a look at the examples. __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
/dev/null Posted February 5, 2007 Share Posted February 5, 2007 can you give me an example please? i read many posts, i try some combinations but i still have no results were you able to read the file and extract the key values? Maybe post the code you have so far .... __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
erikson Posted February 5, 2007 Author Share Posted February 5, 2007 were you able to read the file and extract the key values? Maybe post the code you have so far ..../dev/null thanks . i read keys it works great.now the big problem that i have.i must create a gui with a number of radio buttons. minumum number is 1 max is 32 ( that is the number of "keys' numer)so right now i have 6 keys, but that numer is variable so the question is how i create a gui window that depends from the number of "keys" Link to comment Share on other sites More sharing options...
/dev/null Posted February 5, 2007 Share Posted February 5, 2007 (edited) so the question is how i create a gui window that depends from the number of "keys" Let height of one radio button be 20 pix. ==> Total GUI height == n * 20 pix + some spare pix. n = number of keys. Position of radio buttons: x-coordinate will not change. y-coordinate = start value + n * height. The handles for the new controls will be stored in an array. => Dim $radiohandles[$number_of_keys]. For $i = 1 to $number_of_keys ;calculate position of radio button ; $radiohandles[$i] = GuiCtrlCreateRadio(....) Next Then you need a GUI message loop. See help file for GUICreate. Edited February 5, 2007 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
erikson Posted February 5, 2007 Author Share Posted February 5, 2007 (edited) i try but nothing i think i stuck here ; $radiohandles[$i] = GuiCtrlCreateRadio(....) Edited February 5, 2007 by erikson Link to comment Share on other sites More sharing options...
/dev/null Posted February 5, 2007 Share Posted February 5, 2007 (edited) i try but nothing i think i stuck here ; $radiohandles[$i] = GuiCtrlCreateRadio(....) O.K. can you please post your code (reading the file, etc. and the GUI stuff). I will see what I can do, as soon as I have your code. Edited February 5, 2007 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
erikson Posted February 5, 2007 Author Share Posted February 5, 2007 CODEDim $aRecords If Not _FileReadToArray("c:\text.txt",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] $right=StringTrimleft ($aRecords[$x], 4) FileWrite('c:\test.txt', $right) ;for checking Next GUICreate ( "keys", 500, 800 , 0 , 0) $number_of_keys = _FileCountLines ("c:\text.txt") Dim $radiohandles[$number_of_keys] For $i = 1 to $number_of_keys FileWrite ("c:\test1.txt", $radiohandles) $radiohandles[$i] = GuiCtrlCreateRadio( ) Next is all i have untill now. the next step is to create that gui with radio buttons, and for example if radio 4 is checked, when i press ok i connect on a ftp server, chdir to "/4" and copy some files Link to comment Share on other sites More sharing options...
/dev/null Posted February 5, 2007 Share Posted February 5, 2007 Regarding GuiCtrlCreateRadio(). Did you read the help file? The sample is quite clear. You sample does not even contain the basics to create a GUI. I'm really willing to help you, but I'm not willing to write the whole code for you. Please add at least the help file sample to your code to create at the GUI and one or two Radio Buttons. Then experiment with that code and come back if you have made a substantial improvement. It's important to understand how GUIs work and especially Radio Buttons, so at least run the help file samples and then start modifying those samples. __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
erikson Posted February 5, 2007 Author Share Posted February 5, 2007 i know how to create radio button i don`t understaind " Dim $radiohandles[$number_of_keys]. " GUICtrlCreateRadio ( "Key",0, 0 , width , height ) , where with and high are the values that change for every key Link to comment Share on other sites More sharing options...
/dev/null Posted February 5, 2007 Share Posted February 5, 2007 i don`t understaind " Dim $radiohandles[$number_of_keys]. " that defines an array. __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * 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