Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420

    ..more code probs

    ive been trying to use the ftp plugin. I managed to get it connected up ok when i specified the url/user/pass in the program but im having difficulty when using user inputs;-
    Code:
    myFTP  = Input.GetText("iptFTP");
    myUser = Input.GetText("iptUser");
    mypass = Input.GetText("iptAssp");
    
    if Label.GetText("FTPStatus")=="Disconnected" then
       FTP.Connect(myFTP, myUser, mypass, "", true);
       end
    the error im getting is 'attempt to index global FTP (a string value)'

  2. #2
    Join Date
    Dec 2003
    Posts
    891
    Mina has a good FTP example on her site
    go here and download the ftp example apz.

  3. #3
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    Thanks but im also intrested why this isnt working in the first place.

  4. #4
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Wild guess... Either the FTP plugin is not loaded or you have overwritten the table containing the FTP functions with another value... are there any variables named FTP anywhere in your script?
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  5. #5
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    Thanks. Yes i did overwrite FTP.

  6. #6
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    just for the sake of anyone else searching for a solution on this..
    in the end i made a global function;-
    Code:
    function checkFTP()
        if String.Length(Input.GetText("ipthost"))>0 and FTP.IsValidHostname(Input.GetText("ipthost")) and String.Length(Input.GetText("iptuser"))>0 and String.Length(Input.GetText("iptpass"))>0 and  Button.IsVisible("butConnect")==false then
           Button.SetVisible("butConnect", true);
    elseif String.Length(Input.GetText("iptuser"))==0 or String.Length(Input.GetText("iptpass"))==0 and  Button.IsVisible("butConnect")==true then
           Button.SetVisible("butConnect", false);
          end
    end
    that i call from the OnKey condition of the host/user/pass input boxes. It switches on the connect button when the input boxes have been filled and the host name is valid.
    Then on the connect button i put;-
    Code:
    hostname  = Input.GetText("ipthost");
    username = Input.GetText("iptuser");
    password = Input.GetText("iptpass");
    account  ="";
    
    if Label.GetText("MyHostStatus")=="Disconnected" then
    
       FTP.Connect(hostname, username, password, account, true);
    
       if FTP.IsConnected()==true then
          Button.SetText("butConnect", "Disconnect");
          Audio.Load(CHANNEL_EFFECTS, "AutoPlay\\Audio\\Copy of Bleeep-Public_D-17.wav", false, false);
          Audio.Play(CHANNEL_EFFECTS);
          Label.SetText("MyHostStatus", "Connected");
          end
    else
       FTP.Disconnect()
       Button.SetText("butConnect", "Connect");
       Label.SetText("MyHostStatus", "Disconnected");
       Audio.Load(CHANNEL_EFFECTS, "AutoPlay\\Audio\\Clicka-TM-533.wav", false, false);
       Audio.Play(CHANNEL_EFFECTS);
       end
    when its connected it switches the 'connect' button to 'disconnect' and changes the text of the MyHostStatus to Connected. The sound effects were custom ones i imported.
    Last edited by clueless; 08-03-2006 at 06:03 PM.

Similar Threads

  1. Article: Using Authenticode Code Signing Certificates
    By Ted Sullivan in forum Setup Factory 8.0 Examples
    Replies: 4
    Last Post: 10-31-2007, 09:03 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