Jump to content

GUICtrlCreateMenuItem from folder !


Madza91
 Share

Recommended Posts

Hi everybody,

is possible to get files from folder and make "GUICtrlCreateMenuItem" with that files?.

example:

if in languages folder have english.ini and spanish.ini -> to make GUICtrlCreateMenuItem spanish and engish,how?

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

Hi everybody,

is possible to get files from folder and make "GUICtrlCreateMenuItem" with that files?.

example:

if in languages folder have english.ini and spanish.ini -> to make GUICtrlCreateMenuItem spanish and engish,how?

_FileListToArray()

Then loop through the array doing whatever you want with the names. In this case StringReplace($avFile[$n], ".ini", "") would take out the extension, then you could use the filename for your menu item.

<_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Like this:

#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir)
If @Error=1 Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf
_ArrayDisplay($FileList,"$FileList")

But if i make this for iniwrite not work :/

#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir)
If @Error=1 Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf
_ArrayDisplay($FileList,"$FileList")
IniWrite("asd.ini","asd","asd",$FileList)

Why not work?

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

You need to loop through the contents of the array. The first element [0] contains the count, and [1] thru [n] contain the file names (as you should see from the _ArrayDisplay you have):

For $n = 1 To $FileList[0]
    IniWrite("asd.ini", "asd", "asd", $FileList[$n])
Next

<_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...