gottygolly 6 Report post Posted May 24, 2015 I've been working on a project and I ran into a little error. I need to make a for loop and have it stop at the total amount for the _stringbetween()I know some functions have it setup where $function[0][0] will give you the number but _stringbetween doesn't seem to have this option built into it.Could someone point me towards the answer or help me with it. (I saw that the _arraydisplay tells you but couldn't figure out where in the array.au3 file.)Thanks in advance. If you need me to post some code to better explain myself please let me know! Share this post Link to post Share on other sites
l3ill 69 Report post Posted May 24, 2015 Yes, posting your code or a reproducer of your issue is always a good idea.But if you just mean to stop the loop when your search reaches a certain identifier then you could add a;If $_stringbetween() = 123Then ExitLoop My Contributions...SnippetBrowserNewSciTEPathFinderText File ManipulationFTP Connection Tester / INI File - Read, Write, Save & Load Example Share this post Link to post Share on other sites
gottygolly 6 Report post Posted May 24, 2015 Thanks for the reply, here is the code to help explain what I meant.#include<string.au3> #include<guiconstants.au3> $gui = GUICreate("",310,180) Opt("GUIOnEventMode",1) GUISetOnEvent(-3,"_Exit") $string = "| e5g6 | e456ybv | y8m9o | 2qser | y78m | q3dx4r | gnm | exrgv |" GUICtrlCreateLabel($string,5,5,300,Default,$ss_center) $ss = _StringBetween($string,"|","|") $data = "" For $i = 0 To 7 ;instead of 7 I want to be able to put in a variable. $data = $data & $ss[$i] & @CRLF Next GUICtrlCreateLabel($data,5,55,300,180,$ss_center) GUISetState() While 1 Sleep(10) WEnd Func _Exit() Exit EndFunc Share this post Link to post Share on other sites
Melba23 2,629 Report post Posted May 24, 2015 gottygolly,Use UBound to find the size of the array:For $i = 0 To UBound($ss) - 1 $data &= $ss[$i] & @CRLF NextAnd you can see that using the &= operator makes the code a bit shorter too.M23 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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 Share this post Link to post Share on other sites
gottygolly 6 Report post Posted May 24, 2015 Thanks for the help Melba, I tried that before but I messed it up a bit. Share this post Link to post Share on other sites