Jump to content

SRE help required please


guner7
 Share

Recommended Posts

Yes you can Guner7.

Then You would address the array like

For $i = 0 To Ubound($c) -1
     MsgBox(0 "Test Result", $c[$i][0] & @CRLF & $c[$i][1], 2)
Next

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Thanks George, but I think I had confusing my question in the first place.

I want to combine array of $a and $b respectively and form a new 2D array which is $c.

I suppose the code you given is rather accessing their data, am I correct?

By using two nest FOR loop should be able to get it done but I wish to know if there is other way which could be more simpler? :unsure:

Edited by guner7
Link to comment
Share on other sites

Something like that?

#include <Array.au3>
Global $a[4]=["a","b","c","d"]
Global $b[4]=[1,2,3,4]
$c = ArrayComb($a, $b)
_ArrayDisplay($c)

Func ArrayComb($a1, $a2)
    Local $ub1 = UBound($a1)
    Local $ub2 = UBound($a2)
    Local $a3[Max($ub1, $ub2)][2]
    Local $i
    For $i = 0 To UBound($a3) - 1
        If $i < $ub1 Then $a3[$i][0] = $a1[$i]
        If $i < $ub2 Then $a3[$i][1] = $a2[$i]
    Next
    Return $a3
EndFunc

Func Max($a, $b)
    If $a > $b Then Return $a
    Return $b
EndFunc

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 2 weeks later...

This is the best I have come up with so far:

(?i)[\R\s\(]([a-z][_\d][_a-z0-9]{0,})

Hi M23,

Can you explain the meaning and step of how would this expression work in expected?

I couldn't even find \R in regex tutorial... :wacko:

Link to comment
Share on other sites

  • Moderators

guner7,

Certainly - although it is all in the Help file for StringregExp: ;)

(?i)          - Case insensitive
[Rs(]      - Look for a newline sequence, some whitespace, or an opening parenthesis
(             - Start capturing the following group which must be
[a-z]         - A letter
[_d]         - Followed by an underscore or a digit
[_a-z0-9]{0,} - Followed by any number of underscores, letter or digits
)             - End the capture when we find something other than an underscore, letter or digit

All clear? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...