Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2008
    Posts
    29

    Don't know how to explain this ( getting data )

    Ok firstly using this as an example... ( Posted by Paul186 here = >> Clicky <<
    Code:
    1.  HTTP.Download("http://www.ipchicken.com/", _TempFolder .. "\\tempfile", 2.  MODE_TEXT);
    3.  error = Application.GetLastError();
    4.  if (error == 0) then
    5.      page = TextFile.ReadToString(_TempFolder .. "\\tempfile");
    6.      File.Delete(_TempFolder .. "\\tempfile", false, false, true);
    7.      ip = string.sub(page, string.find(page, '%d+%.%d+%.%d+%.%d+'));
    8.      if (ip ~= nil) then
    9.          Dialog.Message("IP Address","Your public IP address is '" .. ip .. "'.");
    10.      else
    11.          Dialog.Message("IP Address","Not found");
    12.      end
    13.  else
    14.      Dialog.Message("Error", _tblErrorMessages[error], MB_OK, 
    15.  MB_ICONEXCLAMATION);
    16.  end
    From what I can gather on line 7. The '%d+%' is used to find a set of numbers.

    What would I do to find a set of letters?

    If possible could someone show me by making an example using this test url

    Code:
    http://server123.test.com/download/654321/made up file.rar.001
    I hope this is possible.
    Thanks for any help,

    CDLINK14

  2. #2
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    This is a regular expression, or a pattern, like it is called in Lua.
    You find documentation here, but is not the most easy stuff to understand.

    Ulrich

  3. #3
    Join Date
    Aug 2008
    Posts
    29
    Quote Originally Posted by upeters View Post
    This is a regular expression, or a pattern, like it is called in Lua.
    You find documentation here, but is not the most easy stuff to understand.

    Ulrich
    Ok I've managed to get the first bit of the code done, but now it's a case of how do I do the rest of the code?

    ( Bold code is part I've figured out so far )
    http://server123.test.com/download/654321/made up file.rar.001

    Now what about the last part? The file/filename, since i'm effectively making a download manager. The files length could be anything, could contain a number of any characters, a wide selection of ".", etc

Similar Threads

  1. Bug? ComboBox Data with "Rename resource files"
    By rep in forum AutoPlay Media Studio 7.5 Suggestions
    Replies: 1
    Last Post: 05-27-2008, 10:36 AM
  2. Edit Text and Add Data
    By Neopolian in forum Setup Factory 7.0
    Replies: 14
    Last Post: 01-12-2008, 06:37 AM
  3. INFO: Microsoft Data Access Components 2.8 Runtime Notes
    By Desmond in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 11-28-2003, 08:20 AM
  4. Replies: 0
    Last Post: 06-22-2003, 06:47 AM
  5. INFO: Why Files are Renamed in the DATA Folder
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 03:36 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