Announcement

Collapse
No announcement yet.

read from folder and write it to menubar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • jassing
    replied
    Yes you've said that; which line is giving you an ERROR and what is the error?

    Leave a comment:


  • GoOgLe
    replied
    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:


  • jassing
    replied
    Originally posted by GoOgLe View Post
    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
    What error are you getting?
    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:


  • GoOgLe
    replied
    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:


  • jassing
    replied
    Originally posted by GoOgLe View Post
    when i choose desktop i get error but when i choose my documents no error but no item on menu bar...
    What error do you get? I would think that no exe's would be in the desktop or my documents...

    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:


  • GoOgLe
    replied
    when i choose desktop i get error but when i choose my documents no error but no item on menu bar...

    Leave a comment:


  • jassing
    replied
    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:


  • GoOgLe
    replied
    thanks for reply jassing

    on preload but i got error

    Leave a comment:


  • jassing
    replied
    Originally posted by GoOgLe View Post
    is it possible to show all exe files in the folder on menubar ?
    at design time or runtime?

    I don't have ams -- but reading the docs; it looks like something like this might 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= 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
    100% untested, I don't have ams -- and suf7 doesn't have a menubar.

    Leave a comment:


  • GoOgLe
    started a topic read from folder and write it to menubar

    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.
Working...
X