21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis...

30
HTML/HTTP Functions HTML/HTTP Functions

Transcript of 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis...

Page 1: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions

HTML/HTTP Functions

Page 2: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions

Functions Synopsis

The Internet has changed the way we build applications. Internet technologies and techniques are still in their infancy but they promised to dramatically affect our applications in general. This is not a question of Internet Browsers but much more deeply a way we will need to interact with resources. This world of connected computers require to get tools that make it possible to access databases, tables and files anywhere. As such, FOCUS.FLL needed to give the Visual FoxPro developer the tools to keep in touch with the natural evolution of modern software.With version 7.85 of FOCUS.FLL we have built our very first Internet functions. Many of the internals of FOCUS.FLL will change in the future while preserving your existing code. More will come as time goes by.Please take also a look at the FTP functions of FOCUS.FLL.

Page 3: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions

HTML_Decode() : decodes an HTML encoded string.

Caution

The internal buffer used by the HTML_Decode() function cannot contain more than 4096 characters.

SyntaxHTTP_Decode( szHtml] ) szString

ParametersszHTML the resulting encoded string.

ReturnsszString the string to HTML encode.

Example? HTML_Decode(HTML_Encode( ["Ce bel été"] )) && "Ce bel été"

HTML_Encode() : applies HTML encoding to the specified text string.

Remark

The HTML_Encode()applies HTML encoding to the specified text string. Its typical use is to display the contents of text fields contained in a database in HTML. Characters in the string such as “<” and “&” that have special meanings in HTML are converted into their HTML equivalents, such as &lt; and &amp; so that they will be displayed correctly by the client browser.

If the text string to be displayed already contains HTML encoding, do not use the HTML_Encode() function. For example, suppose a product description field contains HTML-encoded text such as "The <I>Classic Diner Clock</I> brings the age of the &quot;Golden Oldies&quot; to your kitchen." . This string uses the <I> tag to format italic text and the &quot; sequence to display quotation marks when displayed by the client browser. Because the string is already coded in HTML, you do not need to encode it again. Double-encoding the string would produce incorrect results.

From To From To"&" "&amp;" "Ò" "&Ograv;""<" "&lt;" "Ó" "&Oacute;"">" "&gt;" "Ô" "&Ocirc;"""" "&quot;" "Õ" "&Otilde;""°" "&deg;" "à" "&agrave;""²" "&sup2;" "á" "&aacute;""³" "&sup3;" "â" "&acirc;""¶" "&para;" "ã" "&atilde;""±" "&plusmn;" "Ö" "&ouml;""©" "&copy;" "÷" "&divide;""«" "&laquo;" "ù" "&ugrave;""®" "&reg;" "ú" "&uacute;""»" "&raquo;" "û" "&ucirc;""¼" "&frac14;" "ü" "&uuml;""½" "&frac12;" "æ" "&aelig;""¾" "&frac34;" "é" "&eacute;""À" "&Agrave;" "ê" "&ecirc;""Á" "&Aacute;" "ë" "&euml;""Â" "&Acirc;" "Ì" "&igrave;""Ã" "&Atild;" "Í" "&iacute;""Ä" "&Auml;" "Ò" "&ograve;""Å" "&Aring;" "Ó" "&oacute;"

Page 4: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions"Æ" "&AElig;" "Ô" "&ocirc;""È" "&Egrav;" "Õ" "&otilde;""É" "&Eacute;" "é" "&eacute;""Ê" "&Ecirc;" "è" "&egrave;""\n" (CHR(13)+CHR(10))

"<BR>"

Caution

The internal buffer used by the HTML_Encode() function cannot contain more than 4096 characters.

SyntaxHTTP_Encode( szString] ) szHTML

ParametersszString the string to HTML encode.

ReturnsszHTML the resulting encoded string.

Example? HTML_Encode( ["Ce bel été"] ) && &quot;Ce bel &eacute;t&eacute;&quot;

HTML_LastVersion() : Returns the file stamp of HTML functions.

RemarkThis function helps the developer identifying the last version of a set of functions. Sometimes the global version information of FOCUS.FLL (MIS_major() and MIS_minor()) does not help tracking down the changes in a project. Starting with version 6.0 of FOCUS.FLL, each source file has now an internal date and time stamp.

SyntaxHTML_LastVersion() szLastVersion

ParametersNone.

ReturnsszLastVersion string identifying the last version of the functions set.

HTTP_AttemptConnect() : Attempts to make a connection to the Internet.

RemarkThis function allows an application to first attempt to connect before issuing any requests. A client program can use this to evoke the dial-up dialog box. If the attempt fails, the application should enter offline mode.

SyntaxHTTP_AttemptConnect() lSuccess

ParametersNone.

ReturnslSuccess .T. if the connection has been made; .F. if not.

Page 5: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsExampleIF ( ! HTTP_AttemptConnect() ) IF ( HTTP_InternetDial( "MyDialUp" ) ) ? "You're connected to the Internet" ENDIFENDIF

HTTP_CanonicalizeURL() : Canonicalizes a URL, which includes converting unsafe characters and spaces into escape sequences.

RemarkA Uniform Resource Locator (URL) is a compact representation of the location and access method for a resource located on the Internet. Each URL consists of a scheme (HTTP, HTTPS, FTP, or Gopher) and a scheme-specific string. This string can also include a combination of a directory path, search string, or name of the resource. The FOCUS Internet functions provide the ability to split and and canonicalize URLs.The format of all URLs must follow the accepted syntax and semantics in order to access resources through the Internet. Canonicalization is the process of formatting a URL to follow this accepted syntax and semantics.Characters that must be encoded include any characters that have no corresponding graphic character in the US-ASCII coded character set (hexadecimal 80-FF, which are not used in the US-ASCII coded character set, and hexadecimal 00-1F and 7F, which are control characters), blank spaces, "%" (which is used to encode other characters), and unsafe characters (<, >, ", #, {, }, |, \, ^, ~, [, ], and ').If HTTP_CanonicalizeURL() is used on the canonicalized URL, the escape sequence "%25" would be converted into the escape sequence "%2525", which would not work properly.Do not use the HTTP_CanonicalizeURL() to encode HTML text: use the HTML_Encode() function instead.

SyntaxHTTP_CanonicalizeURL( szURL] ) szComponent

ParametersszURL the URL to canonicalize.

ReturnsszComponent the resulting canonicalized URL.

Example? HTTP_canonicalizeURL( "http://www.fastwrite.com/does not exist/index.htm" )&& http://www.fastwrite.com/does%20not%20exist/index.htm

HTTP_CrackURL() : Cracks a URL into a domain and path.

SyntaxHTTP_CrackURL( szURL[,nType] ) szComponent

ParametersszURL the base URL to access.nType optional parameter.

Value Description0 Host name (domain)1 Path2 Host name (domain) + Path

ReturnsszComponent the desired component.

Page 6: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsExampleLOCAL szDomainLOCAL szPathLOCAL szStatus

#define HTTP_QUERY_STATUS_CODE 19

&& Let's split the URL into a domain name and a path&& For example, http://www.fastwrite.com/images/BannerVFP.jpg is the complete URL

&& szDomain = HTTP_CrackURL( szFull,0 ) -> "www.fastwrite.com"&& szPath = HTTP_CrackURL( szFull,1 ) -> "/images/BannerVFP.jpg"

szDomain = HTTP_CrackURL( szURL,0 ) && Get the host nameszPath = HTTP_CrackURL( szURL,1 ) && Get the path

&& Now ... let's ask FOCUS.FLL whether that resource existszStatus = HTTP_IsURL( szDomain,szPath,HTTP_QUERY_STATUS_CODE )

&& "200" means OK; 404 means page not found; 403 means Forbidden ... these codes && are the same as the ones used in Internet ExplorerIF ( szStatus != "200" ) ? "Resource exists!"ENDIF

HTTP_CombineURL() : Combines a base and a relative URL into a single URL.

SyntaxHTTP_CombineURL( szBaseURL,szRelURL ) szURL

ParametersszBaseURL the base URL to access.szRelURL the relative URL.

ReturnsszURL the combined URL.

Example&& In this example, you see that meta sequences such as "." and ".." are removed&& from the final URL? HTTP_CombineURL( "http://www.fastwrite.com","products/./../products/focus/vcx" )&& "http://www.fastwrite.com/products/focus/vcx"

&& In this example you see that the space is converted to a %XX sequence? HTTP_CombineURL( "http://www.fastwrite.com","focus /vcx" )&& http://www.fastwrite.com/focus%20/vcx

HTTP_GetCodeText() : Returns a descriptive text corresponding to a given HTTP responde code.

SyntaxHTTP_GetCodeText( m.szCode ) szDesc

ParametersszCode code to obtain a descriptive text for.

100 Continue101 Switching Protocols200 OK

Page 7: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions201 Created202 Accepted203 Non-Authoritative Information204 No Content205 Reset Content206 Partial Content300 Multiple Choices301 Moved Permanently302 Found303 See Other304 Not Modified305 Use Proxy307 Temporary Redirect400 Bad Request401 Unauthorized402 Payment Required403 Forbidden404 Not Found405 Method not allowed406 Not acceptable407 Proxy Authentication Required408 Request Time-Out409 Conflict410 Gone411 Length Required412 Precondition Failed413 Request Entity Too Large414 Request URI Too Large415 Unsupported Media Type416 Requested range not satisfiable417 Expectation Failed500 Internal Server Error501 Not Implemented502 Bad Gateway503 Service Unavailable504 Gateway Time-Out505 HTTP Version Not Supported

ReturnsszDesc description.

Example? HTTP_GetCodeText( "500" ) && "Internal Server Error"? HTTP_GetCodeText( "200" ) && "OK"? HTTP_GetCodeText( "404" ) && "Not Found"

HTTP_GetDefaultBrowser() : Returns the default browser application that will be invoked for *.htm files.

SyntaxHTTP_GetDefaultBrowser() szBrowser

ParametersNone

ReturnsszBrowser full path to browser application or empty string ("") in case of error.

Example? HTTP_GetDefaultBrowser() && "C:\Program Files\Internet Explorer\iexplore.exe"

Page 8: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsHTTP_GetURL() : Retrieves URL as a string.

RemarkProxies and firewalls are not supported for the time being. HTTP_GetURL() features a server timeout of 60 seconds: if the server does not respond within 60 seconds, the request is aborted. The same applies when the server does not send any more information within the same period.

SyntaxHTTP_GetURL( szURL[,nMemory] ) szStream

ParametersszURL the URL to access.nMemory optional parameter. If not passed, FOCUS.FLL will freeze some memory space for you. The

function operates quicker if you pass the memory to reserve to retrieve the Internet stream (a page, a sound, an image, ...).

ReturnsszStream Internet stream.

Example&& Example #1* This example copies the homepage of ORACLE into the clipboard_CLIPTEXT = HTTP_GetURL( "http://www.oracle.com" )

* This will yield a string similar to:<HTML><HEAD>

<NOSCRIPT><META HTTP-EQUIV="Refresh" CONTENT="0; URL=/admin/errors/js.html">

</NOSCRIPT><TITLE>Oracle Corporation</TITLE>

<SCRIPT LANGUAGE="JavaScript">// Catch some browser error conditionsif (parseInt(navigator.appVersion.charAt(0) <= 3)) top.location.href =

"/admin/errors/version.html"

crumb = '<A HREF="/" target="_top">Home</A> > ';header = '00';country = 'US';language = 'en';

</SCRIPT></HEAD>

<SCRIPT LANGUAGE="JavaScript" SRC="/admin/jscripts/lib.js"></SCRIPT><SCRIPT LANGUAGE="JavaScript" SRC="/admin/jscripts/lang.js"></SCRIPT><SCRIPT LANGUAGE="JavaScript" SRC="/admin/jscripts/frame.js"></SCRIPT>

<NOFRAMES><BODY> <P>If you can see this page, then either an error has occurred or your web browser does not support some of the features of this web site.<br> Either try reloading this page or click <A HREF="site_map.html">here</A> for more information.</P></BODY></NOFRAMES></HTML>

&& Example #2LOCAL szWebLOCAL szNumLOCAL szExt

&& This example will extract an image from FastWrite's web site. The image is

Page 9: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions&& returned as a string. Then, the string is saved to a file thanks to&& FIL_StringToFile() and finally, the background picture of VFP is set to the&& newly created image file.

szWeb = "http://www.fastwrite.com/products/focus/Banners/Banner"szNum = "001"szExt = ".jpg"szPath = "O:\SPOT2000"

_screen.picture = IIF( FIL_StringToFile( szPath + szNum + szExt , ; HTTP_GetURL( szWeb + szNum + szExt ) ; ) , ; szPath + szNum + szExt,"" )

See AlsoHTTP_GetURL2()., HTTP_PostURL()

HTTP_GetURL2() : Retrieves URL as a string.

RemarkProxies and firewalls are not supported for the time being. HTTP_GetURL() features a server timeout of 60 seconds: if the server does not respond within 60 seconds, the request is aborted. The same applies when the server does not send any more information within the same period. This function does the same thing as HTTP_GetURL(). However, it uses a totally different strategy by calling WININET.

SyntaxHTTP_GetURL2( szURL[,nMemory] ) szStream

ParametersszURL the URL to access.

ReturnsszStream Internet stream.

Example&& Example #1* This example copies the homepage of FastWrire into the clipboard_CLIPTEXT = HTTP_GetURL2( "http://www.fastwrite.com" )

* This will yield a string similar to:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><meta http-equiv="Refresh" content="300"><meta name="revisit-after" content="15"><meta name="classification" content="DVL,PROGRAMMER,DEVELOPER,DLL,WIN32,FOXPRO,VISUAL,FOCUS.FLL"><meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" for "http://www.fastwrite.com" on "2000.08.03T20:55-0800" r (n 0 s 0 v 0 l 0))'><TITLE>FastWrite : Visual FoxPro, FOCUS.FLL, Consulting</TITLE><script language="javascript1.2"><!--imgBranchOpen = new Image;imgBranchClose = new Image;

imgBranchOpen.src = "http://www.fastwrite.com/Images/BranchesOpen2.jpg";imgBranchClose.src = "http://www.fastwrite.com/Images/BranchesClose2.jpg";

// document.write( window.location.pathname );

function DisplayMenu(){

// When the left menu is ON, then the login form shouldn't show up.// When the left menu is OFF, then the login form sgould be displayed// document.all.LogonSection.style.display = "none";

document.all.SideMenu.style.display = "block";

Page 10: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functionsreturn ( true );

}

function HideMenu(){

// When the left menu is ON, then the login form shouldn't show up.// When the left menu is OFF, then the login form sgould be displayeddocument.all.LogonSection.style.display = "block";document.all.SideMenu.style.display = "none";

return ( true );}

function DoNothing(){

return ( false );}

function toggleStyle( szStyle ){ if ( document.all ) { TheStyle = eval( "document.all." + szStyle + ".style" );

if ( TheStyle.display == "block" ) { TheStyle.display = "none"; TheImage = eval( "document.img" + szStyle ); TheImage.src = imgBranchClose.src; } else { TheStyle.display = "block"; TheImage = eval( "document.img" + szStyle ); TheImage.src = imgBranchOpen.src; }

return ( false ); } else { return ( true ); }}

function MakeVisible( szStyle ){

if ( document.all ){

TheStyle = eval( "document.all." + szStyle + ".style" );TheStyle.display = "block";

}

return ( false );}

function MakeInvisible( szStyle ){

if ( document.all ){

TheStyle = eval( "document.all." + szStyle + ".style" );TheStyle.display = "none";

}

return ( false );}

function high(which2){theobject=which2

Page 11: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functionshighlighting=setInterval("highlightit(theobject)",20)}

function low(which2){clearInterval(highlighting)which2.filters.alpha.opacity=60}

function highlightit(cur2){if (cur2.filters.alpha.opacity<100)cur2.filters.alpha.opacity+=15else if (window.highlighting)clearInterval(highlighting)}

function SubTitle0( szFirst,szTitle ){document.write( '<TABLE WIDTH="580" CELLPADDING="0" CELLSPACING="0" BORDER="0" BGCOLOR="#000000">' );document.write( '<TR>');document.write( '<TD><TABLE WIDTH="100%" CELLPADDING="3" CELLSPACING="1" BORDER="0">');document.write( '<TR>');document.write( '<TD WIDTH="10" BGCOLOR="#CC0000" ALIGN="center"><FONT FACE="Verdana, Arial" SIZE="3" COLOR="#FFFFFF>"<B>');document.write( szFirst );document.write( '</B></FONT></TD>' );document.write( '<TD WIDTH="570" BGCOLOR="#5979B6"><FONT FACE="Verdana, Arial" SIZE="3" COLOR="#FFFFFF"><B>');document.write( szTitle );document.write( '</B></FONT></TD>' );document.write( '</TR>' );document.write( '</TABLE></TD>' );document.write( '</TR>' );document.write( '</TABLE>' );}

function SubTitleXMas( szFirst,szTitle ){// Titre pour Noël avec le petit Santa Clausdocument.write( '<TABLE WIDTH="500" CELLPADDING="0" CELLSPACING="0" BORDER="0" BGCOLOR="#000000">' );document.write( '<TR>');document.write( '<TD><TABLE WIDTH="100%" CELLPADDING="3" CELLSPACING="1" BORDER="0">');document.write( '<TR>');document.write( '<TD WIDTH="10" BGCOLOR="#CC0000" ALIGN="center"><FONT FACE="Verdana, Arial" SIZE="3" COLOR="#FFFFFF>"<B>');document.write( szFirst );document.write( '</B></FONT></TD>' );document.write( '<TD WIDTH="490" BGCOLOR="#5979B6"><FONT FACE="Verdana, Arial" SIZE="3" COLOR="#FFFFFF"><B>');document.write( szTitle );document.write( '</B></FONT></TD>' );document.write( '</TR>' );document.write( '</TABLE></TD>' );document.write( '</TR>' );document.write( '</TABLE>' );}

function SubTitleArgousier( szFirst,szTitle ){document.write( '<TABLE WIDTH="600" CELLPADDING="0" CELLSPACING="0" BORDER="0" BGCOLOR="#000000">' );document.write( '<TR>');document.write( '<TD><TABLE WIDTH="100%" CELLPADDING="3" CELLSPACING="1" BORDER="0">');document.write( '<TR>');document.write( '<TD WIDTH="10" BGCOLOR="#68C885" ALIGN="center"><FONT FACE="Verdana, Arial" SIZE="3" COLOR="#FFFFFF>"<B>');document.write( szFirst );document.write( '</B></FONT></TD>' );

Page 12: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functionsdocument.write( '<TD WIDTH="590" BGCOLOR="#45594A"><FONT FACE="Verdana, Arial" SIZE="3" COLOR="#FFFFFF"><B>');document.write( szTitle );document.write( '</B></FONT></TD>' );document.write( '</TR>' );document.write( '</TABLE></TD>' );document.write( '</TR>' );document.write( '</TABLE>' );}

--></script><script language="JavaScript"><!--function OpenWindow( theURL,winName,features ){ window.open(theURL,winName,features);}//--></script></HEAD>

<script language="JavaScript"><!--window.defaultStatus="FastWrite"

var IE_URL = "ie/";var NETSCAPE_URL = "netscape/";var DEFAULT_URL = "default/";

var browser = navigator.appName;

if ( browser.indexOf( "Microsoft Internet Explorer" ) != -1){ //location.href = IE_URL; ;}else if( browser.indexOf("Netscape") != -1){// location.href = "index.html";;}else{ //location.href = DEFAULT_URL; ;}//--></script><link rel="stylesheet" type="text/css" href="http://www.fastwrite.com/styles/fw.css"><!-- Tag End of FWStyles --> <body rightmargin="0" leftmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" bgcolor="#A5A6D8" background=""><div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div><script language="JavaScript" src="http://www.fastwrite.com/js/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>

<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="762"><TR HEIGHT="30"><TD WIDTH="160" VALIGN="middle" BGCOLOR="#A5A6D8" ALIGN="center"><DIV ID="BackHome"><A HREF="http://www.fastwrite.com">Home</A></DIV><!-- End of DIV BackHome --></TD><TD VALIGN="middle" BGCOLOR="#F7B21C"><DIV ID="MainMenu"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"><A HREF="http://www.fastwrite.com/products/products.cfm"><!-- MainMenu is MsgNo : 58 -->Products</A> </SPAN><IMG SRC="http://www.fastwrite.com/Images/separation.jpg" BORDER="0"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"> <A HREF="http://www.fastwrite.com/Products/Services.cfm">Services</A> </SPAN><IMG SRC="http://www.fastwrite.com/Images/separation.jpg" BORDER="0"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"> <A HREF="http://www.fastwrite.com/products/focus/fll/focusfll.cfm">focus.fll</A> </SPAN><IMG SRC="http://www.fastwrite.com/Images/separation.jpg" BORDER="0"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"> <A

Page 13: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsHREF="http://www.fastwrite.com/products/FOCUS/VCX/FOCUSVCX.CFM">focus.vcx</A> </SPAN><IMG SRC="http://www.fastwrite.com/Images/separation.jpg" BORDER="0"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"> <A HREF="http://www.fastwrite.com/whatsnew.cfm">News</A> </SPAN><IMG SRC="http://www.fastwrite.com/Images/separation.jpg" BORDER="0"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"> <A HREF="http://www.fastwrite.com/members">Members</A> </SPAN><IMG SRC="http://www.fastwrite.com/Images/separation.jpg" BORDER="0"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"> <A HREF="mailto:[email protected]">Contact Us</A> </SPAN><IMG SRC="http://www.fastwrite.com/Images/separation.jpg" BORDER="0"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"> <A HREF="http://www.fastwrite.com/search.cfm">Search</A> </SPAN><IMG SRC="http://www.fastwrite.com/Images/separation.jpg" BORDER="0"><SPAN STYLE="font-family: verdana;font-size: 8pt;position: relative;top: -6px"> </SPAN></DIV><!-- End of DIV MainMenu --></TD></TR><TR HEIGHT="600"><TD WIDTH="160" VALIGN="top" BGCOLOR="#A5A6D8"><DIV ID="NavMenu"><!-- NavMenu is MsgNo : 896 --><a href="" onClick="toggleStyle( 'Menu1' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu1"><span class="MenuItem">Products</span></a><br />

<span ID="Menu1"><font size="-2">&nbsp;</font><a

href="http://www.fastwrite.com/Products/Manage/Manage.cfm" onmouseover="return overlib('All software that we have built to manage domestic needs...',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">«I Manage...»</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/Focus/focus.cfm" onmouseover="return overlib('The Dynamic Link Library for Visual FoxPro developers. More than 1900 functions!',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">FOCUS</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/tailor" onmouseover="return overlib('All software that we have built for specific customers',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Custom Made</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/penguin" onmouseover="return overlib('Our Commercial Suite for mobile phones shops',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Penguin</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/freetools" onmouseover="return overlib('Free Utilities for everybody',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Free utilities</span></a><br />

</span> <!-- NavMenu : Choice 1 / products --><a href="" onClick="toggleStyle( 'Menu2' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu2"><span class="MenuItem">Services</span></a><br /><!-- Popup with overLIB

<a href="http://www.fastwrite.com/Products/Services.cfm" onmouseover="return overlib('<a

href=\'http://www.microsoft.com\'>Microsoft</a><br><a href=\'http://www.oracle.com\'>Oracle</a>',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White',STICKY);" onmouseout="return nd();">

<span class="MenuItem2">Introduction</span></a><br />-->

<span ID="Menu2"><font size="-2">&nbsp;</font><a

href="http://www.fastwrite.com/Products/Services.cfm" onmouseover="return overlib('Company Background, types of

services, ...',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Introduction</span></a><br />

Page 14: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions<font size="-2">&nbsp;</font><a

href="http://www.fastwrite.com/Products/training.cfm" onmouseover="return overlib('FastWrite organizes training for

developers',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Training</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/Hosting.cfm" onmouseover="return overlib('FastWrite offers basic web hosting services. We do not have tons of clients, and we want to keep it that way. But you can count on us to deliver a very customized range of services to you.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Web Hosting</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/WebCons.cfm"

onmouseover="return overlib('What we have done for our own web site ... we can do it for yours. Everything is programmed ... all the text is safely stored in a database and pages are built on demand. All the images and graphics you see on our site have been handcrafted by ourselves.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Web Development</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/WinDev.cfm"

onmouseover="return overlib('We cannot count the projects we have been into, both in Windows and in Unix. Simply put, our software runs in some of the largest pharmaceutical plants, and in the largest banks of the world. If we were good for them, we are surely good for the things we may have to do for you.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Win &amp; Unix</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/maintenance.cfm"><span class="MenuItem2">Hardware Maintenance</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Products/maintenance.cfm"><span class="MenuItem2">Software Maintenance</span></a><br /></span> <!-- NavMenu : Choice 2 / Services --><a href="" onClick="toggleStyle( 'Menu3' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu3"><span class="MenuItem">Tech Support</span></a><br /><span ID="Menu3">

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/TechSupp/Manage.cfm"

onmouseover="return overlib('Our collection of software for home: manage your CDs, your books, your video tapes, your budget, your invoices, your images, ....',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">I Manage</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/TechSupp/Focus.cfm"

onmouseover="return overlib('A library constructed in C with more than 1900 functions for the Visual FoxPro developer. This is the library that helped us constructing mission critical applications in VFP for the largest pharmaceutical plants, and for the largest banks of the world. This is the place to go for getting support on our library.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">FOCUS</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/TechSupp/hosting.cfm"

onmouseover="return overlib('Need support on our hosting services? This is the link to follow.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Hosting</span></a><br /></span> <!-- NavMenu : Choice 3 / Tech Support -->

Page 15: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions<a href="" onClick="toggleStyle( 'Menu4' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu4"><span class="MenuItem">Legal</span></a><br /><span ID="Menu4">

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Legal/ethic.cfm" onmouseover="return overlib('Browse through our ethic code: you will see what you can expect from us in terms of behavior and professional services.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Ethic Code</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Legal/cgv.cfm" onmouseover="return overlib('Read attentively our Sales Condition.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Sales Conditions</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Legal/privacy.cfm" onmouseover="return overlib('Curious about what we do with your personal data? Read our privacy statement.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Privacy Statement</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Legal/docs.cfm" onmouseover="return overlib('If you want to know who we are, what we do, our company, our statutes, etc. ... here you can download ALL our legal papers.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Legal documents</span></a><br /></span> <!-- NavMenu : Choice 4 / Legal --><a href="" onClick="toggleStyle( 'Menu5' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu5"><span class="MenuItem">Press Room</span></a><br /><span ID="Menu5">

<font size="-2">&nbsp;</font><span class="MenuItem2">Press Releases</span><br /><font size="-2">&nbsp;</font><a

href="http://www.fastwrite.com/whatsnew.cfm"><span class="MenuItem2">What's new?</span></a><br />

<font size="-2">&nbsp;</font><span class="MenuItem2">Newsletters</span><br /></span> <!-- NavMenu : Choice 5 / Press Room --><a href="" onClick="toggleStyle( 'Menu6' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu6"><span class="MenuItem">Job Opportunities</span></a><br /><span ID="Menu6">

<font size="-2">&nbsp;</font><span class="MenuItem2">Current Opportunities</span><br /></span> <!-- NavMenu : Choice 6 / Jobs --><!--<a href="" onClick="toggleStyle( 'Menu7' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu7"><span class="MenuItem">What's New?</span></a><br /><span ID="Menu7">

<font size="-2">&nbsp;</font><span class="MenuItem2">Browse</span><br /></span>--> <!-- NavMenu : Choice 7 / What's New? --><a href="" onClick="toggleStyle( 'Menu8' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu8"><span class="MenuItem">Links</span></a><br /><span ID="Menu8">

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/Links/AllLinks.cfm"><span class="MenuItem2">Browse</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/AddLink.cfm"><span class="MenuItem2">Add your link</span></a><br /></span> <!-- NavMenu : Choice 8 / Links -->

Page 16: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions<a href="" onClick="toggleStyle( 'Menu9' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu9"><span class="MenuItem">Developers Area</span></a><br /><span ID="Menu9">

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/DvlOnly/General" onmouseover="return overlib('Computer books review (Dr. Dobbs), Downloads, VFP resources, etc.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">General</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/DvlOnly/VFP" onmouseover="return overlib('Articles for VFP developers, Download section, Tutorial about FOCUS.FLL, Tutorial about FOCUS.VCX.',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Visual FoxPro</span></a><br />

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/DvlOnly/general/downloadsonly.cfm" onmouseover="return overlib('Resources to download from FastWrite\'s web site',FGCOLOR,'#A5A6D8',BGCOLOR,'White',TEXTCOLOR,'White');" onmouseout="return nd();"><span class="MenuItem2">Downloads</span></a><br /></span> <!-- NavMenu : Choice 9 / DevOnly --><a href="" onClick="toggleStyle( 'Menu10' ); return false;"><IMG SRC="http://www.fastwrite.com/Images/BranchesClose2.jpg" BORDER="0" NAME="imgMenu10"><span class="MenuItem">About us</span></a><br /><span ID="Menu10">

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/AboutUs/Belgium.cfm"><span class="MenuItem2">Belgium</span></a><br /><!---

<font size="-2">&nbsp;</font><a href="http://www.fastwrite.com/AboutUs/Thailand.cfm"><span class="MenuItem2">Thailand</span></a><br />---></span> <!-- NavMenu : Choice 10 / About Us --><!-- Page inclusion in AfterNavMenu : http://www.fastwrite.com/NewsInBrief.cfm?Type=Public -->

<BR>

<BR>

<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#8975B2"><TR><TD><TABLE border="0" cellpadding="1" cellspacing="0"><TR><TD WIDTH="14" NOWRAP BGCOLOR="#8975B2" HEIGHT="20"><font size=0>&nbsp;<br></font></TD><TD WIDTH="144" NOWRAP BGCOLOR="#FFFFFF">

<FONT FACE="Arial, geneva, helvetica" SIZE="-2" color="#8975B2">&nbsp;

<A HREF="HTTP://WWW.FASTWRITE.COM/SENDFILE.CFM?file=F:/PROTECTEDRESOURCES/FASTWRITEWEB/EXTRANET/PUBLIC/FOCUS803S.ZIP" onclick="return true;">FOCUS 8.03</A>

<br></FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;<BR></DIV><!-- End of DIV NavMenu --></TD><TD VALIGN="top" BGCOLOR="#9A97C7" BACKGROUND=""><DIV ID="Body"><!-- Body is MsgNo : 37 --><script type="text/javascript" src="http://www.fastwrite.com/scripts/snow.js"></script>

<p class="SubTitle0">Welcome</p>

<table WIDTH="100%" BORDER="0"><TR>

<TD><p class="descExpanded"><br /><IMG SRC="http://www.fastwrite.com/Images/FromOurOffice.jpg"

ALIGN="Left"><p class="descExpanded">

Page 17: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsHappy New Year Everyone! Hope you and your loved ones had a safe and wonderful New Year.<br /><br />

We have promised to release the sources of <span class="File">FOCUS.FLL</span> before New Year. Unfortunately, we are still busy making modifications to the sources of <span class="File">FOCUS.FLL</span>, <strong>version 8.04</strong>! Therefore, we kindly ask you to wait a little bit. Thank you.</p></p><!---<div align="center"><IMG SRC="http://www.fastwrite.com/Images/focus_ad.gif" ALIGN="center"></div>--->

</TD></TR>

</table>

<!--- FOCUS.FLL 8.04 ---><p class="subTitle0">FOCUS 8.04</p><p class="descExpanded">Version 8.04 of <span class="File">FOCUS.FLL</span> is in preparation. We plan to deliver new compression functions (that would permit to compress multiple files at once), new printer functions that would provide a lot more details on the jobs submitted to a specific printer, and resume our work about the communication functions (<span class="SrcCode">COM_*()</span>).<br /><br />

Some other functions related to the NT File System will appear also. For example the ability to create a logical link to a file and refer to that link later on (similar to UNIX): it makes it a lot easier to "share" files between instances of your applications. Well ... and more. Stay tuned.<br /><br /></p>

<!--- FOCUS.FLL 8.03 ---><p class="subTitle0">FOCUS 8.03</p>

<p class="descExpanded"><b><span class="File">FOCUS.FLL</span> 8.03</b> is available. It contains a number of bug fixes as well as about 12 new functions.<br /><br />

<p class="subTitle1">What's new?</p>

<p class="descExpanded">1. <span class= "SrcCode">LOG_Append()</span>: internal bug fixed when strategy set to "Reduce to Half Size".<br /><br />2. <span class= "SrcCode">EnumWindows()</span>: this was an internal alias of <span class= "SrcCode">WIN_EnumChildren()</span>. This is no longer the case as it became the alias of <span class= "SrcCode">WIN_EnumWindows()</span>. Potential code impact.<br /><br />3. <span class= "SrcCode">GetWindows()</span>: this was an internal alias of <span class= "SrcCode">WIN_GetChildren()</span>. This is no longer the case as it became the alias of <span class= "SrcCode">WIN_GetWindows()</span>. Potential code impact.<br /><br />4. <span class= "SrcCode">WIN_EnumWindows()</span>: new function. No code impact. Initiates the retrieval of a list of top-level windows of Windows.<br /><br />5. <span class= "SrcCode">WIN_GetWindows()</span>: new function. No code impact. Completes the retrieval of the list of the top-level windows started via <span class= "SrcCode">WIN_EnumWindows()</span>.<br /><br />6. <span class= "SrcCode">WIN_BringWindowToTop()</span>: new function. No code impact. Was kept internal to <span class= "File">FOCUS.FLL</span>. We have finally decided to document it.<br /><br />7. <span class= "SrcCode">SYS_GlobalMemoryStatus()</span>: bug fix. The size returned by the function couldn't fit large memories (as much as 1 Gb, or even more) as we find in the computers nowadays. The visible effect was that the number returned by the function was a negative number. This has been corrected to return a positive number instead. Potential code impact.<br /><br />8. <span class= "SrcCode">SYS_ExitProcess()</span>: new function. Makes it possible to return an error level to the calling application or command file. No code impact.<br /><br />

Page 18: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions9. <span class= "SrcCode">TIM_MakeTime()</span>: Correction of a vicious bug that happened when the function was called at a moment when the local time expression was laying into another day than the GMT time (for example GMT is 23PM and local time is 01AM). Potential code impact.<br /><br />10. <span class= "SrcCode">ARR_average()</span>: Correction of a bug with one-dimensional arrays. Potential code impact.<br /><br />11. <span class= "SrcCode">MET_FeetToMeters()</span>: a metric function to convert feet to meters. New function. No code impact.<br /><br />12. <span class= "SrcCode">MET_MetersToFeet()</span>: a metric function to convert meters to feet. New function. No code impact.<br /><br />13. <span class= "SrcCode">NUM_gcd()</span>: Euclid's implementation of the greatest common divisor of two integers. New function. No code impact.<br /><br />14. <span class= "SrcCode">NUM_UniversalID()</span>: creates a globally unique identifier of 66 bytes maximum. Use this function when you need an absolutely unique number that you will use as a persistent identifier in a distributed environment. To a very high degree of certainty, this function returns a unique value - no other invocation, on the same or any other system (networked or not), should return the same value. The algorithm that is followed assures that the ID is unique in space and unique in time.<br /><br />15. The Test Status grid of each function has been removed from the documentation.<br /><br />16. <strong>All Font functions are gone</strong> (<span class= "SrcCode">FNT_*()</span>) as we announced in 2002.<br /><br />17. <strong>All User functions are gone</strong> (<span class= "SrcCode">USR_*()</span>) as we announced in 2002.<br /><br /></p>

<p class="subTitle1">Registered Users</p><p class="descExpanded">Version 8.03 is available for download from the Members section: simply prepare your login information ... <a href="http://www.fastwrite.com/members/members.cfm">Go to login screen</a></p>

<!--- Named Streams in Visual FoxPro ---><p class="subTitle0">Efficient Data Hiding in VFP</p>

<p class="descExpanded">For sure you came across the need to maintain some data hidden from your users, either because you really want to protected them against messing up with your appication, or simply because you keep some keys secret.<br /><br />

Sounds familiar? You bet! What we do usually is to encrypt the contents of the file, hide it in a place known by us, and access this file whenever we have to.<br /><br />

Well ... <strong>on NTFS drives</strong> ... there is a better alternative: &quot;Named Streams&quot;<br /><br />

We confess that this possibility has been around from some time, but it has been downplayed by Microsoft. This is unfortunate because streams can be incredibly useful in many situations. And streams are easy to use!<br /><br />

As a first attempt, let's create a stream in a command shell (you'll see how easy it is):</p>

<pre class="SrcCode">D:\>echo "Hello FOCUS" &gt; MYFILE.TXT:MYSTREAM

D:\>dir *.txt Volume in drive D is CONSTELLATION_D Volume Serial Number is E44E-4E1A

Directory of D:\

12/01/2003 15:55 0 MYFILE.TXT 1 File(s) 0 bytes

Page 19: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions 0 Dir(s) 10.097.905.664 bytes free</pre>

<p class="descExpanded">What one can immediately see is that the file is reported having a size of 0 bytes! Amazing, isn't it?<br /><br />

Now ... try to see what's in the file:</p>

<pre class="SrcCode">D:\>MORE &lt; MYFILE.TXT</pre>

<p class="descExpanded">Nothing is reported!</p>

<pre class="SrcCode">D:\>MORE &lt; MYFILE.TXT:MYSTREAM"Hello FOCUS"</pre>

<p class="descExpanded">The first attempt with <span class="SrcCode">MORE &lt; MYFILE.TXT</span> didn't render what was stored in the file. However, the second attempt, <span class="SrcCode">MORE &lt; MYFILE.TXT:MYSTREAM</span>, did! Woaw!<br /><br />

Is there any way to do this in a programmatic way? <b>YES</b>! ... with <span class="File">FOCUS.FLL</span>! Try the following code ... it will just do the same:</p>

<pre class="SrcCode">#define WIN32API_STRATEGY 1#define GENERIC_READ 0x80000000#define GENERIC_WRITE 0x40000000

LOCAL nHandle

SET LIBRARY TO FOCUS.FLL

FIL_SetOpenStrategy( WIN32API_STRATEGY )m.nHandle = FIL_create( "D:\MYFILE.TXT:MYSTREAM",GENERIC_READ+GENERIC_WRITE )FIL_write( m.nHandle,["Hello FOCUS"] )FIL_close( m.nHandle )</pre>

<p class="descExpanded">Even the Explorer will report a length of 0 bytes!<br /><br />

I think that you have the idea, now. Simply use the powerful File functions of <span class="File">FOCUS.FLL</span> to play with NTFS to its fullest potential.<br /><br />

For those of you that want to know more about Data Streams, they can follow this link:<a href ="http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/winxppro/reskit/prkc_fil_xurt.asp">Microsoft</a></p></DIV><!-- End of DIV Body --></TD></TR><DIV ID="FWPageFooter"><TR><TD WIDTH="160" VALIGN="top" BGCOLOR="#A5A6D8">&nbsp;</TD><TD><TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD HEIGHT="3"></TD></TR><TR><TD BACKGROUND="http://www.fastwrite.com/Images/Orange.png"></TD></TR><TR><TD ALIGN="RIGHT" BGCOLOR="#9A97C7" HEIGHT="17" VALIGN="middle"><P CLASS="Normal"><A HREF="http://www.fastwrite.com"><IMG SRC="http://www.fastwrite.com/Images/LittleFW2.jpg" BORDER="0" ALT="Design by FastWrite" WIDTH="77" HEIGHT="21" ALIGN="LEFT"></A><IMG SRC="http://www.fastwrite.com/Images/frv.png" BORDER="0" ALT="Not yet active" WIDTH="21" HEIGHT="21" ALIGN="LEFT"><IMG SRC="http://www.fastwrite.com/Images/nlv.png" BORDER="0" ALT="Not yet active" WIDTH="21" HEIGHT="21" ALIGN="LEFT"><IMG SRC="http://www.fastwrite.com/Images/env.png" BORDER="0" ALT="Not yet active" WIDTH="21" HEIGHT="21" ALIGN="LEFT"><IMG SRC="http://www.fastwrite.com/Images/dev.png" BORDER="0" ALT="Not yet active" WIDTH="21" HEIGHT="21" ALIGN="LEFT"><A HREF="http://www.fastwrite.com"><font face="verdana" size="-2">Home</font></A> - <A HREF="http://www.fastwrite.com/comments.cfm"><font face="verdana"

Page 20: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functionssize="-2">Comments</font></A> - <A HREF="http://www.fastwrite.com/Legal/Legal.cfm"><font face="verdana" size="-2">Copyright © 2000 - All Rights Reserved.</font></A>&nbsp;&nbsp;<A HREF="mailto:[email protected]"><IMG SRC="http://www.fastwrite.com/Images/envelope.gif" BORDER="0" ALT="Quick touch with us"></A></P></TD></TR><TR><TD BACKGROUND="http://www.fastwrite.com/Images/Orange.png"></TD></TD></TR></DIV></TABLE><!-- Generation End: {ts '2003-02-01 18:44:36'} --></BODY></HTML>

See AlsoHTTP_GetURL()., HTTP_PostURL()

HTTP_InternetDial() : Initiates a connection to the Internet using a modem.

SyntaxHTTP_InternetDial( szDialUp ) lSuccess

ParametersszDialUp dial-up connection to use.

ReturnslSuccess .T. if the connection has been made; .F. if not.

Example

IF ( HTTP_InternetDial( "Yucom" ) ) szHome = HTTP_GetURL( "http://www.oracle.com" )ENDIF

HTTP_IsURL() : Returns status information about a URL.

RemarksThe HTTP_IsURL() function makes it possible to determine almost any kind of information available about a resource. Not only can you determine whether a resource is available but you can also determine the resource type, or the resource length (if available). For example, by querying a resource with the HTTP_QUERY_STATUS_CODE, you can determine whether the resource is available (200 ... OK). Querying the same resource with HTTP_QUERY_CONTENT_TYPE permits to be sure that the specified resource is of the desired type (a jpeg image for

Page 21: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functionsexample). Then querying the content length thanks to HTTP_QUERY_CONTENT_LENGTH will inform you about the size of the image!

SyntaxHTTP_IsURL( szDomain,szPath[,nType] ) szStatus

ParametersszDomain the base host name (use HTTP_CrackURL() to split a URL into a domain and a path).szPath the path (use HTTP_CrackURL() to split a URL into a domain and a path).nType optional parameter. The type of information to query.

HTTP 1.0 defined headers#define HTTP_QUERY_MIME_VERSION 0#define HTTP_QUERY_CONTENT_TYPE 1#define HTTP_QUERY_CONTENT_TRANSFER_ENCODING 2#define HTTP_QUERY_CONTENT_ID 3#define HTTP_QUERY_CONTENT_DESCRIPTION 4#define HTTP_QUERY_CONTENT_LENGTH 5#define HTTP_QUERY_CONTENT_LANGUAGE 6#define HTTP_QUERY_ALLOW 7#define HTTP_QUERY_PUBLIC 8#define HTTP_QUERY_DATE 9#define HTTP_QUERY_EXPIRES 10#define HTTP_QUERY_LAST_MODIFIED 11#define HTTP_QUERY_MESSAGE_ID 12#define HTTP_QUERY_URI 13#define HTTP_QUERY_DERIVED_FROM 14#define HTTP_QUERY_COST 15#define HTTP_QUERY_LINK 16#define HTTP_QUERY_PRAGMA 17#define HTTP_QUERY_VERSION 18#define HTTP_QUERY_STATUS_CODE 19#define HTTP_QUERY_STATUS_TEXT 20#define HTTP_QUERY_RAW_HEADERS 21#define HTTP_QUERY_RAW_HEADERS_CRLF 22#define HTTP_QUERY_CONNECTION 23#define HTTP_QUERY_ACCEPT 24#define HTTP_QUERY_ACCEPT_CHARSET 25#define HTTP_QUERY_ACCEPT_ENCODING 26#define HTTP_QUERY_ACCEPT_LANGUAGE 27#define HTTP_QUERY_AUTHORIZATION 28#define HTTP_QUERY_CONTENT_ENCODING 29#define HTTP_QUERY_FORWARDED 30#define HTTP_QUERY_FROM 31#define HTTP_QUERY_IF_MODIFIED_SINCE 32#define HTTP_QUERY_LOCATION 33#define HTTP_QUERY_ORIG_URI 34#define HTTP_QUERY_REFERER 35#define HTTP_QUERY_RETRY_AFTER 36#define HTTP_QUERY_SERVER 37#define HTTP_QUERY_TITLE 38#define HTTP_QUERY_USER_AGENT 39#define HTTP_QUERY_WWW_AUTHENTICATE 40#define HTTP_QUERY_PROXY_AUTHENTICATE 41#define HTTP_QUERY_ACCEPT_RANGES 42#define HTTP_QUERY_SET_COOKIE 43#define HTTP_QUERY_COOKIE 44#define HTTP_QUERY_REQUEST_METHOD 45#define HTTP_QUERY_REFRESH 46#define HTTP_QUERY_CONTENT_DISPOSITION 47

HTTP 1.1 defined headers#define HTTP_QUERY_AGE 48#define HTTP_QUERY_CACHE_CONTROL 49#define HTTP_QUERY_CONTENT_BASE 50#define HTTP_QUERY_CONTENT_LOCATION 51#define HTTP_QUERY_CONTENT_MD5 52#define HTTP_QUERY_CONTENT_RANGE 53#define HTTP_QUERY_ETAG 54#define HTTP_QUERY_HOST 55#define HTTP_QUERY_IF_MATCH 56#define HTTP_QUERY_IF_NONE_MATCH 57#define HTTP_QUERY_IF_RANGE 58#define HTTP_QUERY_IF_UNMODIFIED_SINCE 59

Page 22: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP Functions#define HTTP_QUERY_MAX_FORWARDS 60#define HTTP_QUERY_PROXY_AUTHORIZATION 61#define HTTP_QUERY_RANGE 62#define HTTP_QUERY_TRANSFER_ENCODING 63#define HTTP_QUERY_UPGRADE 64#define HTTP_QUERY_VARY 65#define HTTP_QUERY_VIA 66#define HTTP_QUERY_WARNING 67

The following list contains the values and corresponding constants for the HTTP status codes returned by servers on the Internet

HTTP Status CodesConstant Value DescriptionHTTP_STATUS_OK 200 The request completed successfully.HTTP_STATUS_CREATED 201 The request has been fulfilled and resulted in the

creation of a new resource.HTTP_STATUS_ACCEPTED 202 The request has been accepted for processing ,

but the processing has not been completed.HTTP_STATUS_PARTIAL 203 The returned meta information in the entity-

header is not the definitive set available from the origin server.

HTTP_STATUS_NO_CONTENT 204 The server has fulfilled the request, but there is no new information to send back.

HTTP_STATUS_RESET_CONTENT 205 The request has been completed, and the client program should reset the document view that caused the request to be sent to allow the user to easily initiate another input action.

HTTP_STATUS_PARTIAL_CONTENT 206 The server has fulfilled the partial GET request for the resource.

HTTP_STATUS_AMBIGUOUS 300 The server couldn't decide what to return.HTTP_STATUS_MOVED 301 The requested resource has been assigned to a

new permanent URI, and any future references to this resource should be done using one of the returned URIs.

HTTP_STATUS_REDIRECT 302 The requested resource resides temporarily under a different URI.

HTTP_STATUS_REDIRECT_METHOD 303 The response to the request can be found under a different URI and should be retrieved using a GET method on that resource.

HTTP_STATUS_NOT_MODIFIED 304 The requested resource has not been modified.HTTP_STATUS_USE_PROXY 305 The requested resource must be accessed

through the proxy given by the location field. HTTP_STATUS_REDIRECT_KEEP_VERB 307 The redirected request keeps the same verb.

HTTP/1.1 behavior. HTTP_STATUS_BAD_REQUEST 400 The request could not be processed by the server

due to invalid syntax.HTTP_STATUS_DENIED 401 The requested resource requires user

authentication.HTTP_STATUS_PAYMENT_REQ 402 Not currently implemented in the HTTP protocol.HTTP_STATUS_FORBIDDEN 403 The server understood the request, but is

refusing to fulfill it.HTTP_STATUS_NOT_FOUND 404 The server has not found anything matching the

requested URI.HTTP_STATUS_BAD_METHOD 405 The method used is not allowed.HTTP_STATUS_NONE_ACCEPTABLE 406 No responses acceptable to the client were

found.HTTP_STATUS_PROXY_AUTH_REQ 407 Proxy authentication required.HTTP_STATUS_REQUEST_TIMEOUT 408 The server timed out waiting for the request.HTTP_STATUS_CONFLICT 409 The request could not be completed due to a

conflict with the current state of the resource. The user should resubmit with more information.

HTTP_STATUS_GONE 410 The requested resource is no longer available at the server, and no forwarding address is known.

HTTP_STATUS_LENGTH_REQUIRED 411 The server refuses to accept the request without a defined content length.

HTTP_STATUS_PRECOND_FAILED 412 The precondition given in one or more of the request header fields evaluted to false when it was tested on the server.

HTTP_STATUS_REQUEST_TOO_LARGE 413 The server is refusing to process a request because the request entity is larger than the server is willing or able to process.

HTTP_STATUS_URI_TOO_LONG 414 The server is refusing to service the request because the request URI is longer than the server is willing to interpret.

Page 23: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsHTTP_STATUS_UNSUPPORTED_MEDIA 415 The server is refusing to service the request

because the entity of the request is in a format not supported by the requested resource for the requested method.

HTTP_STATUS_SERVER_ERROR 500 The server encountered an unexpected condition that prevented it from fulfilling the request.

HTTP_STATUS_NOT_SUPPORTED 501 The server does not support the functionality required to fulfill the request.

HTTP_STATUS_BAD_GATEWAY 502 The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.

HTTP_STATUS_SERVICE_UNAVAIL 503 The service is temporarily overloaded.HTTP_STATUS_GATEWAY_TIMEOUT 504 The request was timed out waiting for a gateway.HTTP_STATUS_VERSION_NOT_SUP 505 The server does not support, or refuses to

support, the HTTP protocol version that was used in the request message.

ReturnsszStatus request status.

Example

HTTP_LastError() : Last error encountered in HTTP functions.

SyntaxHTTP_LastError() szLastError

ParametersNone.

ReturnsszLastError last error that occurred while using the HTTP_*() functions.

ExampleIF ( EMPTY( HTTP_GetURL( "http://www.fastwrite.com" ) ) ) ? "Cannot open FastWrite home page.",HTTP_LastError()ENDIF

HTTP_LastGetURLTime() : Returns the time the last HTTP_GetURL() operation in milliseconds.

SyntaxHTTP_LastGetURLTime() nMilliseconds

ParametersNone.

ReturnsnMilliSeconds time of the last HTTP_GetURL() in milliseconds.

Example* This example attempts to retrieve homepages for Oracle, Sybase and Microsoft* Then ... based on the number of bytes sent over and the time taken for the* operation to complete, it establishes the transfer rate:

szOracle = HTTP_GetURL("http://www.oracle.com" )nOracle = HTTP_LastGetURLTime()

Page 24: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsszSybase = HTTP_GetURL("http://www.sybase.com" )nSybase = HTTP_LastGetURLTime()

szMS = HTTP_GetURL("http://www.microsoft.com" )nMS = HTTP_LastGetURLTime()

? LEN( szOracle ) / ( nOracle/1000 ),"bytes per second"? LEN( szSybase ) / ( nSybase/1000 ),"bytes per second"? LEN( szMS ) / ( nMS/1000 ),"bytes per second"

HTTP_LastVersion() : Returns the file stamp of HTTP functions.

RemarkThis function helps the developer identifying the last version of a set of functions. Sometimes the global version information of FOCUS.FLL (MIS_major() and MIS_minor()) does not help tracking down the changes in a project. Starting with version 6.0 of FOCUS.FLL, each source file has now an internal date and time stamp.

SyntaxHTTP_LastVersion() szLastVersion

ParametersNone.

ReturnsszLastVersion string identifying the last version of the functions set.

HTTP_PostURL() : Gets URL and posts information.

SyntaxHTTP_PostURL( szURL,szPost ) szStream

ParametersszURL the URL to access.szPost the post block to pass in the HTTP request.

ReturnsszStream Internet stream.

ExampleLOCAL szUserNameLOCAL szPasswordLOCAL szPost

m.szUserName = "Jean Desmet"m.szPassword = "trnhgtyw"

&& The POST request has to be formatted as if the parameters&& were passed as part of the URL. Parameters are separated&& by an ampersand (&)m.szPost = "user=" + m.szUserName + "&"; "pwd=" + m.szPassword

szHTML = HTTP_PostURL( "http://www.site.com/Login.cfm",m.szPost )

&& What's in szHTML now is the response of the server

Page 25: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsSee AlsoHTTP_GetURL().

HTTP_SetCallback() : Gets/Sets a callback function for the HTTP_GetURL*() functions.

SyntaxHTTP_SetCallback( [szFunc] ) szCurFunc

ParametersszFunc the new callback function. This function should return a logical value, .T. or .F.. If it returns

.F., the current download initiated by HTTP_GetURL() or HTTP_GetURL2() is aborted.

ReturnsszCurFunc the current callback function.

ExampleLOCAL szCallback

szCallback = HTTP_SetCallback( "HTTPCallback()" )

<... here you would have code that calls the HTTP_GetURL() function >

&& When done, we reset the callback to what it wasHTTP_SetCallback( szCallback )

FUNCTION HTTPCallback() LOCAL lRetVal

&& Check if F12 was pressed. In that case, abort the && current download started by HTTP_GetURL() m.lRetVal = ( INKEY("H") != 134 ) && F12 ?

RETURN ( m.lRetVal )

HTTP_SetURLTimeout() : Gets/Sets the timeout value used in HTTP functions.

SyntaxHTTP_SetURLTimeout( [nMilliSeconds] ) nCurMilliSeconds

ParametersnMilliSeconds the new timeout in milliseconds. This parameter is optional.

ReturnsnCurMilliSeconds the current setting in milliseconds.

ExampleLOCAL nMilliLOCAL szHTML

m.nMilli = HTTP_SetURLTimeout( 30000 ) && Save the old settingm.szHTML = HTTP_GetURL( "http://www.fastwrite.com" )

IF ( EMPTY( m.szHTML ) ) ? "The server is not responding"

Page 26: 21 HTML HTTP Functionsportal.dfpug.de/dFPUG/Dokumente/Partner/Focus/21 HTML... · Web viewThis string uses the  tag to format italic text and the " sequence to display

HTML/HTTP FunctionsENDIF

HTTP_SetURLTimeout( m.nMilli ) && Restore the old setting