topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
Automated Outlook e-mail and sending plain text
|
Dear Rick,
oMailItem:HtmlBody = cHTML
Use "<br>" instead of Chr( 10 )
and remember to use the typical HTML structure:
<html>
<head>
</head>
<body>
Your text goes here
</body>
</html>
You can use tables, colors, etc.
|
Automated Outlook e-mail and sending plain text
|
Antonio
Thank you .. would you mind giving me a quick example of the plain text conversion ??
Rick Lipkin
|
Automated Outlook e-mail and sending plain text
|
Rick,
not sure if this is what you mean
[code=fw:2xvt4pdg]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> cHTML<br /><br /><span style="color: #0000ff;">TEXT</span> INTO cHTML<br /> <html><br /> <head><br /> </head><br /> <body><br /> Your <span style="color: #0000ff;">text</span> goes here<br /> </body><br /> </html><br />ENDTEXT<br /><br />oMailItem:<span style="color: #000000;">HtmlBody</span> = cHTML<br /> </div>[/code:2xvt4pdg]
|
Automated download of pictures
|
Hello,
I need to download pic's from a site. I don't have access to ftp, so I will loop all the pics into a browsers and need to hit CTRL-S + ENTER to download the pic.
since it will be lots of img. the window needs to close afther download, and the proces should go further.
In this sample, the loop will show the images, but I can't get the download the work automatic.
I don't know how I can execute a keyboard buffer when it is in the window of the picture.
Any Idea ?
[code=fw:11o6hopk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Hbgtinfo.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oImage, oBar<br /> <span style="color: #00C800;">local</span> aPics := <span style="color: #000000;">{</span> <span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span> <span style="color: #000000;">}</span><br /><br /> aPics<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> = <span style="color: #ff0000;">"https://upload.wikimedia.org/wikipedia/commons/c/c8/Taj_Mahal_in_March_2004.jpg"</span><br /> aPics<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> = <span style="color: #ff0000;">"http://cdn.history.com/sites/2/2015/04/hith-eiffel-tower-iStock_000016468972Large.jpg"</span><br /> aPics<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> = <span style="color: #ff0000;">"https://cdn.sportdirect.com/resizer/500x500/108104-8200-01.jpg"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FWH : XIMAGE"</span><br /><br /> website <span style="color: #000000;">(</span>aPics<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> website<span style="color: #000000;">(</span>aPics<span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//DEFINE CLIPBOARD oWinfax</span><br /> <span style="color: #B900B9;">//oWinfax:SetText( "Test" )</span><br /> <span style="color: #B900B9;">//oWinfax:SetText( VK_CONTROL+ASC("S")+VK_RETURN ) // CTRL + S and RETURN</span><br /> <span style="color: #B900B9;">//oWinfax:SetText( VK_CONTROL+VK_RETURN ) // CTRL + S and RETURN</span><br /><br /> <span style="color: #B900B9;">//HB_GTINFO( HB_GTI_CLIPBOARDDATA, "Hello!" )</span><br /><br /> HB_GTINFO<span style="color: #000000;">(</span> HB_GTI_CLIPBOARDDATA, VK_CONTROL+<span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span><span style="color: #ff0000;">'S'</span><span style="color: #000000;">)</span>+VK_RETURN <span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #00C800;">for</span> i = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span>aPics<span style="color: #000000;">)</span><br /><br /> cLink = <span style="color: #ff0000;">"c:<span style="color: #000000;">\p</span>rogram files<span style="color: #000000;">\g</span>oogle<span style="color: #000000;">\c</span>hrome<span style="color: #000000;">\a</span>pplication<span style="color: #000000;">\c</span>hrome.exe "</span>+aPics<span style="color: #000000;">[</span>I<span style="color: #000000;">]</span><br /><br /> <span style="color: #B900B9;">//WaitRun( cLink ) // Program stops until end</span><br /><br /> WaitRun<span style="color: #000000;">(</span> cLink, .T. <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Program stops until end</span><br /><br /> <span style="color: #B900B9;">//WaitRun( cLink, 0 )</span><br /><br /><br /> <span style="color: #B900B9;">//__Keyboard(VK_CONTROL+ASC('S')+VK_RETURN)</span><br /> <span style="color: #B900B9;">//__Keyboard(chr(VK_CONTROL)+"S"+chr(VK_RETURN))</span><br /> <span style="color: #B900B9;">//__keyboard()</span><br /><br /> <span style="color: #B900B9;">//__Keyboard(chr(VK_CONTROL)+"V")</span><br /><br /><br /> <span style="color: #B900B9;">//ShellExecute( 0, "open", oWinfax )</span><br /> <span style="color: #B900B9;">//ShellExecute( 0, "open", HB_GTINFO( HB_GTI_CLIPBOARDDATA, VK_CONTROL+ASC('S')+VK_RETURN ) )</span><br /><br /> <span style="color: #B900B9;">//WaitRun( cLink, "READING FORUM PAGE", { || downloadpic() } )</span><br /> <span style="color: #B900B9;">//WaitRun( cLink, "READING FORUM PAGE", { || downloadpic() } )</span><br /><br /> <span style="color: #B900B9;">//msgrun ( cLink )</span><br /> <span style="color: #B900B9;">//MsgRun( cLink, "READING FORUM PAGE", { || downloadpic() } )</span><br /><br /> <span style="color: #B900B9;">//syswait(5)</span><br /><br /><br /> <span style="color: #00C800;">next</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /><br /><br /> <br /> </div>[/code:11o6hopk]
|
Automated download of pictures
|
This is what I'm using to download a file from a http url:
[code=fw:2mo98fc0]<div class="fw" id="{CB}" style="font-family: monospace;">#command <span style="color: #00C800;">IF</span> <condition> THEN <*statements*> => <span style="color: #00C800;">if</span> <condition> ; <statements> ; end<br /><br /><br /><span style="color: #00C800;">FUNCTION</span> GETURLTOFILE<span style="color: #000000;">(</span> cUrl, cFile, lAuth <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> lOk := .F.<br /><br /> <span style="color: #00C800;">LOCAL</span> oCli<br /><br /> <span style="color: #00C800;">DEFAULT</span> lAuth := .F.<br /><br /> <span style="color: #00C800;">TRY</span><br /> oCli = TIPClientHttp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cUrl <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> lAuth THEN oCli:<span style="color: #000000;">UseBasicAuth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span> oCli <span style="color: #000000;">)</span> THEN <span style="color: #00C800;">BREAK</span><br /><br /> oCli:<span style="color: #000000;">nConnTimeout</span> = <span style="color: #000000;">-1</span><br /><br /> <span style="color: #00C800;">IF</span> !oCli:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> THEN <span style="color: #00C800;">BREAK</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> cFile := oCli:<span style="color: #000000;">oUrl</span>:<span style="color: #000000;">cFile</span><br /><br /> <span style="color: #00C800;">IF</span> !oCli:<span style="color: #000000;">ReadToFile</span><span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> THEN <span style="color: #00C800;">BREAK</span><br /><br /> lOk = !EMPTY<span style="color: #000000;">(</span> oCli:<span style="color: #000000;">cReply</span> <span style="color: #000000;">)</span> .AND. <span style="color: #ff0000;">"OK"</span> $ UPPER<span style="color: #000000;">(</span> oCli:<span style="color: #000000;">cReply</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> !lOk THEN FERASE<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> CATCH<br /> END<br /><br /> <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">(</span> oCli <span style="color: #000000;">)</span> THEN oCli:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> lOk</div>[/code:2mo98fc0]
EMG
|
Automated download of pictures
|
The above posting is a great tutorial for me and it is a good learning for me.
At the same time, for the sake of interest, I would like to present some simple variations that are possible with the functionality that is already available in FWH.
Our starting point is this:
[code=fw:1acjasfn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aPics := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"https://upload.wikimedia.org/wikipedia/commons/c/c8/Taj_Mahal_in_March_2004.jpg"</span>, ;<br /> <span style="color: #ff0000;">"http://cdn.history.com/sites/2/2015/04/hith-eiffel-tower-iStock_000016468972Large.jpg"</span>, ;<br /> <span style="color: #ff0000;">"https://cdn.sportdirect.com/resizer/500x500/108104-8200-01.jpg"</span> <span style="color: #000000;">}</span><br /><br /> </div>[/code:1acjasfn]
If our purpose is only to view them and all of them, here is a single liner:
[code=fw:1acjasfn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />XBROWSER aPics <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"WEB IMAGES"</span> SETUP <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">200</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">300</span>, ;<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cDataType</span> := <span style="color: #ff0000;">'F'</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER <span style="color: #000000;">)</span><br /> </div>[/code:1acjasfn]
[url=https://imageshack.com/i/plqP1gkap:1acjasfn][img:1acjasfn]http://imagizer.imageshack.us/v2/xq90/921/qP1gka.png[/img:1acjasfn][/url:1acjasfn]
This is not what exactly Mr Venken wanted. He wants to save these images on local hard disk.
Again a single line of code for reading the images from the web and saving them locally:
[code=fw:1acjasfn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />AEval<span style="color: #000000;">(</span> aPics, <span style="color: #000000;">{</span> |c,i,x| x := AfterAtNum<span style="color: #000000;">(</span> <span style="color: #ff0000;">"/"</span>, c <span style="color: #000000;">)</span>, MEMOWRIT<span style="color: #000000;">(</span> x, WebPageContents<span style="color: #000000;">(</span> c <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, aPics<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := x <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> </div>[/code:1acjasfn]
Now all the three images from the web are saved to our hard-disk with the same names.
We like to verify if the images are really downloaded.
[code=fw:1acjasfn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />XBROWSER aPics <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DOWNLOADED IMAGES"</span> COLUMNS <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> SETUP <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cHeaders</span> := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"FileName"</span>, <span style="color: #ff0000;">"Image"</span> <span style="color: #000000;">}</span>, ;<br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">200</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">300</span>, ;<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cDataType</span> := <span style="color: #ff0000;">'F'</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER <span style="color: #000000;">)</span><br /> </div>[/code:1acjasfn]
[url=https://imageshack.com/i/pnijciszp:1acjasfn][img:1acjasfn]http://imagizer.imageshack.us/v2/xq90/923/ijcisz.png[/img:1acjasfn][/url:1acjasfn]
I hope this simplifies your work.
|
Automated download of pictures
|
Waawh. Again a very nice and quick solution.
I see also the very interesting oneliners of Xbrowser
I didn't find a topic where this onliner (FULL SETUP) is talked about.
I only use xbrowser("datafile") // always dbf files .. for quick browse and export to exel
or else I create a full
@ 330,10 XBROWSE oBrw SIZE 1300,250 .....
Thanks !!
Rick started a topic that FWH is more than Xbase. I have to agree.
Could this also be done in other languages with so less code ? I Don't think so.
Would I have a working solution in so less time ? I don't think so.
This forum is very usefull for people like me.
The strength of FWH could be in hands of the smaller companies, with just a few programmers. The point would be to introduce
FWH to the new generation....
Thanks again to all.
|
Automated download of pictures
|
[quote="Enrico Maria Giordano":17kaskuu]This is what I'm using to download a file from a http url:
[code=fw:17kaskuu]<div class="fw" id="{CB}" style="font-family: monospace;">#command <span style="color: #00C800;">IF</span> <condition> THEN <*statements*> => <span style="color: #00C800;">if</span> <condition> ; <statements> ; end<br /><br /><br /><span style="color: #00C800;">FUNCTION</span> GETURLTOFILE<span style="color: #000000;">(</span> cUrl, cFile, lAuth <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> lOk := .F.<br /><br /> <span style="color: #00C800;">LOCAL</span> oCli<br /><br /> <span style="color: #00C800;">DEFAULT</span> lAuth := .F.<br /><br /> <span style="color: #00C800;">TRY</span><br /> oCli = TIPClientHttp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cUrl <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> lAuth THEN oCli:<span style="color: #000000;">UseBasicAuth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span> oCli <span style="color: #000000;">)</span> THEN <span style="color: #00C800;">BREAK</span><br /><br /> oCli:<span style="color: #000000;">nConnTimeout</span> = <span style="color: #000000;">-1</span><br /><br /> <span style="color: #00C800;">IF</span> !oCli:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> THEN <span style="color: #00C800;">BREAK</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> cFile := oCli:<span style="color: #000000;">oUrl</span>:<span style="color: #000000;">cFile</span><br /><br /> <span style="color: #00C800;">IF</span> !oCli:<span style="color: #000000;">ReadToFile</span><span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> THEN <span style="color: #00C800;">BREAK</span><br /><br /> lOk = !EMPTY<span style="color: #000000;">(</span> oCli:<span style="color: #000000;">cReply</span> <span style="color: #000000;">)</span> .AND. <span style="color: #ff0000;">"OK"</span> $ UPPER<span style="color: #000000;">(</span> oCli:<span style="color: #000000;">cReply</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> !lOk THEN FERASE<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> CATCH<br /> END<br /><br /> <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">(</span> oCli <span style="color: #000000;">)</span> THEN oCli:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> lOk</div>[/code:17kaskuu]
EMG[/quote:17kaskuu]
Enrico,
I'm interested in this code, because it's different then FW code as I know.
Am I wrong? A quick search in the forum is giving zero result on this function.
I see in more of your postings this kind of programming.
Where is it from ?
Marc
|
Automated download of pictures
|
It uses TIPClientHttp() that is an xHarbour class.
EMG
|
Automated download of pictures
|
[quote:39svjuuv]AEval( aPics, { |c,i,x| x := AfterAtNum( "/", c ), MEMOWRIT( x, WebPageContents( c ) ), aPics[ i ] := x } )[/quote:39svjuuv]
I don't see the webpagecontents function.
I think that I'm missing several links to the functions library. Do they exist ?
I want to learn what is going on in this oneliner <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
AEval and DBEval are often used (not me, because i don't know it yet) but i'm sure that 30% of my code is replacebel with these functions.
This kind of code I use very often and is typical code in my case :
[code=fw:39svjuuv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> updateNofoto<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> use master <span style="color: #00C800;">NEW</span><br /> <span style="color: #0000ff;">select</span> master<br /> SET ORDER <span style="color: #0000ff;">TO</span> TAG code<br /> use nofoto <span style="color: #00C800;">NEW</span><br /> nofoto-><span style="color: #000000;">(</span>dbgotop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !nofoto-><span style="color: #000000;">(</span>eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> master-><span style="color: #000000;">(</span>dbseek<span style="color: #000000;">(</span>nofoto->id<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nofoto->memotxt = master->memotxt<br /> nofoto->samenstel = master->kwaliteit<br /> nofoto->gewicht = master->grammage<br /> nofoto->geslacht = master->geslacht<br /> nofoto->mouwen = master->mouwen<br /> <span style="color: #00C800;">endif</span><br /> nofoto-><span style="color: #000000;">(</span>dbskip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">enddo</span><br /> close all<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:39svjuuv]
Is this code a good candidate for a eval function ? or is this code OK.
|
Automated download of pictures
|
Programming is (among other things) a trade off between compactness and readability. Don't be tempted by excessive compactness and less readabilty. Oneliner instruction such that is a double cut knife. Use it with care.
EMG
|
Automated download of pictures
|
Strange,
The samples works ok (xbrowse and download) , but with the dbf data the Xbrowse only works, but the download part gives this error
There are 1600 records, all processed ok in the browse, none in the download.
As far as I can Google, it has something todo with the ole Open (maybe to many open connections? )
Maybe the program is to quick in order to proces the download rec by Rec ?
Did'nt find a solution.
(DOS Error -2147352571) WINOLE/1007 Argument error: OPEN
The code
[code=fw:wctwpktq]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> READHTTP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oImage, oBar<br /><span style="color: #B900B9;">/*<br /> local aPics := { "https://upload.wikimedia.org/wikipedia/commons/c/c8/Taj_Mahal_in_March_2004.jpg", ;<br /> "http://cdn.history.com/sites/2/2015/04/hith-eiffel-tower-iStock_000016468972Large.jpg", ;<br /> "https://cdn.sportdirect.com/resizer/500x500/108104-8200-01.jpg" }<br /> */</span><br /><br /><br /> use c:\programmas\fotoselect\lever\hummel <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> bron<br /> bron-><span style="color: #000000;">(</span>DbGoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">select</span> bron<br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> bron->foto tag foto unique<br /><br /> aPics:= FW_DbfToArray<span style="color: #000000;">(</span><span style="color: #ff0000;">"foto"</span><span style="color: #000000;">)</span><br /><br /> xbrowser<span style="color: #000000;">(</span>aPics<span style="color: #000000;">)</span><br /><br /> XBROWSER aPics <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"WEB IMAGES"</span> SETUP <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">200</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">300</span>, ;<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cDataType</span> := <span style="color: #ff0000;">'F'</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER <span style="color: #000000;">)</span><br /><br /> AEval<span style="color: #000000;">(</span> aPics, <span style="color: #000000;">{</span> |c,i,x| x := AfterAtNum<span style="color: #000000;">(</span> <span style="color: #ff0000;">"/"</span>, c <span style="color: #000000;">)</span>, MEMOWRIT<span style="color: #000000;">(</span> x, WebPageContents<span style="color: #000000;">(</span> c <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, aPics<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := x <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:wctwpktq]
|
Automated download of pictures
|
[quote:2ol3cdg8]
(DOS Error -2147352571) WINOLE/1007 Argument error: OPEN
[/quote:2ol3cdg8]
This means you have some invalid URLs in the list. You should make sure that these are all valid URLs.
We don't get a runtime error with XBrowse, because Xbrowse uses TRY/CATCH construct.
When you have the URL names in a DBF, it is not again necessary to read the names into an array to download.
You can as well do:
[code=fw:2ol3cdg8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> downloadpics<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />field FOTO<br /><span style="color: #00C800;">local</span> aPics := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">local</span> cImage, cFile, cURL<br /><br /><br />USE C:\PROGRAMMAS\FOTOSELECT\LEVER\HUMMEL <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> BRON<br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> FOTO TAG FOTO UNIQUE<br />GO TOP<br /><br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cURL := AllTrim<span style="color: #000000;">(</span> FOTO <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> Lower<span style="color: #000000;">(</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> cURL, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"http"</span><br /> cFile := AfterAtNum<span style="color: #000000;">(</span> <span style="color: #ff0000;">"/"</span>, cURL <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">TRY</span><br /> cImage := WebPageContents<span style="color: #000000;">(</span> cURL <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> IsBinaryData<span style="color: #000000;">(</span> cImage <span style="color: #000000;">)</span><br /> MEMOWRIT<span style="color: #000000;">(</span> cFile, cImage <span style="color: #000000;">)</span><br /> AAdd<span style="color: #000000;">(</span> aPics, cFile <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> CATCH<br /> END<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> SKIP<br /><span style="color: #00C800;">enddo</span><br /><br />XBROWSER aPics <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DOWNLOADED IMAGES"</span> COLUMNS <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> SETUP <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cHeaders</span> := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"FileName"</span>, <span style="color: #ff0000;">"Image"</span> <span style="color: #000000;">}</span>, ;<br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">200</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">300</span>, ;<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cDataType</span> := <span style="color: #ff0000;">'F'</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2ol3cdg8]
|
Automated download of pictures
|
[quote:zabw5ofs]
AEval and DBEval are often used (not me, because i don't know it yet) but i'm sure that 30% of my code is replacebel with these functions.
[/quote:zabw5ofs]
There is no specific advantage of using AEVAL instead of for..next loop or DBEVAL instead of do while !eof() loop.
Experts like Mr Antonio and Mr EMG know the internals of (x)Harbour lot better than us. Mr Antonio once told me that for..next loop is more efficient than AEval().
Like Mr EMG said, readability of code is more important. Please write your code in such a way that you can understand it even after ten years. It is also desirable that even other programmers can read and understand your code.
[quote:zabw5ofs]
I see also the very interesting oneliners of Xbrowser
[/quote:zabw5ofs]
We purposefully made XBROWSER so powerful. We did not intend it to be included in release versions, but to serve as a great tool for developers. While XBROWSER automatically builds all standard functionality of xbrowse, we can add additional functionality with SETUP clause.
With XBROWSER you can view "anything".
XBROWSER <cimagefile>
XBROWSER oDlg // works as an object inspector
etc.
[quote:zabw5ofs]
I don't see the webpagecontents function.
[/quote:zabw5ofs]
\fwh\source\function\imgtxtio.prg
|
Automated download of pictures
|
Mr EMG
I request you to help.
I tried this program using the function you have posted
[code=fw:1ncpka21]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> testweb4<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cUrl := <span style="color: #ff0000;">"https://upload.wikimedia.org/wikipedia/commons/c/c8/Taj_Mahal_in_March_2004.jpg"</span><br /> <span style="color: #00C800;">local</span> cFile := <span style="color: #ff0000;">"test.jpg"</span><br /><br /> FERASE<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> GETURLTOFILE<span style="color: #000000;">(</span> cURL, cFile <span style="color: #000000;">)</span><br /> ? File<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> <span style="color: #B900B9;">// --> .F.</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1ncpka21]
The file is not created i.e., not downloaded.
Can you please guide me what I am doing wrong?
|
Automated download of pictures
|
Mr. Rao,
probably the problem is https protocol. You have to use xHarbour tipssl.lib. Sorry, I'm not familiar with it (never used). You'll need of openssl DLLs too.
EMG
|
Automated download of pictures
|
Try this, it works fine here:
[code=fw:3j2rtyyl]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ? URLDOWNLOADTOFILE<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"https://upload.wikimedia.org/wikipedia/commons/c/c8/Taj_Mahal_in_March_2004.jpg"</span>, <span style="color: #ff0000;">"test.jpg"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br />DLL <span style="color: #00C800;">FUNCTION</span> URLDOWNLOADTOFILE<span style="color: #000000;">(</span> pCaller AS LONG, cUrl AS LPSTR, cFileName AS LPSTR, nReserved AS DWORD, nFnCB AS LONG <span style="color: #000000;">)</span> AS LONG;<br /> PASCAL <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"URLDownloadToFileA"</span> LIB <span style="color: #ff0000;">"urlmon.dll"</span></div>[/code:3j2rtyyl]
EMG
|
Automated download of pictures
|
Thank you.
GETURLTOFILE() is working with http: but not https:
URLDOWNLOADTOFILE() is working well with all and is also much faster than GETURLTOFILE().
The actual reason for my testing is to find a faster alternative to the existing function WebPageContents(). Our requirement is to directly read the contents of the URL into memory.
|
Automated download of pictures
|
[quote="nageswaragunupudi":3pwmohqf]Thank you.
GETURLTOFILE() is working with http: but not https:[/quote:3pwmohqf]
This is not true. It would work if tipssl were linked (and opensll DLL's were available).
[quote="nageswaragunupudi":3pwmohqf]URLDOWNLOADTOFILE() is working well with all and is also much faster than GETURLTOFILE().[/quote:3pwmohqf]
I was not aware the URLDOWNLOADTOFILE() is much faster than GETURLTOFILE(). Are you made any real test? Can you share the timing result?
[quote="nageswaragunupudi":3pwmohqf]The actual reason for my testing is to find a faster alternative to the existing function WebPageContents(). Our requirement is to directly read the contents of the URL into memory.[/quote:3pwmohqf]
I use this (but it needs opensll as well):
[code=fw:3pwmohqf]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> GETURL<span style="color: #000000;">(</span> cUrl <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> cHtm := <span style="color: #ff0000;">""</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oCli<br /><br /> <span style="color: #00C800;">TRY</span><br /> oCli = TIPClientHttp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cUrl <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span> oCli <span style="color: #000000;">)</span> THEN <span style="color: #00C800;">BREAK</span><br /><br /> oCli:<span style="color: #000000;">nConnTimeout</span> = <span style="color: #000000;">-1</span><br /><br /> <span style="color: #00C800;">IF</span> !oCli:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> THEN <span style="color: #00C800;">BREAK</span><br /><br /> cHtm = oCli:<span style="color: #000000;">ReadAll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span> oCli:<span style="color: #000000;">cReply</span> <span style="color: #000000;">)</span> .OR. !<span style="color: #000000;">(</span> <span style="color: #ff0000;">"OK"</span> $ UPPER<span style="color: #000000;">(</span> oCli:<span style="color: #000000;">cReply</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cHtm = <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">ENDIF</span><br /> CATCH<br /> END<br /><br /> <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">(</span> oCli <span style="color: #000000;">)</span> THEN oCli:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> cHtm</div>[/code:3pwmohqf]
EMG
|
Automated download of pictures
|
[quote:2k4f90pw]I was not aware the URLDOWNLOADTOFILE() is much faster than GETURLTOFILE(). Are you made any real test? Can you share the timing result?
[/quote:2k4f90pw]
I used the Tajmahal.jpg ( http not https )
GETURLTOFILE() --> 3.1 to 3.3 secs
Both
URLDOWNLOADTOFILE() and
MEMOWRIT( cFile, webpagecontents( curl ) ) --> 0.06 to 0.09 secs
[code=fw:2k4f90pw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> testweb4<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cURL := <span style="color: #ff0000;">"http://cdn.history.com/sites/2/2015/04/hith-eiffel-tower-iStock_000016468972Large.jpg"</span><br /> <span style="color: #00C800;">local</span> cFile := <span style="color: #ff0000;">"test.jpg"</span><br /> <span style="color: #00C800;">local</span> nSecs<br /><br /> FERASE<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> URLDOWNLOADTOFILE<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, cURL, cFile <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Ignore time taken for the first time</span><br /><br /> nSecs := SECONDS<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> GETURLTOFILE<span style="color: #000000;">(</span> cURL, cFile <span style="color: #000000;">)</span><br /> ? SECONDS<span style="color: #000000;">(</span><span style="color: #000000;">)</span> - nSecs, File<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> <span style="color: #B900B9;">// --> 3.23</span><br /><br /> nSecs := SECONDS<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> URLDOWNLOADTOFILE<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, cURL, cFile <span style="color: #000000;">)</span><br /> ? SECONDS<span style="color: #000000;">(</span><span style="color: #000000;">)</span> - nSecs, File<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> <span style="color: #B900B9;">// --> 0.07</span><br /><br /> nSecs := SECONDS<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> MEMOWRIT<span style="color: #000000;">(</span> cFile, webpagecontents<span style="color: #000000;">(</span> curl <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ? SECONDS<span style="color: #000000;">(</span><span style="color: #000000;">)</span> - nSecs, File<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> <span style="color: #B900B9;">// --> 0.07</span><br /><br /> <span style="color: #00C800;">if</span> File<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> XIMAGE<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2k4f90pw]
|
Automated download of pictures
|
That's only a cache effect. Try calling this before download:
[code=fw:11d8s56a]<div class="fw" id="{CB}" style="font-family: monospace;">DLL <span style="color: #00C800;">FUNCTION</span> DELETEURLCACHEENTRY<span style="color: #000000;">(</span> cUrl AS LPSTR <span style="color: #000000;">)</span> AS BOOL;<br /> PASCAL <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"DeleteUrlCacheEntryA"</span> LIB <span style="color: #ff0000;">"wininet.dll"</span></div>[/code:11d8s56a]
EMG
|
Automated download of pictures
|
Mr EMG
You are right.
Without the benefit of cache, GETURLTOFILE() is faster than the other two.
Another observation is that GETURLTOFILE() does not take advantage of cache and other two take advantage of cache if available
|
Automated download of pictures
|
[quote="nageswaragunupudi":3shc5c1u]Mr EMG
You are right.
Without the benefit of cache, GETURLTOFILE() is faster than the other two.
Another observation is that GETURLTOFILE() does not take advantage of cache and other two take advantage of cache if available[/quote:3shc5c1u]
That's true. But use of cache means that the file is not really downloaded, even if it's changed. So use it with caution.
EMG
|
Automated download of pictures
|
[quote:3vmarzxq]That's true. But use of cache means that the file is not really downloaded, even if it's changed. So use it with caution.
[/quote:3vmarzxq]
Yes. Thanks
|
Automatic ASORT()?
|
Hi,
In:
REDEFINE COMBOBOX o[ O_INCD_RECORD ] VAR v[ O_INCD_RECORD ] ITEMS aIncdRecord ID ID_INCD_RECORD OF o[ O_DLG_GET_INCD ]
From some reason the array, aIncdRecord , is sorted automatically. I don't need it sorted. How can I omit it?
Thanks,
Moshe Yarden
|
Automatic ASORT()?
|
En el recurso puedes definir que no se ordene automáticamente.
saludos
|
Automatic ASORT()?
|
Moshe,
As William tells you, don't use the listbox sort style in the resource file.
|
Automatic ASORT()?
|
Thanks. It works good.
Moshe Yarden
|
Automatic RESIZING objects to the system display resolution.
|
Hi,
I have tried function DISPLAY 2.0 for resizig windows, dialogs … and objects on them … but resizing is going very slow expecially if there are manu objects on the dialog.
So here is my new idea which work perfectly on every display resolution and visual all dialogs windows and objects on them have the same size on any dipslay resolution. Don’t need changes in the source code of the program. I have maded the copy of .CH files and maded changes there.
In the start of the program you need only this:
public sSysSir := 0 // System Width
public sSysVis := 0 // System Height
public sNovSir := 800 // Source Width
public sNovVis := 600 // Source Height
public sSir := 0 // Factor for new Width
public sVis := 0 // Factor for new Height
ScrResolution(@sSysSir,@sSysVis)
sSir := sSysSir / sNovSir
sVis := sSysVis / sNovVis
//------------------------------------------------------------------------//
function sSir(nSir)
if !empty(nSir)
return nSir*sSir
else
return nSir
endif
//------------------------------------------------------------------------//
function sVis(nVis)
if !empty(nVis)
return nVis*sVis
else
return nVis
endif
//------------------------------------------------------------------------//
Changes needed in include files is only to put nRow,nCol,nWidth,nHeight,nTop,nBottom,nLeft,nRight, ... in functions like:
<nRow> need to look like sVis(<nRow>)
<nCol> need to look like sSir(<nCol>)
....
For example:
//----------------------------------------------------------------------------//
#xcommand DEFINE DIALOG <oDlg> ;
[ <resource: NAME, RESNAME, RESOURCE> <cResName> ] ;
[ TITLE <cTitle> ] ;
[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <lib: LIBRARY, DLL> <hResources> ] ;
[ <vbx: VBX> ] ;
[ STYLE <nStyle> ] ;
[ <color: COLOR, COLORS> <nClrText> [,<nClrBack> ] ] ;
[ BRUSH <oBrush> ] ;
[ <of: WINDOW, DIALOG, OF> <oWnd> ] ;
[ <pixel: PIXEL> ] ;
[ ICON <oIco> ] ;
[ FONT <oFont> ] ;
[ <help: HELP, HELPID> <nHelpId> ] ;
=> ;
<oDlg> = TDialog():New( sVis(<nTop>), sSir(<nLeft>), sVis(<nBottom>), sSir(<nRight>),;
<cTitle>, <cResName>, <hResources>, <.vbx.>, <nStyle>,;
<nClrText>, <nClrBack>, <oBrush>, <oWnd>, <.pixel.>,;
<oIco>, <oFont>, <nHelpId>, sSir(<nWidth>), sVis(<nHeight>) )
//----------------------------------------------------------------------------//
#command @ <nRow>, <nCol> GET [ <oGet> VAR ] <uVar> ;
[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <memo: MULTILINE, MEMO, TEXT> ] ;
[ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FONT <oFont> ] ;
[ <hscroll: HSCROLL> ] ;
[ CURSOR <oCursor> ] ;
[ <pixel: PIXEL> ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ WHEN <uWhen> ] ;
[ <lCenter: CENTER, CENTERED> ] ;
[ <lRight: RIGHT> ] ;
[ <readonly: READONLY, NO MODIFY> ] ;
[ VALID <uValid> ] ;
[ ON CHANGE <uChange> ] ;
[ <lDesign: DESIGN> ] ;
[ <lNoBorder: NO BORDER, NOBORDER> ] ;
[ <lNoVScroll: NO VSCROLL> ] ;
=> ;
[ <oGet> := ] TMultiGet():New( sVis(<nRow>), sSir(<nCol>), bSETGET(<uVar>),;
[<oWnd>], sSir(<nWidth>), sVis(<nHeight>), <oFont>, <.hscroll.>,;
<nClrFore>, <nClrBack>, <oCursor>, <.pixel.>,;
<cMsg>, <.update.>, <{uWhen}>, <.lCenter.>,;
<.lRight.>, <.readonly.>, <{uValid}>,;
[\{|nKey, nFlags, Self| <uChange>\}], <.lDesign.>,;
[<.lNoBorder.>], [<.lNoVScroll.>] )
//----------------------------------------------------------------------------//
#xcommand DEFINE FONT <oFont> ;
[ NAME <cName> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <from:FROM USER> ] ;
[ <bold: BOLD> ] ;
[ <italic: ITALIC> ] ;
[ <underline: UNDERLINE> ] ;
[ WEIGHT <nWeight> ] ;
[ OF <oDevice> ] ;
[ NESCAPEMENT <nEscapement> ] ;
=> ;
<oFont> := TFont():New( <cName>, sSir(<nWidth>), sVis(<nHeight>), [<.from.>],;
[<.bold.>],[<nEscapement>],,[<nWeight>], [<.italic.>],;
[<.underline.>],,,,,, [<oDevice>] )
//------------------------------------------------------------------------//
Best regards,
|
Automatic application termination
|
Hello, does anyone have a sample function that will automatically terminates an application if a user is not actively using the application. I need this function to automatically close the application in case a user forgets to close application at end of day so we can run of an automatic index routine. Thank you in advance for your help.
Regards,
|
Automatic application termination
|
Darrell,
Here is an idea. Create a timer that checks the time of day every 30 mintues or so then if it is after a specified time, call wndMain():end().
James
|
Automatic application termination
|
I hope I can help you ....
[code:ye4ssy28]
Local oOut
Local nTime:=0
Local oWnd
define window oWnd
....
DEFINE TIMER oOut INTERVAL 60000 OF oWnd ;
ACTION ( nTime ++, if ( nTime == 1,( MsgInfo( OemToAnsi("Version 1.0 ( Demostration )." + CRLF +;
"Author" + CRLF + "name_application" + CRLF +"End of demostration") ),oWnd:END()),))
ACTIVATE TIMER oOut
ACTIVATE WINDOW oWnd
[/code:ye4ssy28]
|
Automatic close fwh aplication
|
Hello,I search a solution to close an fwh aplication after a certain time.I know that there was a topic , but i don't found it.Frank
|
Automatic close fwh aplication
|
Frank,You can use a Timer and then call oWnd:End() or simply PostQuitMessage( 0 )<!-- m --><a class="postlink" href="http://forums.fivetechsoft.com/viewtopic.php?t=10028">http://forums.fivetechsoft.com/viewtopic.php?t=10028</a><!-- m -->
|
Automatic close fwh aplication
|
Can we detect how long the aplication is inactive ?Each key stroke or mouse activity should reset the timer to zero ?Frank
|
Automatic dialing of phone number on PDA Phone
|
Half way their from a PC I create a WEB page with <A href="wtai://wp/mc918887766"> 91 888 77 66<u></u></A> using :
if !empty(AGENDWML->TEL)
oText:Add('<A href="wtai://wp/mc;'+STRTRAN(AGENDWML->TEL,' ','')+'">'+TRIM(AGENDWML->TEL)+'<u></u></A>')
oText:Add( '<br/>')
ENDIF
And upload it via FTP to a website then accesing the website I can dial the number on my PDA .
Is there any way I can write the web page to my PDA from FWPPC then waitrun() the HTML text from FWPPC.
Any other metod for automatic dailing on a PDA or smartphone?
|
Automatic dialing of phone number on PDA Phone
|
Paul,
Creo que esto es lo que buscas.
[url:32shc1hx]http://msdn2.microsoft.com/en-us/library/ms880691.aspx[/url:32shc1hx]
|
Automatic send via wetransfer
|
Hi,
One of my programs send emails with ZIP-files as attachement, and is working fine.
The problem is that some clients have problems sending it, because some of their customers only accept receiving ZIP-files via Wetransfer.
Is there a way to send automatic via wetransfer with FiveWin?
|
Automatic send via wetransfer
|
Look de Public API of wetransfer
<!-- m --><a class="postlink" href="https://developers.wetransfer.com/">https://developers.wetransfer.com/</a><!-- m -->
|
Automatic send via wetransfer
|
Incidentally, wetransfer.com is banned in India just a few days back.
|
Automatic start of a new window
|
When i will start a second new window (no mdichild, no parent) automatically on start from the app-window with the INIT clausula, these second window become master and all msg.. are centered on this second window (no good!). When i call this second window with a button on app-window, all is ok. How to start automatically the second window and reach, that all the msg.. comes to the app_window?
|
Automatic start of a new window
|
Easiest way we have found of doing this is via a timer which we activate just before activating the main window
In your on init clause of the main window you set a var like lMainWindowInitComplete := .t. The timer function then checks for this and if it's true create the second window and stop the timer.
|
Automatic start of a new window
|
Thanks Alex! This is good!
|
Automatic streamlit apps using AI
|
[url:2cifoir7]https://share.streamlit.io/streamlit/example-app-streamlit-codex/main[/url:2cifoir7]
[url:2cifoir7]https://github.com/streamlit/streamlit[/url:2cifoir7]
|
Automatic updating
|
Hello,
On a regular base, I put updates of my application on my website. An update always contains 2 files.
I want to build a function in my application which checks if an update is available on my website. If an update is available, the user has to get a message to tell him/her to update.
Does anyone have any idea how I can check in FWH if an update is available on a website ?
Thank you very much in advance for any idea.
|
Automatic updating
|
Dear Mr. Michel,
1.Each time your program is run, it should check with your FTP site whether a new exe is available or not. This can be File's date Time.
2. If the exe in FTP is the latest, means there is an update. Now inform the user about this and get the confirmation from the user whether to download the new exe or not.
3. If the user prefer to download the update, then establish FTP connection and download the exe from the site and save it with a different name.
4. Once the download is finished, you should quit the currently running app.
5. Rename the newly downloaded app to your actual App.Exe name, run the app. (This process can be done with another app in your app folder)
Regards
Anser
|
Automatic updating
|
Hello Michel,
this is how I do it:
Regards,
Otto
[code=fw:kjq5717x]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> Memoread<span style="color: #000000;">(</span>cAppPath + <span style="color: #ff0000;">"<span style="color: #000000;">\i</span>ni<span style="color: #000000;">\u</span>pdate.txt"</span><span style="color: #000000;">)</span> = lookforupdate<span style="color: #000000;">(</span><span style="color: #ff0000;">"http://www.test.at/update.txt"</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//msginfo("keine Änderungen")</span><br /><span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> Memoread<span style="color: #000000;">(</span>cAppPath + <span style="color: #ff0000;">"<span style="color: #000000;">\i</span>ni<span style="color: #000000;">\u</span>pdate.txt"</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /> </div>[/code:kjq5717x]
[code=fw:kjq5717x]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <br /><span style="color: #00C800;">function</span> lookforupdate<span style="color: #000000;">(</span>cUrl<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cAppPath := cFilePath<span style="color: #000000;">(</span> GetModuleFileName<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cPageContent := <span style="color: #ff0000;">"Error: "</span> + cUrl + <span style="color: #ff0000;">" not found or timed out."</span><br /> <span style="color: #00C800;">local</span> oConn<br /><br /> <span style="color: #B900B9;">//IF Upper(Left(cUrl,4))="HTTP"</span><br /> <span style="color: #B900B9;">// cUrl:="http://"+cUrl</span><br /> <span style="color: #B900B9;">//ENDIF</span><br /> <br /> <br /> <span style="color: #00C800;">TRY</span><br /> oConn := TipClientHttp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span>TURL<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span>cUrl<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oConn:<span style="color: #000000;">nConnTimeout</span> := <span style="color: #000000;">20000</span><br /> <span style="color: #00C800;">IF</span> oConn:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span>cURL<span style="color: #000000;">)</span><br /> cPageContent := oConn:<span style="color: #000000;">ReadAll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oConn:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> CATCH<br /> cPageContent:=<span style="color: #ff0000;">"Error opening "</span> + cUrl<br /> END<br /><br /><br /> MemoWrit<span style="color: #000000;">(</span>cAppPath + <span style="color: #ff0000;">"<span style="color: #000000;">\i</span>ni<span style="color: #000000;">\u</span>pdate.txt"</span> ,cPageContent<span style="color: #000000;">)</span><br /><br /> WritePProString<span style="color: #000000;">(</span> <span style="color: #ff0000;">"SETUPDATEN"</span> ,<span style="color: #ff0000;">"DOWNLOAD"</span>, dtoc<span style="color: #000000;">(</span> date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"INI<span style="color: #000000;">\u</span>pdate.ini"</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> cPageContent<br /><br /><br /><span style="color: #B900B9;">//================================================================================</span></div>[/code:kjq5717x]
|
Automatic updating
|
Hi,
Master Gabriel Maimó created a solution to update via FTP. See at <!-- m --><a class="postlink" href="http://bielsys.blogspot.com/">http://bielsys.blogspot.com/</a><!-- m -->
(actualización automática de aplicaciones).
It is an excelent work done by him.
Regards <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
Automatic updating
|
Michael,
I do it a bit differently. I created a separate program which runs on the server all of the time. Here is how it works:
1) The program, when started, will check my server to see if an update exists AND if the client is authorized to receive it. If so, the program downloads the update file ( created as a zip ) and then unpacks it. This overwrites a "server" file that is rarely open ( just used for maintenance ), and a "client" file. The program also does a backup of all files to a USB drive, and does some timed submissions. This program runs all the time in the background, and if that machine is shut down, the shortcut is in the startup folder so it will run again when the "server" is turned back on. Backups are daily ( afer midnight ), and other submissions are on their scheduled basis. The program will cycle every six hours, so it does this 4 times a day. If an update is brought to the machine, it is then logged in.
2) When starting the "client" program, it checks to see if the current running program is less then the version on the local server. If it is, then it will copy the newer .exe to the local machine, and then start the program. My shortcut actually points to a separate program which does the checking and copy before running the actual client .exe.
If anyone wants details, I will be happy to post them.
|
Automatic updating
|
Thank you guys, for your answers.
Otto's suggestion works perfectly.
|
Automatic updating
|
mgsoft
the test of biel not run on xharbour
|
Automatic updating
|
Biel's program run perfect under xHarbour and xBuilder. Please use the following code:
[code=fw:38r9r8v4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">///// FUNCIONES PARA CONVERIR HORA A SEGUNDOS, Y VICEVERSA</span><br /><span style="color: #B900B9;">// Nota: me comentan que al compilar con xHarbour falta la función HB_IsChar, simplemente sustituir HB_ISCHAR( cTime ) por ValType(cTime)=='C'.</span><br /><span style="color: #B900B9;">//---------------------------------</span><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> TIMETOSEC<span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> nSec := <span style="color: #000000;">0</span>, nLen, i, aLim, aMod, nInd, n<br /><span style="color: #00C800;">if</span> cTime == <span style="color: #00C800;">NIL</span><br /> nSec := seconds<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />elseif ValType<span style="color: #000000;">(</span>cTime<span style="color: #000000;">)</span>==<span style="color: #ff0000;">'C'</span> <span style="color: #B900B9;">//HB_ISCHAR( cTime )</span><br /> nLen := len<span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> nLen + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> % <span style="color: #000000;">3</span> == <span style="color: #000000;">0</span> .and. nLen <= <span style="color: #000000;">11</span><br /> nInd := <span style="color: #000000;">1</span><br /> aLim := <span style="color: #000000;">{</span> <span style="color: #000000;">24</span>, <span style="color: #000000;">60</span>, <span style="color: #000000;">60</span>, <span style="color: #000000;">100</span> <span style="color: #000000;">}</span><br /> aMod := <span style="color: #000000;">{</span> <span style="color: #000000;">3600</span>, <span style="color: #000000;">60</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>/<span style="color: #000000;">100</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen step <span style="color: #000000;">3</span><br /> <span style="color: #00C800;">if</span> isdigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span> cTime, i, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. ;<br /> isdigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span> cTime, i + <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. ;<br /> <span style="color: #000000;">(</span> i == nLen - <span style="color: #000000;">1</span> .or. <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span> cTime, i + <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">":"</span> <span style="color: #000000;">)</span> .and. ;<br /> <span style="color: #000000;">(</span> n := val<span style="color: #000000;">(</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span> cTime, i, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> < aLim<span style="color: #000000;">[</span> nInd <span style="color: #000000;">]</span><br /> nSec += n * aMod<span style="color: #000000;">[</span> nInd <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">else</span><br /> nSec := <span style="color: #000000;">0</span><br /> exit<br /> <span style="color: #00C800;">endif</span><br /> ++nInd<br /> <span style="color: #00C800;">next</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> <span style="color: #0000ff;">round</span><span style="color: #000000;">(</span> nSec, <span style="color: #000000;">2</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">/* round FL val to be sure that you can compare it */</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><span style="color: #00D7D7;">#include</span> <Windows.h><br /><span style="color: #B900B9;">//#include <mapiwin.h></span><br /><span style="color: #00D7D7;">#include</span> <hbApi.h><br /> <span style="color: #B900B9;">//nTime 1=Last Update, 2=Last Acces, 3=Creation, defecto last update</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> FILETIMES <span style="color: #000000;">)</span> <span style="color: #B900B9;">// params cFileName, nTime --> { nYear, nMonth, nDay, nHour, nMin, nSec }</span><br /><span style="color: #000000;">{</span><br /> LPSTR cFileName = hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ;<br /> int nTime = <span style="color: #000000;">(</span> ISNUM<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> ? hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> : <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// defaults to 1</span><br /><br /> FILETIME ftCreate, ftAccess, ftWrite ;<br /> SYSTEMTIME stTime ;<br /> BOOL bRet ;<br /> HANDLE hFile = CreateFile<span style="color: #000000;">(</span> cFileName, GENERIC_READ, FILE_SHARE_READ, <span style="color: #000000;">0</span>, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> ;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ! hFile <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> ;<br /><br /> GetFileTime<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>HANDLE<span style="color: #000000;">)</span> hFile, &ftCreate, &ftAccess, &ftWrite <span style="color: #000000;">)</span> ;<br /><br /> <span style="color: #00C800;">switch</span><span style="color: #000000;">(</span> nTime <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">case</span> <span style="color: #000000;">1</span> : <span style="color: #B900B9;">// last update</span><br /> FileTimeToSystemTime<span style="color: #000000;">(</span> &ftWrite, &stTime <span style="color: #000000;">)</span> ;<br /> <span style="color: #00C800;">break</span> ;<br /> <span style="color: #00C800;">case</span> <span style="color: #000000;">2</span> : <span style="color: #B900B9;">// last access</span><br /> FileTimeToSystemTime<span style="color: #000000;">(</span> &ftAccess, &stTime <span style="color: #000000;">)</span> ;<br /> <span style="color: #00C800;">break</span> ;<br /> <span style="color: #00C800;">case</span> <span style="color: #000000;">3</span> : <span style="color: #B900B9;">// creation</span><br /> FileTimeToSystemTime<span style="color: #000000;">(</span> &ftCreate, &stTime <span style="color: #000000;">)</span> ;<br /> <span style="color: #00C800;">break</span> ;<br /> <span style="color: #00C800;">default</span> : <span style="color: #B900B9;">// last update</span><br /> FileTimeToSystemTime<span style="color: #000000;">(</span> &ftWrite, &stTime <span style="color: #000000;">)</span> ;<br /> <span style="color: #00C800;">break</span> ;<br /> <span style="color: #000000;">}</span><br /><br /> SystemTimeToTzSpecificLocalTime<span style="color: #000000;">(</span> <span style="color: #00C800;">NULL</span>, &stTime, &stTime <span style="color: #000000;">)</span> ;<br /> CloseHandle<span style="color: #000000;">(</span> hFile <span style="color: #000000;">)</span> ;<br /> hb_reta<span style="color: #000000;">(</span> <span style="color: #000000;">6</span> <span style="color: #000000;">)</span> ;<br /> hb_storni<span style="color: #000000;">(</span> stTime.wYear, <span style="color: #000000;">-1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> ;<br /> hb_storni<span style="color: #000000;">(</span> stTime.wMonth, <span style="color: #000000;">-1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> ;<br /> hb_storni<span style="color: #000000;">(</span> stTime.wDay, <span style="color: #000000;">-1</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> ;<br /> hb_storni<span style="color: #000000;">(</span> stTime.wHour, <span style="color: #000000;">-1</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> ;<br /> hb_storni<span style="color: #000000;">(</span> stTime.wMinute, <span style="color: #000000;">-1</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> ;<br /> hb_storni<span style="color: #000000;">(</span> stTime.wSecond, <span style="color: #000000;">-1</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#define</span> FA_RDONLY <span style="color: #000000;">1</span> <span style="color: #B900B9;">/* R */</span><br /><span style="color: #00D7D7;">#define</span> FA_HIDDEN <span style="color: #000000;">2</span> <span style="color: #B900B9;">/* H */</span><br /><span style="color: #00D7D7;">#define</span> FA_SYSTEM <span style="color: #000000;">4</span> <span style="color: #B900B9;">/* S */</span><br /><span style="color: #00D7D7;">#define</span> FA_LABEL <span style="color: #000000;">8</span> <span style="color: #B900B9;">/* V */</span><br /><span style="color: #00D7D7;">#define</span> FA_DIREC <span style="color: #000000;">16</span> <span style="color: #B900B9;">/* D */</span><br /><span style="color: #00D7D7;">#define</span> FA_ARCH <span style="color: #000000;">32</span> <span style="color: #B900B9;">/* A */</span><br /><span style="color: #00D7D7;">#define</span> FA_NORMAL <span style="color: #000000;">0</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span>_FILESIZE<span style="color: #000000;">)</span><br /><br /> <span style="color: #000000;">{</span><br /> LPCTSTR szFile;<br /> DWORD dwFlags=FILE_ATTRIBUTE_ARCHIVE;<br /> HANDLE hFind;<br /> WIN32_FIND_DATA hFilesFind;<br /> int iAttr;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>hb_pcount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> >=<span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">{</span><br /> szFile=hb_parc<span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>ISNUM<span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> iAttr=hb_parnl<span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><span style="color: #000000;">{</span><br /> iAttr=<span style="color: #000000;">63</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> iAttr & FA_RDONLY <span style="color: #000000;">)</span><br /> dwFlags |= FILE_ATTRIBUTE_READONLY;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> iAttr & FA_HIDDEN <span style="color: #000000;">)</span><br /> dwFlags |= FILE_ATTRIBUTE_HIDDEN;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> iAttr & FA_SYSTEM <span style="color: #000000;">)</span><br /> dwFlags |= FILE_ATTRIBUTE_SYSTEM;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> iAttr & FA_NORMAL <span style="color: #000000;">)</span><br /> dwFlags |= FILE_ATTRIBUTE_NORMAL;<br /><br /> hFind = FindFirstFile<span style="color: #000000;">(</span>szFile,&hFilesFind<span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>hFind != INVALID_HANDLE_VALUE<span style="color: #000000;">)</span><span style="color: #000000;">{</span><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>dwFlags & hFilesFind.dwFileAttributes<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>hFilesFind.nFileSizeHigh><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> hb_retnl<span style="color: #000000;">(</span><span style="color: #000000;">(</span>hFilesFind.nFileSizeHigh*MAXDWORD<span style="color: #000000;">)</span>+hFilesFind.nFileSizeLow<span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">else</span><br /> hb_retnl<span style="color: #000000;">(</span>hFilesFind.nFileSizeLow<span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> hb_retnl<span style="color: #000000;">(</span><span style="color: #000000;">-1</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /> </div>[/code:38r9r8v4]
Regards
George
|
Automatic updating
|
Good george can you post the sample complete please?
And How I can make If I must go out from a proxy ?
|
Automatic updating
|
Please refer to:
Gabriel Maimó at <!-- m --><a class="postlink" href="http://bielsys.blogspot.com/">http://bielsys.blogspot.com/</a><!-- m --> For further explanation.
He is the person that developed this program.
Regards,
George
|
Automatic xbrowse refresh
|
Hi fivewinners.
Any idea on how to automatically refresh a xbrowse after a few minutes of inactivity (no key stroke)
Any help will be appreciated
Thanks in advance
From Chile
Adolfo
|
Automatic xbrowse refresh
|
Hi ,
You can look at TIMER
DEFINE TIMER oTmr INTERVAL 6000 ACTION (oLbx:Refresh()) OF oWnd
ACTIVATE TIMER oTmr
|
Automatic xbrowse refresh
|
You have also setidleactin({||UDF()})
TestIdle.prg
|
Automatic xbrowse refresh
|
Adolfo:
yo lo hago en una window..
se actualiza cada 30 seg aprox.
la funcion Recargar_Datos( oBrw ), es donde realizo el proceso de carga del xbrowse...
[code=fw:2v32ja9z]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> nCargo := <span style="color: #000000;">0</span><br /><br />...<br />....<br />....<br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> xWnd <span style="color: #0000ff;">NORMAL</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> xWnd:<span style="color: #0000ff;">Center</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, GoTimer<span style="color: #000000;">(</span> xWnd, oBrw <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> GoTimer<span style="color: #000000;">(</span> xWnd, oBrw <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oTmr<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTmr <span style="color: #0000ff;">OF</span> xWnd <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">1</span> <span style="color: #0000ff;">ACTION</span> IIF<span style="color: #000000;">(</span> nCargo > <span style="color: #000000;">799</span>, <span style="color: #000000;">(</span> Recargar_Datos<span style="color: #000000;">(</span> oBrw <span style="color: #000000;">)</span>, nCargo := <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, nCargo += <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTmr<br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------</span><br /><br /> </div>[/code:2v32ja9z]
espero de que te sirva.
Saludos
|
Automatic xbrowse refresh
|
Thanks to all ...
Jack
SetIdleAction() is only for 16 bits and can cause app freeze.
Armando.
I need to control the time after the last keystroke is done, not at a defined period of time
SP: Necesito controlar el tiempo despues de la ultima tecla presionada, no a un periodo de tiempo definido.
If the user is working in the xBrowse, I let him do his job because I have a routine to do it after he modiies or sees any data, but if he leaves his workplace, I'm want to refresh it after some minutes, so if he returns, he can see new or modified data.
That's the idea.
From Chile
Adolfo
|
Automatic xbrowse refresh
|
Hi,
When i start the xbrowe, i get the time() in a static / global var
When i use the on change, ik get the time in a the same static / global var
In the timer i compre the actual time with the static/gloval var and if it is too long, i do a frefresh() .
Philippe
|
Automatically Download File from website
|
Hello,
I need to create an FWH application that automatically downloads a file from a website so it can be processed. Does anyone have an example that they can share?
Thank you,
|
Automatically Download File from website
|
Try this:
[code=fw:3hooffa8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> GETURLTOFILE<span style="color: #000000;">(</span> cUrl, cFile <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> lOk := .F.<br /><br /> <span style="color: #00C800;">LOCAL</span> oCli<br /><br /> <span style="color: #00C800;">TRY</span><br /> oCli = TIPClientHttp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cUrl <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span> oCli <span style="color: #000000;">)</span>; <span style="color: #00C800;">BREAK</span>; <span style="color: #00C800;">ENDIF</span><br /><br /> oCli:<span style="color: #000000;">nConnTimeout</span> = <span style="color: #000000;">-1</span><br /><br /> <span style="color: #00C800;">IF</span> !oCli:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>; <span style="color: #00C800;">BREAK</span>; <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> cFile := oCli:<span style="color: #000000;">oUrl</span>:<span style="color: #000000;">cFile</span><br /><br /> <span style="color: #00C800;">IF</span> !oCli:<span style="color: #000000;">ReadToFile</span><span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span>; <span style="color: #00C800;">BREAK</span>; <span style="color: #00C800;">ENDIF</span><br /><br /> lOk = !EMPTY<span style="color: #000000;">(</span> oCli:<span style="color: #000000;">cReply</span> <span style="color: #000000;">)</span> .AND. <span style="color: #ff0000;">"OK"</span> $ UPPER<span style="color: #000000;">(</span> oCli:<span style="color: #000000;">cReply</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> !lOk; FERASE<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span>; <span style="color: #00C800;">ENDIF</span><br /> CATCH<br /> END<br /><br /> <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">(</span> oCli <span style="color: #000000;">)</span>; oCli:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>; <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">RETURN</span> lOk</div>[/code:3hooffa8]
EMG
|
Automatically Download File from website
|
If you like some sort of auto-update routine <!-- m --><a class="postlink" href="http://bielsys.blogspot.com/">http://bielsys.blogspot.com/</a><!-- m --> is a useful reference too (listed at <!-- m --><a class="postlink" href="http://wiki.fivetechsoft.com/doku.php?id=fivewin_resources">http://wiki.fivetechsoft.com/doku.php?i ... _resources</a><!-- m --> )
|
Automatically Download File from website
|
Thank you Enrico, that is what I was look for! I appreciate you help!
|
Automatically Download File from website
|
This is the way I download a file :[code=fw:dwgv7sew]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">TRY</span><br /> MsgRun<span style="color: #000000;">(</span><span style="color: #ff0000;">"Downloading ..."</span>,<span style="color: #ff0000;">"One moment please ..."</span>,<span style="color: #000000;">{</span>||IF<span style="color: #000000;">(</span>URLDownloadToFile<span style="color: #000000;">(</span><span style="color: #000000;">0</span>,<span style="color: #ff0000;">"http://www.test.be/test.exe"</span>,<span style="color: #ff0000;">"C:<span style="color: #000000;">\t</span>est.exe"</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>,UpdDown:=<span style="color: #000000;">0</span>,UpdDown:=<span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />CATCH<br /> <span style="color: #B900B9;">// function in case the file is not found or no internet connection</span><br />END</div>[/code:dwgv7sew]
At the end of my PRG-file, I add :[code=fw:dwgv7sew]<div class="fw" id="{CB}" style="font-family: monospace;">DLL <span style="color: #00C800;">Function</span> URLDownloadToFile<span style="color: #000000;">(</span>pCaller AS LONG, szURL AS STRING, szFileName AS STRING, dwReserved AS LONG, lpfnCB AS LONG<span style="color: #000000;">)</span> AS LONG PASCAL <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"URLDownloadToFileA"</span> LIB <span style="color: #ff0000;">"urlmon.dll"</span><br /> </div>[/code:dwgv7sew]
It works just fine.
Good luck.
|
Automatically Download File from website
|
Thank you Michel!
|
Automatically adding date and time of compilation
|
I wanted some automatic way of including the build date and time in my complied xHarbour/FiveLinux code. The method I came up with is as follows:In the shell script that builds the application I get the system date and time and then pass it to the xHarbour compiler as a #define by using the -d compiler option.The option is built as follows:[code:3gd8mipt]builddate=$(date +"%d/%m/%Y@%T")
strBD=""
strBD+='-dkBDATE="'
strBD+=${builddate}
strBD+='"'[/code:3gd8mipt]
and applied as follows. Note that ${1} is the parameter containing the name of the source file to be compiled.
[code:3gd8mipt] ./../../xharbour/bin/harbour ${1}.prg -n -I./../include -I./../../xharbour/include -q0 ${strBD}[/code:3gd8mipt]Then you can use kBDATE in your program as you wish - in my case I include it in the title of the main window.RegardsxProgrammer
|
Automatically adding date and time of compilation
|
Doug,Nice solution, thanks for sharing it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Automatically get focus
|
Hi,
How to make the line under the cursor automatically get focus when moving the mouse cursor over xBrowse ?
|
Automatically get focus
|
[code=fw:246yxt8t]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">lHoverSelect</span> := .T.</div>[/code:246yxt8t]
|
Automating Compile and Link
|
Hi Antonio
I am trying to be able to compile and link code from within a code generator I am writing.
I can run the xHarbour compile step (ie .prg to .c) fine with:
FUNCTION CompilePRG( str_PRGName )
[code=fw:3pgxras9]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">LOCAL</span> int_CompileReturn<br /><br /> ? <span style="color: #ff0000;">"Compiling "</span> + str_PRGName + <span style="color: #ff0000;">".prg to "</span> + str_PRGName + <span style="color: #ff0000;">".c"</span><br /> int_CompileReturn := ExecuteProcess<span style="color: #000000;">(</span> <span style="color: #ff0000;">"./../../xharbour/bin/harbour "</span> + str_PRGName + <span style="color: #ff0000;">".prg -n -I./../include -I./../../xharbour/include"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> int_CompileReturn == <span style="color: #000000;">0</span><br /> int_CompileReturn := CompileC<span style="color: #000000;">(</span> str_PRGName <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span> <br /><br /> <span style="color: #00C800;">RETURN</span> int_CompileReturn</div>[/code:3pgxras9]
But the C compile (.c to .o) fails. I get return value of 1. When I read from @fh_StdOut I get:
gcc: `pkg-config: No such file or directory
gcc: gtk+-2.0`: No such file or directory
cc1: error: unrecognized command line option "-fcflags"
The function is:
[code=fw:3pgxras9]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> CompileC<span style="color: #000000;">(</span> str_CName <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> ExecuteProcess<span style="color: #000000;">(</span> <span style="color: #ff0000;">"gcc "</span> + str_CName + <span style="color: #ff0000;">".c -c -I./../include -I./../../xharbour/include `pkg-config --cflags gtk+-2.0`"</span> <span style="color: #000000;">)</span></div>[/code:3pgxras9]
I assume for some reason the pkg-config expansion isn't being properly recognised or can't start the process or something. Can you think of any possible work around. I could try using the RUN command but then I have to find a way to retrieve the exit code (for the solution to be ideal).
Here is my ExecuteProcess() function:
[code=fw:3pgxras9]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> ExecuteProcess<span style="color: #000000;">(</span> str_Execute <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> fh_ChildProcess<br /> <span style="color: #00C800;">LOCAL</span> fh_StdIn<br /> <span style="color: #00C800;">LOCAL</span> fh_StdOut<br /> <span style="color: #00C800;">LOCAL</span> fh_StdErr<br /> <span style="color: #00C800;">LOCAL</span> int_ReturnStatus<br /> <span style="color: #00C800;">LOCAL</span> str_Buffer<br /><br /> str_Buffer := Space<span style="color: #000000;">(</span><span style="color: #000000;">1024</span><span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Starting Child Process"</span><br /> fh_ChildProcess := HB_OpenProcess<span style="color: #000000;">(</span> str_Execute, @fh_StdIn, @fh_StdOut, @fh_StdErr <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Returned Process Handle is:"</span>, fh_ChildProcess<br /> int_ReturnStatus := HB_ProcessValue<span style="color: #000000;">(</span> fh_ChildProcess <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Child Process returned status:"</span>, int_ReturnStatus<br /> FRead<span style="color: #000000;">(</span> fh_StdErr, @str_Buffer, <span style="color: #000000;">1024</span> <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"str_Buffer"</span><br /> ? str_Buffer<br /> <br /> FClose<span style="color: #000000;">(</span> fh_ChildProcess <span style="color: #000000;">)</span><br /> FClose<span style="color: #000000;">(</span> fh_StdIn <span style="color: #000000;">)</span><br /> FClose<span style="color: #000000;">(</span> fh_StdOut <span style="color: #000000;">)</span><br /> FClose<span style="color: #000000;">(</span> fh_StdErr <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Handles closed"</span><br /><br /> <span style="color: #00C800;">RETURN</span> int_ReturnStatus<br /> </div>[/code:3pgxras9]
Thanks
Doug (xProgrammer)
|
Automating Compile and Link
|
This works, but isn't ideal:
[code=fw:2lpov6o6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> CompileC<span style="color: #000000;">(</span> str_CName <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// RETURN ExecuteProcess( "gcc " + str_CName + ".c -c -I./../include -I./../../xharbour/include `pkg-config --cflags gtk+-2.0`" )</span><br /> RUN <span style="color: #000000;">(</span> <span style="color: #ff0000;">"gcc "</span> + str_CName + <span style="color: #ff0000;">".c -c -I./../include -I./../../xharbour/include `pkg-config --cflags gtk+-2.0`"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">0</span></div>[/code:2lpov6o6]
|
Automating Compile and Link
|
Doug,
I would suggest to compare the source code of RUN with your ExecuteProcess() code:
Basically it does a call to:
iret = system( hb_parc( 1 ) );
[url:3k6qihto]http://www.cit.gu.edu.au/teaching/2501ICT/cgi-bin/man.cgi?system[/url:3k6qihto]
|
Automating Compile and Link
|
I have pretty much solved this one.
The first problem I found was that the new process didn't seem to inherit the current working directory so I replaced the include files that were specified with relative names by absolute names.
I wrote code to get the information returned by pkg-config from a separate process. My initial attempts failed but I discovered that the problem was being caused by a carriage return at the end of the returned string which I had to filter out. So I ended up with code like this:
[code=fw:6xrto0we]<div class="fw" id="{CB}" style="font-family: monospace;"> str_Includes := GetProcessOutput<span style="color: #000000;">(</span> <span style="color: #ff0000;">"pkg-config --cflags gtk+-2.0"</span> <span style="color: #000000;">)</span></div>[/code:6xrto0we]
which makes a call to the following function:
[code=fw:6xrto0we]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> GetProcessOutput<span style="color: #000000;">(</span> str_Execute <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> fh_ChildProcess<br /> <span style="color: #00C800;">LOCAL</span> fh_StdIn<br /> <span style="color: #00C800;">LOCAL</span> fh_StdOut<br /> <span style="color: #00C800;">LOCAL</span> fh_StdErr<br /> <span style="color: #00C800;">LOCAL</span> int_ReturnStatus<br /> <span style="color: #00C800;">LOCAL</span> str_Buffer<br /><br /> str_Buffer := Space<span style="color: #000000;">(</span><span style="color: #000000;">1024</span><span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Starting Child Process"</span><br /> fh_ChildProcess := HB_OpenProcess<span style="color: #000000;">(</span> str_Execute, @fh_StdIn, @fh_StdOut, @fh_StdErr <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Returned Process Handle is:"</span>, fh_ChildProcess<br /> int_ReturnStatus := HB_ProcessValue<span style="color: #000000;">(</span> fh_ChildProcess <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Child Process returned status:"</span>, int_ReturnStatus<br /> FRead<span style="color: #000000;">(</span> fh_StdOut, @str_Buffer, <span style="color: #000000;">1024</span> <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"str_Buffer"</span><br /> ? str_Buffer<br /> <br /> FClose<span style="color: #000000;">(</span> fh_ChildProcess <span style="color: #000000;">)</span><br /> FClose<span style="color: #000000;">(</span> fh_StdIn <span style="color: #000000;">)</span><br /> FClose<span style="color: #000000;">(</span> fh_StdOut <span style="color: #000000;">)</span><br /> FClose<span style="color: #000000;">(</span> fh_StdErr <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"Handles closed"</span><br /><br /> <span style="color: #00C800;">RETURN</span> RTrim<span style="color: #000000;">(</span> StrTran<span style="color: #000000;">(</span> str_Buffer, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:6xrto0we]
Now I just have to get code to do the final link.
I have learned a lot from this exercise, some of which has potential application well beyond compiling and linking (x)Harbour / FiveLinux code from within an application written in the same.
Happy Programming
Doug (xProgrammer)
|
Automating Compile and Link
|
Hi Antonio
Thanks for the wonderfully prompt reply. I was in the middle of finding a solution without having to go to C, but I'll keep that option in mind.
It's a nice outcome from this searching for a solution that I can do a single call to pkg-config and use it for each individual file to be compiled.
I don't know if there is any relevance to a Windows environment.
Regards
Doug (xProgrammer)
|
Automating Compile and Link
|
Doug,
Nice to see that you are improving and moving forward on your Linux development <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Are you working on a visual make tool ?
|
Automating Compile and Link
|
Hi Antonio
I am building the engine to automatically build applications produced by my code generator. Currently my code generator builds a shell script that can build the application. But that is an extra step which I am working on eliminating. Originally my code generator was based on a series of functions (transformed to commands with the pre-processor). That worked but was a little hard to read. I do want to produce a graphical front end for the whole thing. That has yet to be done but I have gone to generating from an xml file that contains the specifications for the application. Whilst that seems long and wordy, its mostly tags and it would not be hard to write a front end graphical editor for it. That specification includes all the information required to build the application, so I wouldn't need to build a separate interface for compiling and linking. You'll get some idea from the following which is the start of a specification (for a working application):
[code=fw:24u6vior]<div class="fw" id="{CB}" style="font-family: monospace;"><SIXTH-SENSE><br /><APPLICATION><br /> <APP-NAME>gtkdoc</APP-NAME><br /> <APP-LONG-NAME>Doctor Software</APP-LONG-NAME><br /> <APP-VERSION><span style="color: #000000;">0.0</span><span style="color: #000000;">.2</span></APP-VERSION><br /> <MAIN-WIN-WIDTH><span style="color: #000000;">900</span></MAIN-WIN-WIDTH><br /> <MAIN-WIN-HEIGHT><span style="color: #000000;">500</span></MAIN-WIN-HEIGHT><br /> <INCLUDE-STANDARD-LIBRARIES>Y</INCLUDE-STANDARD-LIBRARIES><br /> <AW-INCLUSION-LIST><br /> <AW-INCLUSION>rapids.ch</AW-INCLUSION><br /> </AW-INCLUSION-LIST><br /> <MAIN-MENU><br /> <MENU-ITEM><br /> <MENU-NAME>File</MENU-NAME><br /> <MENU-OPTION-LIST><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>Exit</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>ProgExit<span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION><br /> </MENU-OPTION-LIST><br /> </MENU-ITEM><br /> <MENU-ITEM><br /> <MENU-NAME>Patient</MENU-NAME><br /> <MENU-OPTION-LIST><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>By Name</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>obj_PatientList:<span style="color: #000000;">SearchBySurname</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>By Key</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>obj_Patient:<span style="color: #000000;">SearchByKey</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>File By Key</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>obj_PatientFile:<span style="color: #000000;">SearchByKey</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION> <br /> </MENU-OPTION-LIST><br /> </MENU-ITEM><br /> <MENU-ITEM><br /> <MENU-NAME>Doctor</MENU-NAME><br /> <MENU-OPTION-LIST><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>By Name</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>obj_DoctorList:<span style="color: #000000;">SearchByName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>By Key</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>obj_Doctor:<span style="color: #000000;">SearchByKey</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION><br /> </MENU-OPTION-LIST><br /> </MENU-ITEM><br /> <MENU-ITEM><br /> <MENU-NAME>Practice</MENU-NAME><br /> <MENU-OPTION-LIST><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>By PostCode</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>obj_MedicalPracticeList:<span style="color: #000000;">SearchByPCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>By Key</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>obj_MedicalPractice:<span style="color: #000000;">SearchByKey</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION><br /> </MENU-OPTION-LIST><br /> </MENU-ITEM><br /> <MENU-ITEM><br /> <MENU-NAME>Help</MENU-NAME><br /> <MENU-OPTION-LIST><br /> <MENU-OPTION><br /> <MENU-OPTION-NAME>About</MENU-OPTION-NAME><br /> <MENU-OPTION-CODE>About<span style="color: #000000;">(</span><span style="color: #000000;">)</span></MENU-OPTION-CODE><br /> </MENU-OPTION><br /> </MENU-OPTION-LIST><br /> </MENU-ITEM><br /> </MAIN-MENU><br /><br /> <UTILITY-LIST><br /> <UTILITY><br /> <UTILITY-NAME>Locations</UTILITY-NAME><br /> <INSTANTIATE-UTILITY>Y</INSTANTIATE-UTILITY><br /> <UTILITY-CODE-LIST><br /> <UTILITY-CODE-LINE>obj_Locations:<span style="color: #000000;">SetHome</span><span style="color: #000000;">(</span> GetEnv<span style="color: #000000;">(</span> <span style="color: #ff0000;">'HOME'</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">'/'</span> <span style="color: #000000;">)</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>SELECT <span style="color: #000000;">101</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>USE <span style="color: #000000;">(</span> obj_Locations:<span style="color: #000000;">str_Home</span> + <span style="color: #ff0000;">'EMPHASIS'</span> <span style="color: #000000;">)</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>GOTO <span style="color: #000000;">1</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>str_IPAddress := AllTrim<span style="color: #000000;">(</span> IPADDRESS <span style="color: #000000;">)</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>int_Port := PORT</UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>SELECT <span style="color: #000000;">101</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>USE</UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>str_IPAddress := <span style="color: #ff0000;">'127.0.0.1'</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>? <span style="color: #ff0000;">'IP Address set to'</span>, str_IPAddress</UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>? <span style="color: #ff0000;">'Server Port set to'</span>, int_Port</UTILITY-CODE-LINE><br /> </UTILITY-CODE-LIST><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>User</UTILITY-NAME><br /> <INSTANTIATE-UTILITY>Y</INSTANTIATE-UTILITY><br /> <UTILITY-CODE-LIST><br /> <UTILITY-CODE-LINE>obj_User:<span style="color: #000000;">str_Key</span> := <span style="color: #ff0000;">"000000000000001"</span></UTILITY-CODE-LINE><br /> </UTILITY-CODE-LIST><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>SingleItem</UTILITY-NAME><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>ListScreen</UTILITY-NAME><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>ViewEditScreen</UTILITY-NAME><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>KeySearchScreen</UTILITY-NAME><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>AlphaSearchScreen</UTILITY-NAME><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>Screen</UTILITY-NAME><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>Query</UTILITY-NAME><br /> </UTILITY><br /> <UTILITY><br /> <UTILITY-NAME>Socket</UTILITY-NAME><br /> <INSTANTIATE-UTILITY>Y</INSTANTIATE-UTILITY><br /> <UTILITY-CODE-LIST><br /> <UTILITY-CODE-LINE>obj_Socket:<span style="color: #000000;">SetIP</span><span style="color: #000000;">(</span> str_IPAddress <span style="color: #000000;">)</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>obj_Socket:<span style="color: #000000;">SetPort</span><span style="color: #000000;">(</span> int_Port <span style="color: #000000;">)</span></UTILITY-CODE-LINE><br /> <UTILITY-CODE-LINE>obj_Query := obj_Socket:<span style="color: #000000;">CreateQueryObject</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></UTILITY-CODE-LINE><br /> </UTILITY-CODE-LIST><br /> </UTILITY><br /> </UTILITY-LIST><br /><br /><br /><br /> <MODULE-LIST><br /><MODULE><br /><br /> <MODULE-NAME>Patient</MODULE-NAME><br /><br /> <TABLE><br /> <ALIAS>PT</ALIAS><br /> <TABLE-NAME>PATIENT</TABLE-NAME><br /> </TABLE><br /><br /> <LIST-CLASS><br /> <INSTANTIATE-LIST-CLASS>Y</INSTANTIATE-LIST-CLASS><br /> </LIST-CLASS><br /><br /> <SINGLE-CLASS><br /> <INSTANTIATE-SINGLE-CLASS>Y</INSTANTIATE-SINGLE-CLASS><br /> </SINGLE-CLASS><br /><br /> <VIEW-EDIT-SCREEN><br /> <VES-WIDTH><span style="color: #000000;">1000</span></VES-WIDTH><br /> <VES-HEIGHT><span style="color: #000000;">800</span></VES-HEIGHT><br /> <VES-FOCUS>entry_Surname</VES-FOCUS><br /> <VES-CODE>/home/bwana/ss/addedcode/ptveac.prg</VES-CODE><br /> <ADDITIONAL-VE-METHODS><br /> <VE-METHOD><br /> <VE-METHOD-NAME>SetTitle</VE-METHOD-NAME><br /> <VE-METHOD-PARAMETERS>str_Title, int_Gender</VE-METHOD-PARAMETERS><br /> <VE-METHOD-SOURCE>/home/bwana/ss/addedcode/pt_ve_settitle.prg</VE-METHOD-SOURCE><br /> <VE-METHOD-FROM-FILE>Y</VE-METHOD-FROM-FILE><br /> </VE-METHOD><br /> <VE-METHOD><br /> <VE-METHOD-NAME>SetSuburb</VE-METHOD-NAME><br /> <VE-METHOD-PARAMETERS>str_Suburb, str_PostCode</VE-METHOD-PARAMETERS><br /> <VE-METHOD-SOURCE>/home/bwana/ss/addedcode/pt_ve_setsuburb.prg</VE-METHOD-SOURCE><br /> <VE-METHOD-FROM-FILE>Y</VE-METHOD-FROM-FILE><br /> </VE-METHOD><br /> </ADDITIONAL-VE-METHODS><br /> <VE-ACTION-BUTTONS><br /> <VE-ACTION-BUTTON> <br /> <VEAB-NAME>Files</VEAB-NAME><br /> <VEAB-LABEL>_Files</VEAB-LABEL><br /> <VEAB-RESPONSE-ID><span style="color: #000000;">901</span></VEAB-RESPONSE-ID><br /> <VEAB-EXEC-CODE>obj_PatientFileList:<span style="color: #000000;">Fetch</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">obj_DataSource</span>:<span style="color: #000000;">str_Key</span> <span style="color: #000000;">)</span>#obj_PatientFileList:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></VEAB-EXEC-CODE><br /> </VE-ACTION-BUTTON><br /> </VE-ACTION-BUTTONS><br /> </VIEW-EDIT-SCREEN><br /><br /> <SEARCH-BY-SCREEN><br /> <SBS-NAME>Surname</SBS-NAME><br /> <SBS-PROMPT>Surname</SBS-PROMPT><br /> <SBS-CHARACTERS><span style="color: #000000;">32</span></SBS-CHARACTERS><br /> <SBS-ENTRY-WIDTH><span style="color: #000000;">240</span></SBS-ENTRY-WIDTH><br /> <SBS-DATA-FORMAT>U</SBS-DATA-FORMAT><br /> <SBS-EXACT-OPTION>Y</SBS-EXACT-OPTION><br /> </SEARCH-BY-SCREEN><br /><br /><PROPERTY-LIST><br /><br /> <PROPERTY><br /> <VARIABLE> <br /> <VARIABLE-NAME>Key</VARIABLE-NAME><br /> <VARIABLE-TYPE>P</VARIABLE-TYPE><br /> <VARIABLE-CHARACTERS><span style="color: #000000;">16</span></VARIABLE-CHARACTERS><br /> </VARIABLE><br /> <WIDGET><br /> <WIDGET-TYPE>E</WIDGET-TYPE><br /> <WIDGET-DATA-FORMAT>S</WIDGET-DATA-FORMAT><br /> <WIDGET-LEFT><span style="color: #000000;">110</span></WIDGET-LEFT><br /> <WIDGET-TOP><span style="color: #000000;">30</span></WIDGET-TOP><br /> <WIDGET-WIDTH><span style="color: #000000;">240</span></WIDGET-WIDTH><br /> <WIDGET-HEIGHT><span style="color: #000000;">25</span></WIDGET-HEIGHT><br /> <WIDGET-EDITABLE-WHEN>N</WIDGET-EDITABLE-WHEN><br /> </WIDGET><br /> <LABEL><br /> <LABEL-TEXT>Key</LABEL-TEXT><br /> <LABEL-LEFT><span style="color: #000000;">10</span></LABEL-LEFT><br /> <LABEL-TOP><span style="color: #000000;">30</span></LABEL-TOP><br /> <LABEL-WIDTH><span style="color: #000000;">90</span></LABEL-WIDTH><br /> <LABEL-HEIGHT><span style="color: #000000;">25</span></LABEL-HEIGHT><br /> </LABEL><br /> <COLUMN><br /> <COLUMN-TYPE>S</COLUMN-TYPE><br /> <COLUMN-NUMBER><span style="color: #000000;">0</span></COLUMN-NUMBER><br /> <COLUMN-HEADING>Key</COLUMN-HEADING><br /> </COLUMN><br /> <FIELD><br /> <FIELD-NAME>PT_KEY</FIELD-NAME><br /> </FIELD><br /> </PROPERTY><br /><br /> <PROPERTY><br /> <VARIABLE><br /> <VARIABLE-NAME>Title</VARIABLE-NAME><br /> <VARIABLE-TYPE>S</VARIABLE-TYPE><br /> <VARIABLE-CHARACTERS><span style="color: #000000;">8</span></VARIABLE-CHARACTERS><br /> </VARIABLE><br /> <WIDGET><br /> <WIDGET-TYPE>E</WIDGET-TYPE><br /> <WIDGET-DATA-FORMAT>S</WIDGET-DATA-FORMAT><br /> <WIDGET-LEFT><span style="color: #000000;">110</span></WIDGET-LEFT><br /> <WIDGET-TOP><span style="color: #000000;">60</span></WIDGET-TOP><br /> <WIDGET-WIDTH><span style="color: #000000;">90</span></WIDGET-WIDTH><br /> <WIDGET-HEIGHT><span style="color: #000000;">25</span></WIDGET-HEIGHT><br /> <WIDGET-EDITABLE-WHEN>E</WIDGET-EDITABLE-WHEN><br /> </WIDGET><br /> <LABEL><br /> <LABEL-TEXT>Title</LABEL-TEXT><br /> <LABEL-LEFT><span style="color: #000000;">10</span></LABEL-LEFT><br /> <LABEL-TOP><span style="color: #000000;">60</span></LABEL-TOP><br /> <LABEL-WIDTH><span style="color: #000000;">90</span></LABEL-WIDTH><br /> <LABEL-HEIGHT><span style="color: #000000;">25</span></LABEL-HEIGHT><br /> </LABEL><br /> <FIELD><br /> <FIELD-NAME>PT_NMTITLE</FIELD-NAME><br /> </FIELD><br /> </PROPERTY><br /><br /> <PROPERTY><br /> <VARIABLE><br /> <VARIABLE-NAME>GivenNames</VARIABLE-NAME><br /> <VARIABLE-TYPE>S</VARIABLE-TYPE><br /> <VARIABLE-CHARACTERS><span style="color: #000000;">32</span></VARIABLE-CHARACTERS><br /> </VARIABLE><br /> <WIDGET><br /> <WIDGET-TYPE>E</WIDGET-TYPE><br /> <WIDGET-DATA-FORMAT>S</WIDGET-DATA-FORMAT><br /> <WIDGET-LEFT><span style="color: #000000;">110</span></WIDGET-LEFT><br /> <WIDGET-TOP><span style="color: #000000;">90</span></WIDGET-TOP><br /> <WIDGET-WIDTH><span style="color: #000000;">320</span></WIDGET-WIDTH><br /> <WIDGET-HEIGHT><span style="color: #000000;">25</span></WIDGET-HEIGHT><br /> <WIDGET-EDITABLE-WHEN>E</WIDGET-EDITABLE-WHEN><br /> </WIDGET><br /> <LABEL><br /> <LABEL-TEXT>Given Names</LABEL-TEXT><br /> <LABEL-LEFT><span style="color: #000000;">10</span></LABEL-LEFT><br /> <LABEL-TOP><span style="color: #000000;">90</span></LABEL-TOP><br /> <LABEL-WIDTH><span style="color: #000000;">90</span></LABEL-WIDTH><br /> <LABEL-HEIGHT><span style="color: #000000;">25</span></LABEL-HEIGHT><br /> </LABEL><br /> <COLUMN><br /> <COLUMN-TYPE>S</COLUMN-TYPE><br /> <COLUMN-NUMBER><span style="color: #000000;">2</span></COLUMN-NUMBER><br /> <COLUMN-HEADING>Given Names</COLUMN-HEADING><br /> </COLUMN><br /> <FIELD><br /> <FIELD-NAME>PT_NMGIVEN</FIELD-NAME><br /> </FIELD><br /> </PROPERTY><br /><br /> <PROPERTY><br /> <VARIABLE><br /> <VARIABLE-NAME>Surname</VARIABLE-NAME><br /> <VARIABLE-TYPE>S</VARIABLE-TYPE><br /> <VARIABLE-CHARACTERS><span style="color: #000000;">32</span></VARIABLE-CHARACTERS><br /> </VARIABLE><br /> <WIDGET><br /> <WIDGET-TYPE>E</WIDGET-TYPE><br /> <WIDGET-DATA-FORMAT>U</WIDGET-DATA-FORMAT><br /> <WIDGET-LEFT><span style="color: #000000;">110</span></WIDGET-LEFT><br /> <WIDGET-TOP><span style="color: #000000;">120</span></WIDGET-TOP><br /> <WIDGET-WIDTH><span style="color: #000000;">320</span></WIDGET-WIDTH><br /> <WIDGET-HEIGHT><span style="color: #000000;">25</span></WIDGET-HEIGHT><br /> <WIDGET-EDITABLE-WHEN>E</WIDGET-EDITABLE-WHEN><br /> </WIDGET><br /> <LABEL><br /> <LABEL-TEXT>Surname</LABEL-TEXT><br /> <LABEL-LEFT><span style="color: #000000;">10</span></LABEL-LEFT><br /> <LABEL-TOP><span style="color: #000000;">120</span></LABEL-TOP><br /> <LABEL-WIDTH><span style="color: #000000;">90</span></LABEL-WIDTH><br /> <LABEL-HEIGHT><span style="color: #000000;">25</span></LABEL-HEIGHT><br /> </LABEL><br /> <COLUMN><br /> <COLUMN-TYPE>S</COLUMN-TYPE><br /> <COLUMN-NUMBER><span style="color: #000000;">1</span></COLUMN-NUMBER><br /> <COLUMN-HEADING>Surname</COLUMN-HEADING><br /> </COLUMN><br /> <FIELD><br /> <FIELD-NAME>PT_NMFAMLY</FIELD-NAME><br /> </FIELD><br /> </PROPERTY><br /> </div>[/code:24u6vior]
|
Automating Compile and Link
|
Hi Antonio
Current Structure of Compile and LInk back end is:
Class SSFile => encapsulates a file and its attributes, especially date and time Updated
Class SSPRGFile => derived from SSFile. Adds behaviour specific to .prg files, mainly extension
Class SSCFile => derived from SSFile. Adds behaviour specific to .c files, mainly extension
Class SSOBJFile => derived from SSFile. Adds behaviour specific to .obj files, mainly extension
Class SSPRGComponent => contains a .prg, .c and .obj file and understands status (that is does this component need to be recompiled), and can compile it
Class SSApplication (which already existed) will need extension, but it already knows about the required PRG components (both the ones it generates and existing ones) and any required libraries to be linked in. It need code to control the above process including forced rebuild from scratch and how to link the object code.
Regards
Doug (xProgrammer)
|
Automating Compile and Link
|
Hi Antonio
Whilst the compile and link code is not nice and clean as yet, the generator can now take an application definition (as an xml file), generate the .prg code, compile that code and link it to produce an executable and run the executable it has produced all in a single process. I have code to work out which files need recompilation but haven't as yet made that active - clearly when I do I will also need a switch to "force" a total rebuild.
Regards
Doug (xProgrammer)
|
Automating Compile and Link
|
Doug,
it would be great of you could post some screenshots of what you are doing, how the apps look, etc. Thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Autoradiobutton and FWH
|
Hello,I have the following problem in my application:I have defined AUTORADIOBUTTON in resource (DLL), when I select any autoradiobutton option, the text that define this autoradiobutton disappear, even the text disappear in other lines.Had have someone this problem ?. If yes, please could share the solution?.Environment: Fwh 8.02, BCC5.5 y Resource Builder.Thanks in advance,
|
Autoradiobutton and FWH
|
alfonso, Change autoradiobutton in .rc /dll into radiobutton .Shuming Wang
|
Autoradiobutton y fwh
|
Hola,Se me presenta el problema siguiente:Tengo definido AUTORADIOBUTTON en recursos (DLL), cuando en el programa selecciono cualquier opcion de radiobutton desaparece el texto que lo define, incluso desaparece en otras lineas de radiobutton.¿Alguien ha tenido este problema ?. Si lo ha tenido, ¿como lo ha solucionado?.El entorno es Fwh 8.02, BCC5.5 y Resource Builder.Gracias por anticipado.
|
Autoradiobutton y fwh
|
Hola,Cambia de AUTORADIOBUTTON para RADIOBUTTON a ver se te funciona.Saludos,
|
Autoradiobutton y fwh
|
Hola KleyberHe cambiado a RADIOBUTTON y no funciona, es decir desaparece el texto.Saludos,
|
Autoradiobutton y fwh
|
Muestra una imagen.Y Como haces. El codigo fuente y un .rc de la pantalla.Saludos.
|
Autorewind or defined loops using ""WMPlayer.OCX"" ?
|
I'm using
[color=#0000FF:3ri5vuo5][b:3ri5vuo5]oActiveX = TActiveX():New( oDlg, "WMPlayer.OCX" )[/b:3ri5vuo5][/color:3ri5vuo5]
is it possible to define < autorewind > or a loop-value
oActiveX:Settings:Volume = 7 // works
oActiveX:AutoRewind = .T. // <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
Autorewind or defined loops using ""WMPlayer.OCX"" ?
|
Hello,
looks like the correct way is:
[code=fw:301t80rg]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oActiveX : <span style="color: #000000;">Settings</span>:<span style="color: #000000;">setMode</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"loop"</span>,.T.<span style="color: #000000;">)</span><br /> </div>[/code:301t80rg]
look:
[url:301t80rg]https://stackoverflow.com/questions/36524002/how-do-i-play-music-on-loop-in-batch[/url:301t80rg]
[url:301t80rg]https://docs.microsoft.com/en-us/windows/win32/wmp/settings-setmode[/url:301t80rg]
but I don't try it.
|
Autorewind or defined loops using ""WMPlayer.OCX"" ?
|
Antonino,
thank You that works
[quote:337v7e9o]oActiveX:Settings:SetMode("loop",.T.)[/quote:337v7e9o]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
Autorewind or defined loops using ""WMPlayer.OCX"" ?
|
Dear Antonino,
oActiveX:Settigs:setMode('loop',.T.) is working.
I cannot find the property of nTop, nLeft, nHeight, nWidth. How can I setting the position.
Thanks in advance,
Dutch
[quote="AntoninoP":392rt5el]Hello,
looks like the correct way is:
[code=fw:392rt5el]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oActiveX : <span style="color: #000000;">Settings</span>:<span style="color: #000000;">setMode</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"loop"</span>,.T.<span style="color: #000000;">)</span><br /> </div>[/code:392rt5el]
look:
[url:392rt5el]https://stackoverflow.com/questions/36524002/how-do-i-play-music-on-loop-in-batch[/url:392rt5el]
[url:392rt5el]https://docs.microsoft.com/en-us/windows/win32/wmp/settings-setmode[/url:392rt5el]
but I don't try it.[/quote:392rt5el]
|
Autorewind or defined loops using ""WMPlayer.OCX"" ?
|
Dear All,
Please ignore my question, I got it now.
[quote="dutch":1tz4hybq]Dear Antonino,
oActiveX:Settigs:setMode('loop',.T.) is working.
I cannot find the property of nTop, nLeft, nHeight, nWidth. How can I setting the position.
Thanks in advance,
Dutch
[quote="AntoninoP":1tz4hybq]Hello,
looks like the correct way is:
[code=fw:1tz4hybq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oActiveX : <span style="color: #000000;">Settings</span>:<span style="color: #000000;">setMode</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"loop"</span>,.T.<span style="color: #000000;">)</span><br /> </div>[/code:1tz4hybq]
look:
[url:1tz4hybq]https://stackoverflow.com/questions/36524002/how-do-i-play-music-on-loop-in-batch[/url:1tz4hybq]
[url:1tz4hybq]https://docs.microsoft.com/en-us/windows/win32/wmp/settings-setmode[/url:1tz4hybq]
but I don't try it.[/quote:1tz4hybq][/quote:1tz4hybq]
|
Autorotacion
|
Buenas.
Queda mal el centrado al hacer autorotacaion en el dispositivo.
[url:20uzwmtb]https://drive.google.com/file/d/0By3GyDUP8Ga5RjhzaENOMnhBZU44OWlaQzRxTEh2T2pNNzAw/view?usp=sharing[/url:20uzwmtb]
|
Autorotacion
|
fix
|
Autorotacion
|
No se ve bien tu imagen, puedes volver a ponerla ? gracias
|
Autorotacion
|
Seguramente se nos notifique con un evento y haya que usarlo para hacer un oDlg:Center()
gracias!
|
Autosort no funciona con Object (MySql)?
|
Amigos.
Tengo el siguiente codigo (xBrowse con TMySql) que da error al usar AUTOSORT:
[code=fw:2hai6oke]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">180</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> OBJECT oBalanza ;<br /> COLUMNS <span style="color: #ff0000;">"CodiCont"</span>, <span style="color: #ff0000;">"Nombre"</span>, <span style="color: #ff0000;">"SaldoAnt"</span>, <span style="color: #ff0000;">"MovDebe"</span>, <span style="color: #ff0000;">"MovHaber"</span>, <span style="color: #ff0000;">"SaldoAct"</span> ; <br /> PICTURES ,,<span style="color: #ff0000;">"@( 9,999,999,999.99"</span>,<span style="color: #ff0000;">"@Z 9,999,999,999.99"</span>,<span style="color: #ff0000;">"@Z 9,999,999,999.99"</span>,<span style="color: #ff0000;">"@( 9,999,999,999.99"</span> ;<br /> SIZES <span style="color: #000000;">120</span>,<span style="color: #000000;">320</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">120</span> ;<br /> CELL LINES FOOTERS AUTOSORT<br /> </div>[/code:2hai6oke]
Alguien puede darme una luz sobre esto?
Saludos.
El error es:
Application
===========
Path and name: D:\FAPSOFT\NEWCONT32_MYSQL\Wcont32.Exe (32 bits)
Size: 2,611,712 bytes
Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 9445)
FiveWin Version: FWHX 12.03
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 33 secs
Error occurred at: 06/09/2018, 11:53:28
Error description: Error BASE/1102 Argument error: UPPER
Args:
[ 1] = U
Stack Calls
===========
Called from: => UPPER( 0 )
Called from: XBROWSE.PRG => TXBRWCOLUMN:SETORDER( 11450 )
Called from: XBROWSE.PRG => TXBRWCOLUMN:HEADERLBUTTONUP( 10347 )
Called from: XBROWSE.PRG => TXBROWSE:LBUTTONUP( 3399 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1690 )
Called from: XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11793 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
Called from: D:\FAPSOFT\NEWCON~2\wcont32.prg => BROWBALANZA( 198 )
|
Autosort no funciona con Object (MySql)?
|
Holas.
Si hago:
[code=fw:1lmh0etf]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bSeek</span> := <span style="color: #000000;">{</span> |c| MysqlSeek<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">oMysql</span>, c <span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:1lmh0etf]
obtengo el siguiente error:
[code=fw:1lmh0etf]<div class="fw" id="{CB}" style="font-family: monospace;">Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_FUN_MYSQLSEEK'</span> referenced <span style="color: #0000ff;">from</span> D:\FAPSOFT\NEWCONT32_MYSQL\WCONT32.OBJ</div>[/code:1lmh0etf]
MySqlSeek() // Esta function se encuentra en XBrowse.prg y es static.
Uso FW1204
|
Autosort no funciona con Object (MySql)?
|
It appears you are using modified xbrowse.prg, because line no.11450 in the original xbrowse.prg of FWHX 12.03 is not in method SetOrder.
It appears that you are getting error at this line in xbrowse.prg: (line 11287 in the original xbrowse.prg)
[code=fw:3so27vz9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> cSort := Upper<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oMysql</span>:<span style="color: #000000;">cSort</span> <span style="color: #000000;">)</span><br /> </div>[/code:3so27vz9]
Before defining xbrowse try setting
[code=fw:3so27vz9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBalanza:<span style="color: #000000;">cSort</span> := <span style="color: #ff0000;">""</span><br /> </div>[/code:3so27vz9]
|
Autosort no funciona con Object (MySql)?
|
[code=fw:21ygiagd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBalanza:=oServer:<span style="color: #000000;">Query</span><span style="color: #000000;">(</span><span style="color: #ff0000;">" SELECT * FROM "</span> + cBalanza + <span style="color: #ff0000;">" WHERE saldoant<>'0' OR movdebe<>'0' OR movhaber <>'0' OR saldoact <>'0' ORDER BY codicont ;"</span><span style="color: #000000;">)</span><br /><br />oBalanza: <span style="color: #000000;">cSort</span>: = <span style="color: #ff0000;">""</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">180</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> OBJECT oBalanza ;<br /> COLUMNS <span style="color: #ff0000;">"CodiCont"</span>, <span style="color: #ff0000;">"Nombre"</span>, <span style="color: #ff0000;">"SaldoAnt"</span>, <span style="color: #ff0000;">"MovDebe"</span>, <span style="color: #ff0000;">"MovHaber"</span>, <span style="color: #ff0000;">"SaldoAct"</span> ; <br /> PICTURES ,,<span style="color: #ff0000;">"@( 9,999,999,999.99"</span>,<span style="color: #ff0000;">"@Z 9,999,999,999.99"</span>,<span style="color: #ff0000;">"@Z 9,999,999,999.99"</span>,<span style="color: #ff0000;">"@( 9,999,999,999.99"</span> ;<br /> SIZES <span style="color: #000000;">120</span>,<span style="color: #000000;">320</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">120</span> ;<br /> CELL LINES FOOTERS <span style="color: #B900B9;">//AUTOSORT</span><br /><br />WITH OBJECT oBrw<br /> <span style="color: #B900B9;">//:SetMySql(oBalanza, .f., .t., )</span><br /> :<span style="color: #000000;">CodiCont</span>:<span style="color: #000000;">cSortOrder</span> := <span style="color: #ff0000;">"CODICONT"</span> <br />END<br /> <br /> oBrw:<span style="color: #000000;">bSeek</span> := <span style="color: #000000;">{</span> |c| MysqlSeek<span style="color: #000000;">(</span> oBalanza, c <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//this not works</span><br /> </div>[/code:21ygiagd]
[quote:21ygiagd]It appears you are using modified xbrowse.prg, because line no.11450 in the original xbrowse.prg of FWHX 12.03 is not in method SetOrder.[/quote:21ygiagd]
Yes, I use it linked to my program. ( XBrowse.prg Ver 1204 )
[quote:21ygiagd]It appears that you are getting error at this line in xbrowse.prg: (line 11287 in the original xbrowse.prg)[/quote:21ygiagd]
Yes.
I followed your instructions, but the error persists. ( oBalanza: cSort: = "" or oBalanza: cSort: = "CODICONT" )
Indeed, the error occurs in the line you mention, whose value is always nil. ( cSort: = Upper (:: oBrw: oMysql: cSort) )
Thanks
|
Autosort no funciona con Object (MySql)?
|
After you assigned a character value to oBalanza:cSort, how is it getting reset to NIL on its own?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.