Trong Posted February 21, 2015 Share Posted February 21, 2015 How to get 868 in string↓: StringFun($StringVarA[8868986], 868) Global $xString="StringFun($StringVarA["&Random(1,9999999,1)&"], " & Random(111,999,1) & ")" ConsoleWrite($xString & @CRLF) Regards, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 21, 2015 Moderators Share Posted February 21, 2015 (edited) Trong,I have no idea what you are asking. Try using Google Translate or some other site to explain more clearly. M23Edit:Perhaps this might help? While 1 $iArray_Index = Random(1,9999999,1) $iAdd_Number = Random(111,999,1) If StringInStr($iArray_Index, $iAdd_Number) Then ; The add_number appears in the index ConsoleWrite($iAdd_Number & " is in " & $iArray_Index & @CRLF) Exit Else ; It does not ConsoleWrite($iAdd_Number & " is NOT in " & $iArray_Index & @CRLF) EndIf WEnd Edited February 21, 2015 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Trong Posted February 21, 2015 Author Share Posted February 21, 2015 Trong, I have no idea what you are asking. Try using Google Translate or some other site to explain more clearly. M23 Get the value of Random(111,999,1) generate by code: Global $xString="StringFun($StringVarA["&Random(1,9999999,1)&"], " & Random(111,999,1) & ")" ConsoleWrite($xString & @CRLF) Example: StringFun($StringVarA[8868986], 868)How to get 868 ? Regards, Regards, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 21, 2015 Moderators Share Posted February 21, 2015 Trong,Still no better - how about explaining what you are trying to do with this code. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
l3ill Posted February 21, 2015 Share Posted February 21, 2015 Global $xString="StringFun($StringVarA["&Random(1,9999999,1)&"], " & "868" & ")" ConsoleWrite($xString & @CRLF) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Trong Posted February 21, 2015 Author Share Posted February 21, 2015 (edited) M23Perhaps this might help? While 1 $iArray_Index = Random(1,9999999,1) $iAdd_Number = Random(111,999,1) If StringInStr($iArray_Index, $iAdd_Number) Then ; The add_number appears in the index ConsoleWrite($iAdd_Number & " is in " & $iArray_Index & @CRLF) Exit Else ; It does not ConsoleWrite($iAdd_Number & " is NOT in " & $iArray_Index & @CRLF) EndIf WEndIt's not like something I need! Thank you Trong,Still no better - how about explaining what you are trying to do with this code. M23Global $xString="StringFun($StringVarA["&Random(1,9999999,1)&"], " & "868" & ")" ConsoleWrite($xString & @CRLF)I have a string and I need to get the data in the string!Need to get random data (not find it). Edited February 21, 2015 by Trong Regards, Link to comment Share on other sites More sharing options...
Solution l3ill Posted February 21, 2015 Solution Share Posted February 21, 2015 Unless you are trying to "cut" this part of the string (regardless of what random number it is) out for further use then use: StringMid My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Trong Posted February 21, 2015 Author Share Posted February 21, 2015 Unless you are trying to "cut" this part of the string (regardless of what random number it is) out for further use then use:StringMidperfect Thanks Regards, Link to comment Share on other sites More sharing options...
l3ill Posted February 21, 2015 Share Posted February 21, 2015 Global $xString="StringFun($StringVarA["&Random(1,9999999,1)&"], " & Random(111,999,1) & ")" ConsoleWrite($xString & @CRLF) $yYourNewNumber = StringMid($xString, 24, 3 ) ConsoleWrite(" Your New Number" & "=" & $yYourNewNumber & @CRLF) StringFun($StringVarA[5091283], 535) Your New Number=091 Trong 1 My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
l3ill Posted February 21, 2015 Share Posted February 21, 2015 Glad to help ! My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Trong Posted February 21, 2015 Author Share Posted February 21, 2015 Code Final: Global $xString="StringFun($StringVarA["&Random(1,9999999,1)&"], " & Random(111,999,1) & ")" Local $xStrSp=StringSplit($xString,",") ConsoleWrite(StringMid($xString,StringLen($xStrSp[1])+3,3) & @CRLF) Regards, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 21, 2015 Moderators Share Posted February 21, 2015 l3ill,Bravo! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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