Announcement
Collapse
No announcement yet.
read from folder and write it to menubar
Collapse
X
-
this didnt work... !!!
Code:local cFolder = Dialog.FolderBrowse("Which folder to fill from?",_SourceFolder); if Folder.DoesExist( cFolder ) then local tFiles = File.Find(cFolder,"*.exe"); if Table.Count( tFiles ) > 0 then local x = 0; local tMenu={}; tMenu.ID=200; tMenu.Text="Available EXE's"; tMenu.Enabled = true; tMenu.Checked = false; tMenu.SubMenu={}; for x=1,Table.Count(tFiles) do tMenu.SubMenu[x]={}; tMenu.SubMenu[x].Text= tFiles[x]; tMenu.SubMenu[x].ID = 200+x; tMenu.SubMenu[x].Checked = false; tMenu.SubMenu[x].Enabled=true; end Application.SetLastError(0); Application.SetMenu( tMenu ); local nErr = Application.GetLastError(); if nErr > 0 then Dialog.Message("Error",_tblErrorMessages[ nErr ] ); end else Dialog.Message("Oops","No files found"); end end
Leave a comment:
-
What error are you getting?Originally posted by GoOgLe View Postthanks alot jassin
i think eroor i get on desktop is because i have no exe file but in my documents i have exe file but i cant write to menubar
The fact that it doesn't work doesn't suprise me since I've never worked with menu bars; but errors? I can't find anything that would generate an error...
My repairs just took a turn for the worst, and I have to head off island to pick up some materials. This will push back when I can get to this -- I will put in for a eval donwload request before I leave.
-josh
Leave a comment:
-
thanks alot jassin
i think eroor i get on desktop is because i have no exe file but in my documents i have exe file but i cant write to menubar
Leave a comment:
-
What error do you get? I would think that no exe's would be in the desktop or my documents...Originally posted by GoOgLe View Postwhen i choose desktop i get error but when i choose my documents no error but no item on menu bar...
Like I said; 100% untested; I just did that from reading the documents. I'll request a demo download and try it -- I probably won't get the download until today; but I'm leaving for the weekend early tomorrow... so might not be until monday or tuesday.
Leave a comment:
-
when i choose desktop i get error but when i choose my documents no error but no item on menu bar...
Leave a comment:
-
Looks like this line is erroring out:
local tMenu= Application.GetMenu();
Try changing it to
local tMenu={};
or better; find out why GetMenu is failing...
Leave a comment:
-
at design time or runtime?Originally posted by GoOgLe View Postis it possible to show all exe files in the folder on menubar ?
I don't have ams -- but reading the docs; it looks like something like this might work:
100% untested, I don't have ams -- and suf7 doesn't have a menubar.Code:local cFolder = Dialog.FolderBrowse("Which folder to fill from?",_SourceFolder); if Folder.DoesExist( cFolder ) then local tFiles = File.Find(cFolder,"*.exe"); if Table.Count( tFiles ) > 0 then local x = 0; local tMenu= Application.GetMenu(); tMenu.ID=200; tMenu.Text="Available EXE's"; tMenu.Enabled = true; tMenu.Checked = false; tMenu.SubMenu={}; for x=1,Table.Count(tFiles) do tMenu.SubMenu[x]={}; tMenu.SubMenu[x].Text= tFiles[x]; tMenu.SubMenu[x].ID = 200+x; tMenu.SubMenu[x].Checked = false; tMenu.SubMenu[x].Enabled=true; end Application.SetLastError(0); Application.SetMenu( tMenu ); local nErr = Application.GetLastError(); if nErr > 0 then Dialog.Message("Error",_tblErrorMessages[ nErr ] ); end else Dialog.Message("Oops","No files found"); end end
Leave a comment:
-
read from folder and write it to menubar
is it possible to show all exe files in the folder on menubar ?Last edited by GoOgLe; 03-18-2008, 02:30 PM.Tags: None
Leave a comment: