Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 25
  1. #1
    Join Date
    Mar 2005
    Posts
    103

    Huh? Argument 2 must be of typed string

    I get this message when trying to unzip a file.

    Here is the code I am using:

    -- These actions are performed before the screen is shown.

    --Instructions.
    result = Dialog.Message("Notice", "A box will now pop up. in this box, please select where you would like the program to install the Darkflash template.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    --Rename for Unzipping.
    file_rn = File.Rename("_TempFolder..\\xaosd.txt", "_TempFolder..\\xaosd.zip");
    --check for errors.
    error1 = Application.GetLastError();
    --if there are errors, display them.
    if (error1 ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    else
    -- Allow the user to select a directory to unzip the files.
    target_folder = Dialog.FolderBrowse("Select a Folder", "C:\\");
    -- Check to see if the user cancelled or an error occurred.
    if (target_folder ~= "CANCEL") and (target_folder ~= "") then
    -- Gets a list of the contents of a zip file.
    zip_contents = Zip.GetContents("_TempFolder..\\xaosd.zip", true);

    -- Get the error code of the last action.
    error = Application.GetLastError();

    -- If an error occurred, display the error code message.
    if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    else
    -- Take the table and turn it into a string with newlines for displaying.
    zip_contents_display = Table.Concat(zip_contents, "\r\n", 1, TABLE_ALL);

    -- Ask the user if they are sure they would like to unzip the contents.
    result2 = Dialog.Message("Information", "The following files will be unzipped:\r\nClick the Cancel button to abort the process.\r\n\r\n"..zip_contents_display, MB_OKCANCEL)

    -- If the user clicked Ok, unzip the files.
    if (result2 == IDOK) then
    -- Show the status dialog.
    StatusDlg.Show();
    -- Extract the contents of the Zip file.
    Zip.Extract("xaosd.zip", {"*.*"}, target_folder, true, true, "", ZIP_OVERWRITE_ALWAYS, nil);

    -- Check the error code for the last action.
    error = Application.GetLastError();

    -- Show the status dialog.
    StatusDlg.Show(MB_ICONNONE, false);

    -- If an error occurred, display the error code message.
    if (error ~= 0) then
    Dialog.Message("Errror", tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    else
    Dialog.Message("Success", "The unzipping was successful.", MB_OK, MB_ICONINFORMATION);
    end
    end
    end
    end
    end
    I'm at my wits-end.

    I don't know what to do.

    Help!

  2. #2
    SUF6NEWBIE Guest
    change:

    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);

    to:

    Dialog.Message("Error", _tblErrorMessages[error1], MB_OK, MB_ICONEXCLAMATION);

    you will then get the error message displaying correctly
    (which I got as 'source file does not exist)

    BTW: it can be helpfull to 'quote' the 'line number' for these types
    of post (when you are shown one by the runtime)
    ..the code can then be looked at and simpler things like 'typos'
    can be picked up more quickly for you..
    Last edited by SUF6NEWBIE; 03-21-2005 at 06:39 PM.

  3. #3
    SUF6NEWBIE Guest
    also keep in mind that 'builtin variables' like _TempFolder, _TempLaunchFolder
    etc. do not require being enclosed with ""

    ..so "_TempFolder.."\\xaosd.txt" will not work
    where _TempFolder.."\\xaosd.txt" is how to do things

    also the main issue with your code is that you must have or create
    a valid Zip file ..simply renaming a file to .zip does not work
    the zip plugin, like all zip programs require a valid Zip structure,
    to be able to work with a zip files.

    So you need to use the Zip.Add action-s to create a valid zip file
    and then go from there

    Look up the help docs for the Zip plugin and see how you go..

  4. #4
    Join Date
    Oct 2003
    Posts
    908
    Hey! Pretty soon you're going to have to change your name to "SUF7NEWBIE" or better still "SUF7EXPERT"!

  5. #5
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hee! I vote for SUF7EXPERT.

  6. #6
    SUF6NEWBIE Guest
    I'm a legend in my own lunchbox

    might start again with a new 'handle'..what ya reckon Sir TED-COREY ?

  7. #7
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Sure, why not? The Vbulletin system is such that we can't edit usernames without possibly messing up some aspect of the database or I'd just do that. I say go ahead, have some fun with it, pick a new name you like more, etc.

  8. #8
    SUF6NEWBIE Guest
    will do Amigo..been considering it for a while now...

    start 'squeeky clean'

    FYI

    I'm gonna use 'Eagle' ..has meanings for me etc

    signing off as poor 'SUF6NEWBIE' ...we knew him well
    Last edited by SUF6NEWBIE; 03-22-2005 at 07:13 PM.

  9. #9
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Viva la Eagle!

  10. #10
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,038
    Nearly 650 posts is quite a few to give up when you change names, but referring to you as newbie seems sort of silly, seeing how you’re an expert with SUF7.

    Maybe you could add aka SUF6NEWBIE to your new signature, although it probably won't take long to figure out who the new member is.


    Oops! should have refreshed my screen. Eagle is a great name.

    .
    Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more.
    Visit Acme-Tek

  11. #11
    SUF6NEWBIE Guest
    registering..won't accept my current email details..HELP

    ..states 'already in use'..I did log off etc..suggestions ?

    ps..was thinking the same JIM..

  12. #12
    Join Date
    Mar 2005
    Location
    WA 'wait a while' - Australia
    Posts
    872
    as you can see the Eagle is now 'flying'

  13. #13
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Cool! Yep I agree with Jim, Eagle is a great nick. Once again Ted's mighty "Hey" has been a catalyst for change.

  14. #14
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Quote Originally Posted by Eagle
    as you can see the Eagle is now 'flying'
    We in the U.S. like Eagles, espeically the Haliaeetus leucocephalus!

    Intrigued

  15. #15
    Join Date
    Mar 2005
    Location
    WA 'wait a while' - Australia
    Posts
    872
    ..'Haliberricus beauticus' to you too my friends..

    tks folks

    Ted is mighty force to be reckoned with, as long as he makes
    Sandy and the Team a brew every now and then

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Argument 1 must be of type string
    By Sheritlw in forum Setup Factory 7.0
    Replies: 1
    Last Post: 09-27-2004, 05:32 PM
  2. attempt to index a string value
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 08-08-2004, 01:23 AM
  3. "Get Delimited String" -- Delimiter can be a string?
    By Bishal in forum Setup Factory 6.0
    Replies: 1
    Last Post: 10-16-2003, 10:40 AM
  4. While loop in a string
    By Option_Explicit in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 03-04-2003, 07:10 AM
  5. How to define argument for progr on CD?
    By Harry Kiesel in forum AutoPlay Menu Studio 3.0
    Replies: 2
    Last Post: 11-26-2001, 09:50 AM

Posting Permissions

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