Online Shopping : Computers : Internet : www.cyberlawsindia.net : URL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 2 people (0%) answered Yes
Recently 0 of 2 people (0%) answered Yes

Entry

TSE: How to automatically get the source code of any URL and edit it in TSE?

Sep 16th, 2003 08:39
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 13 November 2002 - 07:20 pm -------------------

TSE: Internet: URL: Source code: Get: How to automatically get the 
source code of any URL and edit it in TSE?

Steps: Overview:

 1. Download the program

     urlget.exe

    you can use for example this URL:

    http://www.amibroker.com/download.html

 2. You then compile this example macro from TSE:

    PROC Main()
     STRING myurlS[255] = "http://www.semware.com"
     STRING mysourcefilenameS[255] = "c:\mysource.txt"
     Dos( "urlget.exe" + " " + myurlS + " " + mysourcefilenameS )
     Warn( "When the program is ready" ) // it is necessary to wait 
until program urlget.exe is ready, you can also use the TSE 'Delay()' 
function
     EditFile( mysourcefilenameS )
    END

    <F12> Main()

 3. Then press <F12> to run this macro

---

Note:

-make sure that the executable program urlget.exe is in the same 
directory
 as this macro, otherwise adapt the path in the macro so that that
 program 'urlget.exe' can be found.

-You can change the 'myurlS' to the URL of your own choice

-You can change the 'mysourcefilenameS' to the filename of your own 
choice

---
---

Note: to pass a filename in quotes, use

 urlget file://"<your filename>" <your output filename>

---

e.g.

 urlget file://"c:\bbc\taal\xmlhtmlsourceview.htm" c:\temp\ddd.txt

---

e.g.

 urlget file://"c:\temp\myhtmlfile.htm" c:\temp\ddd.txt

---
---

Note:

If you want to use a local html file as your URL, you will
have to put 'file://' in front of the filename

e.g.
 c:\temp\myfilename.htm

should become:

 file://c:\temp\myfilename.htm

So to generalize this, in your macro you could insert this line:

 myurlS = "file://" + myurlS

----------------------------------------------------------------------