float n
'INT i at strptr s ' integer pointer cast string s
n = 3.14
sys *p = @n
float f2 = (float)p
print f2
' what does it mean this command "compile" ? = o2_basic(s) ?
extern lib "oxygen.dll"
declare function o2_basic(byref s as asciiz) as long
declare function o2_exec (byval p as long) as long
declare function o2_errno() as long
declare function o2_error() as asciiz ptr
end extern
'
dim qu as string
dim cr as string
dim src as string
qu=chr(34)
cr=chr(13)+chr(10)
src="print " + qu+"Hello Oxygen"+qu+cr
print src
'
o2_basic(src)
'
if o2_errno()<>0
print o2_error()
else
o2_exec(0)
end if
end
' what is uncompile ?
'--------------------------------------------------------------------------
function evaluate (s as string, byval b as long, byval e as long) as string
'==========================================================================
'
double x,y,z
long a,i,p=1
string v,u,tab,cr,er as string
'
cr=chr(13) chr(10) : tab=chr 9
v=nuls 4000
mid v,p,s+cr+cr
p+=4+len s
'
a=compile s ' what is compile ?'
'a=o2_basic s ' what is compile ?
'o2_basic
er=error
if er then print `runtime error: ` er : uncompile a : exit function
for i=b to e
x=i
call a
u=str(x) tab str(y) cr
mid v,p,u : p+=len u
next
'
function=left v,p-1
'uncompile a
end function
print evaluate `y=x*x*x`,1,10
print evaluate `y=sqrt x`,1,9
extern lib "wininet.dll"
! InternetOpenA
! InternetOpenUrlA
! InternetCloseHandle
! InternetReadFile
end extern
string buf=nuls 0x20000 '128k
string tbuf
'string url="http://forum.it-berater.org/index.php"
string url="https://forum.it-berater.org/index.php"
int cbytes
sys hInternet
sys hFile
int c
hInternet = InternetOpenA( "o2demo",0,0,0,0 )
hFile = InternetOpenUrlA( hInternet,url,0,0,0,0 )
do
cbytes=0
InternetReadFile( hFile,buf,len(buf),@cbytes )
if cbytes
tbuf+=left(buf,cbytes)
c++
else
exit do
endif
loop
InternetCloseHandle( hFile )
InternetCloseHandle( hInternet )
'print tbuf
putfile( "t.txt",tbuf )
'print c 'count loops
NOTES:
======
'https://docs.microsoft.com/en-us/windows/win32/api/wininet/nf-wininet-internetopena
'https://docs.microsoft.com/en-us/cpp/mfc/wininet-basics?view=vs-2019#_core_create_a_very_simple_browser
/*
% INTERNET_OPEN_TYPE_DIRECT 1
% INTERNET_FLAG_ASYNC 0x10000000
*/
/*
extern lib "wininet.dll"
sys InternetOpenA(
LPCSTR lpszAgent,
DWORD dwAccessType,
LPCSTR lpszProxy,
LPCSTR lpszProxyBypass,
DWORD dwFlags
);
BOOLAPI InternetCloseHandle(
HINTERNET hInternet
);
BOOLAPI InternetCanonicalizeUrlA(
LPCSTR lpszUrl,
LPSTR lpszBuffer,
LPDWORD lpdwBufferLength,
DWORD dwFlags
);
sys InternetOpenUrlA(
HINTERNET hInternet,
LPCSTR lpszUrl,
LPCSTR lpszHeaders,
DWORD dwHeadersLength,
DWORD dwFlags,
DWORD_PTR dwContext
);
BOOLAPI InternetReadFile(
HINTERNET hFile,
LPVOID lpBuffer,
DWORD dwNumberOfBytesToRead,
LPDWORD lpdwNumberOfBytesRead
);
BOOLAPI InternetFindNextFileA(
HINTERNET hFind,
LPVOID lpvFindData
);
*/
'#include <afxinet.h>
/*
void DisplayPage(LPCTSTR pszURL)
{
CInternetSession session(_T("My Session"));
CStdioFile* pFile = NULL;
CHAR szBuff[1024];
//use a URL and print a Web page to the console
pFile = session.OpenURL(pszURL);
while (pFile->Read(szBuff, 1024) > 0)
{
printf_s("%1023s", szBuff);
}
delete pFile;
session.Close();
}
*/
Page created in 0.137 seconds with 14 queries.