Jump to content

Recommended Posts

Posted (edited)

hello sirs, please help me

i tried to create a function that read a folder files to 3d array

e.g

$array[n][0][0] = ctName

$array[n][0][1] = ctFilePath

$array[n][0][2] = crtsections number

$array[n][m][0] = KeyName

$array[n][m][1] = KeyVal

$array[n][m][2] = keySectionName

 

that the array

when i put one file into the folder all things work fine

but when i put more than one file

the last file worked fine but the others only the first key is showing

please can you help me to correct this problem

here is the example with the folder

please accept my greetings

and thanks in advance

 

array3d.zip

Edited by nacerbaaziz
added the tags

Share this post


Link to post
Share on other sites

Thanks, just found a post from PSalty with an example which explained it, just never seen it previously, learnt something new.

Share this post


Link to post
Share on other sites

@czardas arrayworkshop is a great thread for learning more than you want,  the fruit cube is how i got comfortable manipulating stuff

 

 


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

my problem isn't in the array creation

 until now i can't know where is the problem exact

please if any one of you can download and try to tell me where is the problem

thx in advance 

Share this post


Link to post
Share on other sites

I've got the files but what I don't understand is what attributes or data you want to assign to each array dimension and what you want to store in each array cell.

AFAICT you only need a 2D array, so I must be overlooking something important to you.

A 3D array is perfect to represent, for instance, one attribute of points in cartesian coordinates: if (X, Y, Z) are point coordinates in air, the array may store, for instance, the température of air at that point.  Then the array once filled gives you T° = f(X, Y, Z).

How does this simple example apply to your data?


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
8 minutes ago, jchd said:

I've got the files but what I don't understand is what attributes or data you want to assign to each array dimension and what you want to store in each array cell.

AFAICT you only need a 2D array, so I must be overlooking something important to you.

A 3D array is perfect to represent, for instance, one attribute of points in cartesian coordinates: if (X, Y, Z) are point coordinates in air, the array may store, for instance, the température of air at that point.  Then the array once filled gives you T° = f(X, Y, Z).

How does this simple example apply to your data?

am making an links store

and that tool has a categorys

and evry category is in a file

that file as a ini file

and what i want is to store the data in a 3d array

that the 1d to change the categorys and the 2d is to change the ini sections, and the last is to store the links information as the name of link and the url

i hope that you understand what i want

Share this post


Link to post
Share on other sites

You only need a 2D array:

Category    LinkName    URL
test    faceBook    https://facebook.com/
test    twitter https://twitter.com/
test    honeygain   https://honeygain.com/
test2   google  https://google.com/
test2   gmail   https://gmail.com/
test2   youtube https://youtube.com/
test3   mx-blind    https://mx-blind.com/
test3   wordpress   https://wordpress.com/
test3   blind help  https://blindhelp.net/

This is TSV format so you can copy-paste and directly load into a 2D array. Leave the headers alone as it will simplify access.

BTW if you intent to have a large number of links, you might turn to SQLite.

Here's a SQL source file (containing SQLite-compatible statements) you can use to create the database corresponding to the table shown above:

Links.sql


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

i liked to use the 3d because i have a treeview and list box

for that to get the info from one to one i must use a array

but if you mean that no whey to do that, then i have to change all my function .

i hope any one can help me to correct that 

Share this post


Link to post
Share on other sites
4 minutes ago, nacerbaaziz said:

i liked to use the 3d because i have a treeview and list box

for that to get the info from one to one i must use a array

I provided an example of use of an array, didn't I?

I still fail to see how you would cram your data in 3 dimensions, still keeping ease of use, access, search and coding.  I'm not saying this is impossible, just that it's neither useful nor practical.

To make a parallel, think about a personal address book. A (very simple) address consists of: country, state, zipcode, city, street, number, floor, appartment number.  That's 8 entities for that simple case, many real-world addresses are much more complex.

There are two diametrally extreme ways to organize storage for addresses like that: a 2D-array where each entry (row) contains 8 columns to store the 8 components, or a 8D-array where each component represents a dimension.

A 2D-array fits well the personal use, but a 8D array is most suitable for administrative registers that lists all habitations/appartments in a large area.  Searching in a 2D array is much easier than selecting address components in a 8D-array.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Does this function contain any errors, please?

#include <iniex.au3>
#include <Array.au3>
#include <File.au3>
#include <fileOptions.au3>
Global $A_StoreDataRead[1][1][3]
Global $StoreDataDir = @ScriptDir & "\store_data"
Store_GetData()
Func Store_GetData($DataDir = $StoreDataDir)

    ReDim $A_StoreDataRead[1][1][3]

    Local $find = _FileListToArrayRec($DataDir, "*.CTG", $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_SORT, $FLTAR_FULLPATH)
    If $find[0] <= 0 Then Return SetError(1, 0, 1)


    Local $iAll = 0, $i = 1, $CrntPath = "", $sectionsRead, $SectionRead, $crntPathOpen, $CrntPathRead, $crntFileName
    For $iFiles = 1 To $find[0]

        $CrntPath = $find[$iFiles]
        $crntFileName = _GetFileName($CrntPath)
        $crntPathOpen = FileOpen($CrntPath)
        $CrntPathRead = FileRead($crntPathOpen)
        If @error Then
            FileClose($crntPathOpen)
            ContinueLoop
        EndIf
        FileClose($crntPathOpen)

        $sectionsRead = _IniReadSectionNamesFromString($CrntPathRead)
        If @error Then ContinueLoop
        $iAll += 1
        $i = 1
        For $scs = 1 To $sectionsRead[0]
            $i += 1
            ReDim $A_StoreDataRead[$iAll + 1][$i][3]
            If $sectionsRead[$scs] = "categoryInfo" Then
                $A_StoreDataRead[$iAll][0][0] = _IniReadFromString($CrntPathRead, "categoryInfo", "categoryName", "")
                $A_StoreDataRead[$iAll][0][1] = $crntFileName
                $i -= 1
            Else
                $A_StoreDataRead[$iAll][$i - 1][0] = _IniReadFromString($CrntPathRead, $sectionsRead[$scs], "linkName", "")
                $A_StoreDataRead[$iAll][$i - 1][1] = _IniReadFromString($CrntPathRead, $sectionsRead[$scs], "LinkValue", "")
                $A_StoreDataRead[$iAll][$i - 1][2] = $sectionsRead[$scs]
                $A_StoreDataRead[$iAll][0][2] = $i - 1
            EndIf
            MsgBox(64, "result", $A_StoreDataRead[$iAll][0][0] & @CRLF & $A_StoreDataRead[$iAll][0][1] & @CRLF & $A_StoreDataRead[$iAll][0][2] & @CRLF & $A_StoreDataRead[$iAll][$i - 1][0] & @CRLF & $A_StoreDataRead[$iAll][$i - 1][1] & @CRLF & $A_StoreDataRead[$iAll][$i - 1][2])
        Next
    Next
    $A_StoreDataRead[0][0][0] = $iAll

    MsgBox(64, "", $A_StoreDataRead[1][0][0] & @CRLF & $A_StoreDataRead[1][0][1] & @CRLF & $A_StoreDataRead[1][0][2])
    MsgBox(64, "", $A_StoreDataRead[1][1][0] & @CRLF & $A_StoreDataRead[1][1][1] & @CRLF & $A_StoreDataRead[1][1][2])
    MsgBox(64, "", $A_StoreDataRead[1][2][0] & @CRLF & $A_StoreDataRead[1][2][1] & @CRLF & $A_StoreDataRead[1][2][2])
    MsgBox(64, "", $A_StoreDataRead[1][3][0] & @CRLF & $A_StoreDataRead[1][3][1] & @CRLF & $A_StoreDataRead[1][3][2])

    MsgBox(64, "", $A_StoreDataRead[2][0][0] & @CRLF & $A_StoreDataRead[2][0][1] & @CRLF & $A_StoreDataRead[2][0][2])
    MsgBox(64, "", $A_StoreDataRead[2][1][0] & @CRLF & $A_StoreDataRead[2][1][1] & @CRLF & $A_StoreDataRead[2][1][2])
    MsgBox(64, "", $A_StoreDataRead[2][2][0] & @CRLF & $A_StoreDataRead[2][2][1] & @CRLF & $A_StoreDataRead[2][2][2])
    MsgBox(64, "", $A_StoreDataRead[2][3][0] & @CRLF & $A_StoreDataRead[2][3][1] & @CRLF & $A_StoreDataRead[2][3][2])

    MsgBox(64, "", $A_StoreDataRead[3][0][0] & @CRLF & $A_StoreDataRead[3][0][1] & @CRLF & $A_StoreDataRead[3][0][2])
    MsgBox(64, "", $A_StoreDataRead[3][1][0] & @CRLF & $A_StoreDataRead[3][1][1] & @CRLF & $A_StoreDataRead[3][1][2])
    MsgBox(64, "", $A_StoreDataRead[3][2][0] & @CRLF & $A_StoreDataRead[3][2][1] & @CRLF & $A_StoreDataRead[3][2][2])
    MsgBox(64, "", $A_StoreDataRead[3][3][0] & @CRLF & $A_StoreDataRead[3][3][1] & @CRLF & $A_StoreDataRead[3][3][2])


    Return 1
EndFunc   ;==>Store_GetData

 

Share this post


Link to post
Share on other sites

hello again

i found the problem, and i wanted to share it with you

here is the corrected function

thank you all to your help

with my greetings

func Store_GetData($DataDir = $StoreDataDir)

ReDim $A_StoreDataRead[1][1][3]

local $find = _FileListToArrayRec($DataDir, "*.CTG", $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_SORT, $FLTAR_FULLPATH)
    If not (isArray($find)) Then return SetError(1, 0, 1)
local $iAll = 0, $i = 1, $IcrntSec = 1, $CrntPath = "", $sectionsRead, $SectionRead, $crntPathOpen, $CrntPathRead, $crntFileName
for $iFiles = 1 to $find[0]

$crntPath = $find[$iFiles]
$crntFileName = _GetFileName($crntPath)
$crntPathOpen = FileOpen($crntPath)
$CrntPathRead = FileRead($crntPathOpen)
if @Error then
fileClose($crntPathOpen)
ContinueLoop
endIf
fileClose($crntPathOpen)

$SectionsRead = _IniReadSectionNamesFromString($CrntPathRead)
if @Error then ContinueLoop
$iAll += 1
$i = 1
for $scs = 1 to $SectionsRead[0]
$i += 1
if $IcrntSec < $i then
ReDim $A_StoreDataRead[$iAll+1][$i][3]
$IcrntSec = $i
else
ReDim $A_StoreDataRead[$iAll+1][$IcrntSec][3]


endIf
if $SectionsRead[$scs] = "categoryInfo" then
$A_StoreDataRead[$iAll][0][0] = _IniReadFromString($CrntPathRead, "categoryInfo", "categoryName", "")
$A_StoreDataRead[$iAll][0][1] = $crntFileName
$i -= 1
else
$A_StoreDataRead[$iAll][$i-1][0] = _IniReadFromString($CrntPathRead, $SectionsRead[$scs], "linkName", "")
$A_StoreDataRead[$iAll][$i-1][1] = _IniReadFromString($CrntPathRead, $SectionsRead[$scs], "LinkValue", "")
$A_StoreDataRead[$iAll][$i-1][2] = $SectionsRead[$scs]
$A_StoreDataRead[$iAll][0][2] = $i-1
endIf

next
next
$A_StoreDataRead[0][0][0] = $iAll

return 1
endFunc

 

Share this post


Link to post
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

  • Similar Content

    • By jmp
      Script running good but error in line 7.
      When i run this script :
      #include <IE.au3> #include <Array.au3> $oIE = _IEAttach ("Shop") $oTable = _IETableGetCollection ($oIE, 1) $aTableData = _IETableWriteToArray ($oTable) For $inumber = 1 To UBound($aTableData) -1 $table = $aTableData[4][$inumber] MsgBox(0, "", $table) Next I got Error: array variable has incorrect number of subscripts or subscript dimension range exceeded
    • By nacerbaaziz
      Good morning guys, i hope that you're all well.
      guys, i have a problem and i hope that you can help me
      i've created an 3d array
      the array Contain a Categories info
      as folow
      $array[n][0][0] = Categorie name
      $array[n][0][1] = Categorie file path
      $array[n][0][2] = Categorie contents number
      $array[n][m][0] = link name
      $array[n][m][1] = link url
      $array[n][m][2] = link section name
      in my tool i want to add an option to delete a Category
      as you know the Categorie mean that must delete a region from the array
      when i tried to use _arrayDelete
      with the 2d array it work well
      but here i couldn't find any way to do that, can any one help me please?
      thanks in advance.
    • By nacerbaaziz
      good morning everybody.
      today i liked to share an small example with you
      which it an function to read the registry values as an array
      the result array is 2d array witch
      $a_array[n][0] = value name
      $a_array[n][1] = value Data
      $a_array[0][0] = values count
      here's the function

      #include <Array.au3> #include <WinAPIReg.au3> #include <APIRegConstants.au3> Local $a_array = _RegReadToArray("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run") If @error Then     MsgBox(16, "error", @error)     Exit EndIf _ArrayDisplay($a_array) Func _RegReadToArray($s_RegKey)     Local $a_KeySplitInfo = StringSplit($s_RegKey, "\\", 2)     If UBound($a_KeySplitInfo) <= 1 Then         $a_KeySplitInfo = StringSplit($s_RegKey, "\", 2)         If UBound($a_KeySplitInfo) <= 1 Then Return (1, 1, 0)     EndIf     Local $H_KeyInfo = "", $s_RegKeyInfo = ""     Switch $a_KeySplitInfo[0]         Case "hklm", "HKEY_LOCAL_MACHINE", "hklm64", "HKEY_LOCAL_MACHINE64"             $H_KeyInfo = $HKEY_LOCAL_MACHINE         Case "hkCu", "HKEY_CURRENT_USER", "hkCU64", "HKEY_CURRENT_USER64"             $H_KeyInfo = $HKEY_CURRENT_USER         Case "hkCr", "HKEY_CLASSES_ROOT", "HKCR64", "HKEY_CLASSES_ROOT64"             $H_KeyInfo = $HKEY_CLASSES_ROOT         Case "HKU", "HKEY_USERS", "HKU64", "HKEY_USERS64"             $H_KeyInfo = $HKEY_USERS         Case Else             Return SetError(2, 2, 0)     EndSwitch     _ArrayDelete($a_KeySplitInfo, 0)     $s_RegKeyInfo = _ArrayToString($a_KeySplitInfo, "\")     Local $H_KeyInfoOpen = _WinAPI_RegOpenKey($H_KeyInfo, $s_RegKeyInfo, $KEY_READ)     Local $A_KeyInfo = _WinAPI_RegQueryInfoKey($H_KeyInfoOpen)     If @error Then Return SetError(1, 1, 0)     _WinAPI_RegCloseKey($H_KeyInfoOpen)     Local $A_RegVal[$A_KeyInfo[2] + 1][2]     Local $iV = 1, $s_RegRead = ""     While 1         $s_RegVal = RegEnumVal($s_RegKey, $iV)         If @error <> 0 Then ExitLoop         $s_RegRead = RegRead($s_RegKey, $s_RegVal)         If Not (@error) Then             $A_RegVal[$iV][0] = $s_RegVal             $A_RegVal[$iV][1] = $s_RegRead         EndIf         $iV += 1     WEnd     $A_RegVal[0][0] = UBound($A_RegVal) - 1     If $A_RegVal[0][0] >= 1 Then         Return $A_RegVal     Else         Return SetError(3, 3, 0)     EndIf EndFunc   ;==>_RegReadToArray
      i hope you benefit from it
      with my greetings
    • By JackER4565
      Hi, first of all thanks to all the guys who always help people in the forums, I wouldn't be able to do anything if wasn't for your help, even if I don't ask it myself.
       
      I've created this code to get some info on a monitoring network on my work. It relays on _IETableGetCollection and _IETableWriteToArray.
      It works well, but take around 3:25 minutes to get the info from 28 pages (some of them are large and take longer to load, but most of them are small and fast).
      My question is if you see a way to get the program to go faster...
       
      I've tried to make it easy for you to understand and edited somethings with sensitive info.
      (Some of the pages doesn't have the black divider with MIRA in the end, so I need to search if it is there or not.)
       
      #include <IE.au3> #include <array.au3> Local $oIE = _IECreate("about:blank", 0, 0) Local $paginas[28] = [89, 90, 91, 92, 93, 96, 105, 113, 119, 125, 126, 129, 131, 133, 135, 137, 139, 140, 141, 144, 145, 146, 148, 149, 150, 151, 158, 159] Local $Datos_array[0][2] Local $oTable Local $tabla Local $aux_x = 1 Local $ar = 1 Local $Numtables_datos = 0 MsgBox(0, "asd", "asd") For $pag = 0 To UBound($paginas) - 1 Step 1 _IENavigate($oIE, "<WEBSITE URL>" & $paginas[$pag]) ; <<< the pages to load are always the same except for the last digits. _ArrayAdd($Datos_array, $paginas[$pag] & "|" & "Entrante", 0, "|") ; <<<<<<<<<<<<<<<< adds the page number toarray [0, 0] ;############################################ START counts amount of tables with traffic $oTable = _IETableGetCollection($oIE) Local $iNumTables = @extended For $i = 3 To $iNumTables - 2 Step 1 $oTable = _IETableGetCollection($oIE, $i) $nomb_tabla2 = _IETableWriteToArray($oTable) ; <<<<<<<< TABLE TO ARRAY. $string2 = StringStripWS($nomb_tabla2[1][0], 8) If $string2 <> "MIRA" Then $Numtables_datos = $Numtables_datos + 1 Next $tabla_End = $iNumTables - $Numtables_datos ;############################################ FIN $tabla_Start = 4 $tabla_trafico = 2 For $for = 1 To $Numtables_datos Step 1 $oTable = _IETableGetCollection($oIE, $tabla_Start - 1) ; <<<<<<<<<<< NAME OF THE TABLE; row2 = mira $nomb_tabla = _IETableWriteToArray($oTable) ; <<<<<<<< TABLE TO ARRAY ;########################################### ADDS the traffic number into the row $string = StringStripWS($nomb_tabla[1][0], 8) If $string == "MIRA" Then ;si o si pasa por aca 1 vez _ArrayAdd($Datos_array, $nomb_tabla[0][0]) $nomb_aux = $nomb_tabla[0][0] $aux_x = 1 $tabla_trafico = $tabla_trafico + 2 Else ;esto deberia ser por row _ArrayAdd($Datos_array, $nomb_aux & " " & $aux_x) $aux_x = $aux_x + 1 $tabla_trafico = $tabla_trafico + 1 EndIf $oTable = _IETableGetCollection($oIE, $tabla_trafico) Local $aTableData = _IETableWriteToArray($oTable) $bps = _ArrayToString($aTableData, "|", 0, 0, @CRLF, 0, 0) $bps = StringRight($bps, 5) $bps = StringLeft($bps, 4) $trafico_actual = _ArrayToString($aTableData, "|", 0, 0, @CRLF, 2, 2) If $bps == "Gbps" Then $trafico_actual = $trafico_actual * 1000 If $bps == "Kbps" Then $trafico_actual = $trafico_actual / 1000 $Datos_array[$ar][1] = $trafico_actual $ar = $ar + 1 If $string == "MIRA" Then $tabla_Start = $tabla_Start + 2 Else $tabla_Start = $tabla_Start + 1 EndIf Next $ar = $ar + 1 ;~ ############# CAÍDA ############ ;~ If $actual_entrante = 0 Then ;~ $xxx = 0 ;~ Do ;~ MsgBox(0, "Tráfico Caído", $paginas[$i], 5) ;~ $xxx = $xxx + 1 ;~ Until $xxx = 10 ;~ EndIf ;~ ############# CAÍDA ############. Local $Numtables_datos = 0 Next _ArrayDisplay($Datos_array, "Array display") _IEQuit($oIE) Thanks!! 


      monitoria.html
    • By Skysnake
      Hi
      I am trying to set Accelerator keys from an array.
      I select the KEY and CONTROL from a SQLite table, the Array looks like that generated for the Helpfile, but I can't get the CONTROLS to resolve...
      I though about Assign & Eval, but not sure if that's a step in the right direction. IsDeclared shows that the $var exists in Local Scope -1.  
       
      Local $Main = GUICreate("Custom MsgBox", 225, 80) GUICtrlCreateLabel("Please select a button.", 10, 10) Local $idButton_Yes = GUICtrlCreateButton("Yes", 10, 50, 65, 25) Local $idButton_No = GUICtrlCreateButton("No", 80, 50, 65, 25) Local $idButton_Exit = GUICtrlCreateButton("Exit", 150, 50, 65, 25) Local $query, $aResult, $iRows, $iColumns $query = "" ;reset $query = "Select hotkey_key, hotkey_ctrl from mytable where mykeys = 'hotkey' ; " ; ; Query $iRval = _SQLite_GetTable2d($sqliteDb, $query, $aResult, $iRows, $iColumns) If $iRval = $SQLITE_OK Then Local $sizeofHotkeys = UBound($aResult) - 1 ConsoleWrite("$sizeofHotkeys " & $sizeofHotkeys & @CRLF) If $sizeofHotkeys > 0 Then Local $main__aAccelKeys[$sizeofHotkeys][2] For $i = 0 To $sizeofHotkeys - 1 $j = $i + 1 ; replace friendly text with code -- ! alt + Shift ^ Ctrl # Windows $aResult[$j][0] = StringReplace($aResult[$j][0], "Alt", "!") $aResult[$j][0] = StringReplace($aResult[$j][0], "Shift", "+") $aResult[$j][0] = StringReplace($aResult[$j][0], "Ctrl", "^") $main__aAccelKeys[$i][0] = $aResult[$j][0] ;--- $main__aAccelKeys[$i][1] = $aResult[$j][1] ;--- Next ;~ Row|Col 0|Col 1 ;~ Row 0|F2|$idButton_Yes ;~ Row 1|F3|$idButton_No _DebugArrayDisplay($main__aAccelKeys) Local $rv = GUISetAccelerators($main__aAccelKeys, $Main) GUISetState(@SW_SHOW) ; Display the GUI.  
      Please note that this is a modified Helpfile example.
      The Helpfile specifies (a) WinHandle and (b) last Gui created.
      --> the example uses a control not a WinHandle and (b) what happens with ChildGuis? Also, the HelpFile specifies lower case, yet the examples show "{F1}" upper case?
      Also, is there a way to check the result of the GuiSetAccelerator function? 
      Note, if I add these to lines after the FOR loop, then the F1 works, and the DebugArrayDisplays shows control 4... not it's name... So I am in the right place, but my $vars names do not convert to their control numbers in the GUI
      Next $main__aAccelKeys[$sizeofHotkeys - 1][0] = "{F1}" ; -- -- use the extra row for the F1 $main__aAccelKeys[$sizeofHotkeys - 1][1] = $ChmHLP ;--- Skysnake
×
×
  • Create New...