Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Posts
    9

    argument 2 must be of type string

    Hi some one could help me

    hi have this code

    Application.Minimize();
    ligacaoweb = HTTP.TestConnection("http://www.beprofit.pt", 20, 80, nil, nil);
    teste1 = Dialog.Message("", "Voltar ao Mega Pacote de Jogos.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Dialog.Message("Resultado:", teste1);
    Dialog.Message("Resultado:", ligacaoweb);
    x1 = ligacaoweb
    Dialog.Message("Resultado:", x1);

    hi need to receive a true or false result from the string ligacaoweb

    thanks

  2. #2
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Here's an example to check for an active Internet connection:

    Code:
    Application.Minimize();
    
    ligacaoweb = HTTP.TestConnection("http://www.beprofit.pt", 20, 80, nil, nil);
    
    if (ligacaoweb) then -- ligacaoweb already returns 'true' or 'false'.  This can be also: if (ligacaoweb = true) then (but the '= true' is not needed.
    	Dialog.Message("Notice", "Yes, there is an active Internet connection.")
    else
    	Dialog.Message("Alert!", "No, there is not an active Internet connection!")
    end
    And the error code you are getting (SEE: Subject of this thread) is because you are trying to print, directly, a boolean Return. (what's handed back from the HTTP action):

    Dialog.Message("Resultado:", ligacaoweb);

    Sincerely,

    {Edit}

    Let me put in a suggestion that I use all the time still. Check the help file for the Action you want to know about (say the Return value, ie. was it a boolean it gives back, a string, a number, etc. etc.). These are stated at the bottom, or near to such, of each Action that has a Return value in the help file.

    Last edited by Intrigued; 06-04-2005 at 08:58 AM.
    Intrigued

  3. #3
    Join Date
    Jun 2005
    Posts
    9

    Thumbs up Thanks

    Thanks for the Help

  4. #4
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Anytime Carlos.

    One other thing... Indigo Rose offers for download (or via 'hard copy', aka. book) the Users Guide and one about the Scripting side of AMS 5. That's how I got much more comfortable with AMS 5. Read, try, read, try... all the way through those points of help.

    Intrigued

  5. #5
    Join Date
    Jun 2005
    Posts
    9

    Huh? Another Help

    Could you help me with this code

    liga = Button.GetText("Som");



    if liga == "Som Desligado" then
    Audio.Pause(CHANNEL_NARRATION);
    Button.SetText("Som", "Som Ligado");

    elseif liga == "Som Ligado" then
    Audio.Play(CHANNEL_NARRATION);
    Button.SetText("Som", "Som Desligado");
    end

    The text togle ob in the button but the funcion to pause doesnt work

    thanks

  6. #6
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi here's a demo project which shows an example of toggle button text. Hope that helps.
    Attached Files

Similar Threads

  1. Argument 2 must be of typed string
    By rctshine in forum Setup Factory 7.0
    Replies: 24
    Last Post: 03-23-2005, 08:59 AM
  2. 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
  3. 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
  4. Function: Show/Hide All Objects of a Specific Type
    By Brett in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-10-2004, 02:29 PM
  5. Function: Convert boolean value to string
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-07-2004, 01:14 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