Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2006
    Posts
    64

    Thumbs up zip filename from string?

    hi! is it at all possible to save a zip file using a stored string?

    An explaination:
    I got an app with a dialog.input asking for a name, it stores this name as itemname

    What I want is for my app to add files to a zip file, but with the name from itemname, I have tried to use ".."to combine things, but it aint going right, the code I have at the moment is:

    itemname = Dialog.Input("Enter Data", "Enter Name:", "", MB_ICONQUESTION);
    Label.SetText("Atitle", itemname);
    FileTable = {_SourceFolder.."\\AutoPlay\\TempFolder\\text.txt" ;_SourceFolder.."\\AutoPlay\\TempFolder\\Intro.txt " ;_SourceFolder.."\\AutoPlay\\TempFolder\\ending.tx t" };
    Zip.Add(_SourceFolder.. "\\AutoPlay\\Docs\\Inform\\"..itemname", FileTable, false, "passworded", 0, nil, false);

    this informs me that a ')' was expected at the end of the password part, what am I doing wrong?

  2. #2
    Join Date
    Nov 2006
    Posts
    64
    ... or even any sort of filename from a user unput for that matter would be a big help for various other projects I have running.

  3. #3
    Join Date
    Nov 2006
    Posts
    233
    Code:
    Zip.Add(_SourceFolder.. "\\AutoPlay\\Docs\\Inform\\"..itemname", FileTable, false, "passworded", 0, nil, false);
    one too many quotes, remove the one on line 4 after itenname like so

    Code:
    Zip.Add(_SourceFolder.. "\\AutoPlay\\Docs\\Inform\\"..itemname, FileTable, false, "passworded", 0, nil, false);

  4. #4
    Join Date
    Nov 2006
    Posts
    64
    Thank you Desrat, that worked a treat!

    Now I hope someone can solve the next part...

    if you run the attatched project, and load the "demo file" I need the combo box to store in the name of the report and to automatically load the completed combo box on the next run, ie, to 'save' the contents of the combo and load it next time it is run, and also, Id like to code the combo box so when someone clicks a title in the combo, id like it to extract the file that has the same name and have it displayed in the main program window!

    If this sounds confusing, just dload the exported app, preview or build it and have a play round as most of the time I know what I need to say, but cant find the right words without going all round the houses lol!!


    Thanks again!
    Attached Files

  5. #5
    Join Date
    Nov 2006
    Posts
    64
    Would it be at all possible cos if not, then I will have to think of a work-around for this part.

  6. #6
    Join Date
    Nov 2006
    Posts
    64
    well I take it nobody wants to help me, well thanks people, so much for a "forum"...

  7. #7
    Join Date
    May 2006
    Posts
    5,380
    so much for a "forum"...
    lol, this is properly the best dev help forum on the net, and its hard to help someone that dosent really know what it is they want to do, also taking that attitude is not the best way to go about getting help, this post slipped by me but as im here now i'll offer my advice.

    to save the contents of the combo there are several ways to go about it, ini, text, sql, xml

    when your app exits make it retrieve a table from the combo and save it and load the table when the app loads

    heres some sample code that saves the combo contents to a ini file

    put this in page "on close" (this will save the combo contents to ini file)
    Code:
    cCount = ComboBox.GetCount("ComboBox1");
    if cCount ~= 0 then
    	for i=1, cCount do
    		cText = ComboBox.GetItemText("ComboBox1", i);
    		cData = ComboBox.GetItemData("ComboBox1", i);
    		INIFile.SetValue(_SourceFolder.."\\AutoPlay\\Docs\\ComboContents.ini", i, "Text", cText);
    		INIFile.SetValue(_SourceFolder.."\\AutoPlay\\Docs\\ComboContents.ini", i, "Data", cData);
    	end
    end
    put this in page "on show" (this will load the contents of the ini file to the combo
    Code:
    tbTable = INIFile.GetSectionNames(_SourceFolder.."\\AutoPlay\\Docs\\ComboContents.ini");
    if tbTable then
    	for i,k in tbTable do
    		stText = INIFile.GetValue(_SourceFolder.."\\AutoPlay\\Docs\\ComboContents.ini", k, "Text");
    		stData = INIFile.GetValue(_SourceFolder.."\\AutoPlay\\Docs\\ComboContents.ini", k, "Data");
    		ComboBox.AddItem("ComboBox1", stText, stData);
    	end
    end

    and heres a example apz
    Last edited by RizlaUK; 02-01-2009 at 11:35 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  8. #8
    Join Date
    Nov 2006
    Posts
    64
    thanks and sorry for my outburst, as the saying goes, Im underpaid & overworked!
    Im trying to take on as much as I can to make ends meat for me, my partner & our 3 yr old daughter, I know I shouldnt take on more than I can handle, but I really do need the money, and its experience that I need so I can put it on my CV to get the job I want, I have 2 part time jobs too, I hardly sleep n I dunno what Im doin most of the time, I know these maybe excuses, but Im just trying to install a bit of understanding for my outburst.

    Thanks again Rizla, as always, the code is spot on!

    How easy is it to get AMS to run/open docs & apps after a click of the right file in the combo box?
    Is it as simple as a file.open command?

  9. #9
    Join Date
    May 2006
    Posts
    5,380
    hey no problem, i would have posted you some code sooner but as i say, this post slipped by me, i don't have as much time for this stuff as i used to, its mainly weekends i get stuck into the forum, in the week im just to dam tired form working 12 hours a day on a building site.

    i know all about trying to make ends meet, i too have a 3yo daughter and one on the way also, i have been trying to break into the programing world so i can work from home again but the building trade seems to have a firm grasp of me and i cant see that changing for a while now.......but thats a long story



    to get a file to run from the combo its as simple as 2 lines of code

    put this in your combo "on select" event
    Code:
    FilePath = ComboBox.GetItemData("ComboBox1", e_Selection);
    result = File.Run(FilePath, "", "", SW_SHOWNORMAL, false);

    good luck with your project and cv, and GET SOME SLEEP, lol
    Open your eyes to Narcissism, Don't let her destroy your life!!

  10. #10
    Join Date
    Nov 2006
    Posts
    64
    lol thanks! I think I will hit the sack soon, just gonna paste the code in, save it n thats that for another day, need to be up at 6 in the morning lol!

    Take it easy!

Similar Threads

  1. Jukebox Enhancements
    By Zylo in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 01-13-2007, 07:39 PM
  2. Filename of a currently extracted file from a zip file
    By gridrunner in forum Setup Factory 7.0
    Replies: 1
    Last Post: 08-28-2006, 06:12 AM
  3. Problems trimming filename string
    By JMPIV4 in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 12-29-2005, 12:10 PM
  4. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts