topic
stringlengths
1
63
text
stringlengths
1
577k
to Mastintin : yahoo financial
[b:1dvcbvtw]New Version [/b:1dvcbvtw] This release is complete of Finance and Meteo Yahoo ( with or without Proxy) [img:1dvcbvtw]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2014/12/yahoo&#46;jpg[/img:1dvcbvtw] I add a main dialog to call finance and Meteo services yahoo Make a folder [b:1dvcbvtw]Yahoo[/b:1dvcbvtw] and insert this sources the include on includes folder [b:1dvcbvtw]YaHoo.prg [/b:1dvcbvtw] [code=fw:1dvcbvtw]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><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;">"constant.ch"</span><br /><br /><br /><br /><span style="color: #00C800;">Function</span> &nbsp;Yahoo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> oDlgYahoo,oFont<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nBottom &nbsp; := <span style="color: #000000;">14</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nRight &nbsp; &nbsp;:= <span style="color: #000000;">55</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nWidth := &nbsp;<span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nRight * DLG_CHARPIX_W, <span style="color: #000000;">180</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nHeight := nBottom * DLG_CHARPIX_H<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> oBtnOption<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> cUrl_Finance := &nbsp;<span style="color: #ff0000;">"http://eur.i1.yimg.com/eur.yimg.com/i/it/fi/fi6.gif"</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> cUrl_Meteo := <span style="color: #ff0000;">"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> oBmpMeteo,cBmpMeteo<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> oBmpFinance,cBmpFinance<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;lProxy:=Request_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; cSection :=<span style="color: #ff0000;">"Config"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp; &nbsp; &nbsp; PROXY_SCHOOL &nbsp;:= GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Proxy"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; NPORT &nbsp; &nbsp; := val<span style="color: #000000;">&#40;</span>GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Port"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; USERNAME := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Username"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PASSWORD := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Password"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br /><br />&nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"MS Sans Serif"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">8</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgYahoo <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Yahoo"</span> ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">600</span> &nbsp;<span style="color: #0000ff;">pixel</span><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">0</span>,<span style="color: #000000;">10</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmpMeteo FILE cBmpMeteo <span style="color: #0000ff;">OF</span> oDlgYahoo <span style="color: #0000ff;">size</span> <span style="color: #000000;">142</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">pixel</span> NOBORDER &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> &nbsp; &nbsp; Meteo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">40</span>,<span style="color: #000000;">10</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmpFinance FILE cBmpFinance <span style="color: #0000ff;">OF</span> oDlgYahoo <span style="color: #0000ff;">size</span> <span style="color: #000000;">142</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">pixel</span> NOBORDER &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> &nbsp;Finance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp;oBmpMeteo:<span style="color: #000000;">lTransparent</span> := .t.<br />&nbsp; &nbsp; &nbsp;oBmpFinance:<span style="color: #000000;">lTransparent</span> := .t.<br /><br /><br /><br />&nbsp; &nbsp; &nbsp;cargaBmp<span style="color: #000000;">&#40;</span>cUrl_Meteo,oBmpMeteo,lProxy<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;cargaBmp<span style="color: #000000;">&#40;</span>cUrl_Finance,oBmpFinance,lProxy<span style="color: #000000;">&#41;</span><br /><br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgYahoo <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1dvcbvtw] [b:1dvcbvtw]Proxy.prg[/b:1dvcbvtw] [code=fw:1dvcbvtw]<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;">"ttitle.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"constant.ch"</span><br /><br /><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">".<span style="color: #000000;">\I</span>NCLUDE<span style="color: #000000;">\y</span>ahoo.ch"</span><br /><br /><br /><br /><span style="color: #B900B9;">// to connect &nbsp;to Internet &nbsp; &nbsp;without or With Proxy </span><br /><br /><br /><span style="color: #00C800;">Function</span> Request_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> &nbsp; lReturn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> MsgyesNo<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Devo usare il proxy ?"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lReturn :=.t.<br />&nbsp; &nbsp; &nbsp; &nbsp;Valid_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; lReturn :=.f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> lReturn<br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">Function</span> Valid_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> oDlgProxy,oFont<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nBottom &nbsp; := <span style="color: #000000;">14</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nRight &nbsp; &nbsp;:= <span style="color: #000000;">55</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nWidth := &nbsp;<span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nRight * DLG_CHARPIX_W, <span style="color: #000000;">180</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nHeight := nBottom * DLG_CHARPIX_H<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> oBtnHelp,oBtnOK,oBtnCan<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> cUSERNAME := &nbsp;pad<span style="color: #000000;">&#40;</span>GetPvProfString<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Config"</span>,<span style="color: #ff0000;">"Username"</span> &nbsp; &nbsp; &nbsp; ,<span style="color: #ff0000;">"mioUsername"</span> &nbsp; &nbsp;,cIniFile <span style="color: #000000;">&#41;</span> , <span style="color: #000000;">40</span> ,<span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> cPASSWORD := &nbsp;pad<span style="color: #000000;">&#40;</span>GetPvProfString<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Config"</span>,<span style="color: #ff0000;">"Password"</span> &nbsp; &nbsp; &nbsp; ,<span style="color: #ff0000;">"miapassword"</span> &nbsp; &nbsp;,cIniFile <span style="color: #000000;">&#41;</span> , <span style="color: #000000;">40</span> ,<span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> cPROXY &nbsp; &nbsp;:= &nbsp;pad<span style="color: #000000;">&#40;</span>GetPvProfString<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Config"</span>,<span style="color: #ff0000;">"Proxy"</span> &nbsp; &nbsp; &nbsp; ,<span style="color: #ff0000;">"miaproxy"</span> &nbsp; &nbsp;,cIniFile <span style="color: #000000;">&#41;</span> , <span style="color: #000000;">45</span> ,<span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nPORT &nbsp; &nbsp; := &nbsp;pad<span style="color: #000000;">&#40;</span>GetPvProfString<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Config"</span>,<span style="color: #ff0000;">"Port"</span> &nbsp; ,<span style="color: #ff0000;">"8080"</span> &nbsp; &nbsp;,cIniFile <span style="color: #000000;">&#41;</span> , <span style="color: #000000;">4</span> ,<span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"MS Sans Serif"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">8</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgProxy <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Validate Proxy"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">600</span> &nbsp;<span style="color: #0000ff;">pixel</span><br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">12</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Proxy:"</span> <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">45</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> cPROXY <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">26</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Port:"</span> <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">24</span>, <span style="color: #000000;">45</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">var</span> nPORT &nbsp; <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">44</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> &nbsp;<span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">12</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Username:"</span> <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">175</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">var</span> cUSERNAME <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">44</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> &nbsp;<span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">26</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Password:"</span> <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">8</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">24</span>, <span style="color: #000000;">175</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">var</span> cPASSWORD <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">44</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> &nbsp;<span style="color: #0000ff;">FONT</span> oFont<br /><br /><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">46</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">BUTTON</span> oBtnHelp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Help"</span> <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">42</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont &nbsp;<span style="color: #0000ff;">ACTION</span> Helpindex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">46</span>, <span style="color: #000000;">160</span> <span style="color: #0000ff;">BUTTON</span> oBtnOK <span style="color: #0000ff;">PROMPT</span> I18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Confirm"</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">42</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #00C800;">DEFAULT</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>oDlgProxy:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span>IDOK <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">46</span>, <span style="color: #000000;">204</span> <span style="color: #0000ff;">BUTTON</span> oBtnCan <span style="color: #0000ff;">PROMPT</span> i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Exit"</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">OF</span> oDlgProxy <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">42</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont CANCEL <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>oDlgProxy:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span>IDCANCEL<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgProxy <span style="color: #0000ff;">CENTERED</span><br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oDlgProxy:<span style="color: #000000;">nresult</span> == IDOK<br /><br />&nbsp; &nbsp; &nbsp;SetIni<span style="color: #000000;">&#40;</span> cInifile, <span style="color: #ff0000;">"Config"</span>, <span style="color: #ff0000;">"Proxy"</span>, cPROXY <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;SetIni<span style="color: #000000;">&#40;</span> cInifile, <span style="color: #ff0000;">"Config"</span>, <span style="color: #ff0000;">"Username"</span>, cUSERNAME <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;SetIni<span style="color: #000000;">&#40;</span> cInifile, <span style="color: #ff0000;">"Config"</span>, <span style="color: #ff0000;">"Password"</span>, cPASSWORD <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;SetIni<span style="color: #000000;">&#40;</span> cInifile, <span style="color: #ff0000;">"Config"</span>, <span style="color: #ff0000;">"Port"</span>, nPORT <span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1dvcbvtw] [b:1dvcbvtw]ut_fun.prg[/b:1dvcbvtw] [code=fw:1dvcbvtw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ttitle.ch"</span><br /><br />&nbsp;<span style="color: #00C800;">FUNCTION</span> SetIni<span style="color: #000000;">&#40;</span> cIni, cSection, cEntry, xVar <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oIni<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cIni := oApp:<span style="color: #000000;">cIniFile</span><br /><br />&nbsp; &nbsp;INI oIni FILE cIni<br />&nbsp; &nbsp; &nbsp; SET SECTION cSection ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ENTRY cEntry &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">TO</span> xVar &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oIni<br />&nbsp; &nbsp;ENDINI<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;">FUNCTION</span> GetIni<span style="color: #000000;">&#40;</span> cIni, cSection, cEntry, xDefault <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oIni<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> xVar := xDefault<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cIni := oApp:<span style="color: #000000;">cIniFile</span><br /><br />&nbsp; &nbsp;INI oIni FILE cIni<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">GET</span> xVar &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SECTION cSection ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ENTRY cEntry &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> xDefault ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oIni<br />&nbsp; &nbsp;ENDINI<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> xVa<br /><br /><br /><br /><br /><br /><span style="color: #00C800;">Function</span> loadBmp<span style="color: #000000;">&#40;</span>cUrl,lProxy<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oHttp<br /><span style="color: #00C800;">local</span> cResp := <span style="color: #00C800;">nil</span><br /><br /><br /><br />cProxyNo &nbsp;:= <span style="color: #ff0000;">"*.yimg.com"</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; cSection :=<span style="color: #ff0000;">"Config"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"Meteo.ini"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PROXY_SCHOOL &nbsp; &nbsp;:= GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Proxy"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; NPORT &nbsp; &nbsp; := val<span style="color: #000000;">&#40;</span>GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Port"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; USERNAME := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Username"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PASSWORD := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Password"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// ?PROXY_SCHOOL ,NPORT ,USERNAME ,PASSWORD</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Try</span><br />&nbsp; &nbsp; &nbsp; oHttp := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"winhttp.winhttprequest.5.1"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oHttp:<span style="color: #000000;">SetProxy</span><span style="color: #000000;">&#40;</span> HTTPREQUEST_PROXYSETTING_PROXY, PROXY_SCHOOL+<span style="color: #ff0000;">":"</span>+alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>NPORT<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; oHttp:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"GET"</span>, cUrl, .f. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oHttp:<span style="color: #000000;">SetCredentials</span><span style="color: #000000;">&#40;</span>USERNAME,PASSWORD,HTTPREQUEST_SETCREDENTIALS_FOR_PROXY<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; oHttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; cResp := oHttp:<span style="color: #000000;">ResponseBody</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oHttp:<span style="color: #000000;">WaitForResponse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;Catch<br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Errore"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Return</span> cResp<br />&nbsp; &nbsp;End <span style="color: #00C800;">Try</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Return</span> cResp<br /><br /><br /><br /><br /><br /><br /><br /><br /><br />&nbsp;<span style="color: #00C800;">Function</span> cargaBmp<span style="color: #000000;">&#40;</span>cUrl,oImage,lProxy<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cResp := loadBmp<span style="color: #000000;">&#40;</span>cUrl,lProxy<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nZeroZeroClr<br />&nbsp;<span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cResp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// oImage:LoadFromString( cResp )</span><br />&nbsp; &nbsp; oImage:<span style="color: #000000;">LoadFromMemory</span><span style="color: #000000;">&#40;</span> cResp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oImage:<span style="color: #000000;">HasAlpha</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oImage:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><span style="color: #00C800;">Function</span> DlgStatusBar<span style="color: #000000;">&#40;</span>oDlg, nHeight, nCorrec , lColor <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> nDlgHeight := oDlg:<span style="color: #000000;">nHeight</span><br /><span style="color: #00C800;">Local</span> aColor &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.40</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">200</span>, <span style="color: #000000;">200</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">184</span>, <span style="color: #000000;">184</span>, <span style="color: #000000;">184</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.60</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">184</span>, <span style="color: #000000;">184</span>, <span style="color: #000000;">184</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">150</span>, <span style="color: #000000;">150</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">DEFAULT</span> nHeight &nbsp;:= <span style="color: #000000;">72</span><br /><span style="color: #00C800;">DEFAULT</span> nCorrec &nbsp;:= <span style="color: #000000;">0</span><br /><span style="color: #00C800;">DEFAULT</span> lColor &nbsp; := .F.<br /><br />nDlgHeight:= nDlgHeight+ncorrec<br /><span style="color: #00C800;">IF</span> lColor<br />&nbsp; &nbsp;GradienTfill<span style="color: #000000;">&#40;</span>oDlg:<span style="color: #000000;">hDC</span>,nDlgHeight-<span style="color: #000000;">&#40;</span> nHeight<span style="color: #000000;">-2</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">0</span>,nDlgHeight<span style="color: #000000;">-20</span>,oDlg:<span style="color: #000000;">nWidth</span>, aColor ,.t.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;WndBoxIn<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDc</span>,nDlgHeight-<span style="color: #000000;">&#40;</span> nHeight<span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">0</span>,nDlgHeight-<span style="color: #000000;">&#40;</span> nHeight <span style="color: #000000;">&#41;</span>,oDlg:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp;WndBoxIn<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDc</span>,nDlgHeight -<span style="color: #000000;">&#40;</span> nHeight<span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">4</span>,nDlgHeight-<span style="color: #000000;">&#40;</span> nHeight <span style="color: #000000;">&#41;</span>,oDlg:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</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;">FUNCTION</span> DlgBarTitle<span style="color: #000000;">&#40;</span> oWnd, cTitle, cBmp ,nHeight <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oFont<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oTitle<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nColText := <span style="color: #000000;">180</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nRowImg &nbsp;:= <span style="color: #000000;">0</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cTitle &nbsp;:= <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nHeight := <span style="color: #000000;">48</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nHeight < <span style="color: #000000;">48</span><br />&nbsp; &nbsp; &nbsp; nColText := <span style="color: #000000;">60</span><br />&nbsp; &nbsp; &nbsp; nRowImg &nbsp;:= <span style="color: #000000;">12</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">30</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">12</span>, <span style="color: #000000;">30</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">-1</span>, <span style="color: #000000;">-1</span> &nbsp;<span style="color: #0000ff;">TITLE</span> oTitle <span style="color: #0000ff;">size</span> oWnd:<span style="color: #000000;">nWidth</span><span style="color: #000000;">+1</span>, nHeight<span style="color: #000000;">+1</span> <span style="color: #0000ff;">of</span> oWnd SHADOWSIZE <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;@ &nbsp;nRowImg, &nbsp;<span style="color: #000000;">10</span> &nbsp;TITLEIMG &nbsp;<span style="color: #0000ff;">OF</span> oTitle BITMAP cBmp &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">48</span>, <span style="color: #000000;">48</span> REFLEX ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TRANSPARENT<br /><br />&nbsp; &nbsp; @ &nbsp;nRowImg<span style="color: #000000;">-2</span> , &nbsp;nColText TITLETEXT <span style="color: #0000ff;">OF</span> oTitle <span style="color: #0000ff;">TEXT</span> cTitle <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp; oTitle:<span style="color: #000000;">aGrdBack</span> := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">229</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; oTitle:<span style="color: #000000;">nShadowIntensity</span> = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; oTitle:<span style="color: #000000;">nShadow</span> = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; oTitle:<span style="color: #000000;">nClrLine1</span> := nrgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oTitle:<span style="color: #000000;">nClrLine2</span> := RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">229</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oWnd:<span style="color: #000000;">oTop</span>:= oTitle<br /><br /><br /><br /><span style="color: #00C800;">RETURN</span> oTitle<br /><br /><br /><br /><br /><br />&nbsp;</div>[/code:1dvcbvtw] [b:1dvcbvtw]Yahoo.ch[/b:1dvcbvtw] [code=fw:1dvcbvtw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> HTTPREQUEST_PROXYSETTING_DEFAULT &nbsp; <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> HTTPREQUEST_PROXYSETTING_PRECONFIG <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> HTTPREQUEST_PROXYSETTING_DIRECT &nbsp; &nbsp;<span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> HTTPREQUEST_PROXYSETTING_PROXY &nbsp; &nbsp; <span style="color: #000000;">2</span><br /><br /><br /><span style="color: #00D7D7;">#define</span> HTTPREQUEST_SETCREDENTIALS_FOR_SERVER &nbsp;<span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> HTTPREQUEST_SETCREDENTIALS_FOR_PROXY &nbsp; <span style="color: #000000;">1</span><br /><br /><br /><span style="color: #00D7D7;">#define</span> PROXY_MEM <span style="color: #ff0000;">"proxy.ini"</span><br /><br />&nbsp;</div>[/code:1dvcbvtw] [b:1dvcbvtw]Meteo.prg[/b:1dvcbvtw] [code=fw:1dvcbvtw]<div class="fw" id="{CB}" style="font-family: monospace;"> Our first DialogBox sample<br /><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;">"constant.ch"</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">".<span style="color: #000000;">\i</span>nclude<span style="color: #000000;">\y</span>ahoo.ch"</span><br /><br /><br /><br /><br /><br /><span style="color: #00C800;">Function</span> &nbsp;Meteo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">local</span> obmp ,cBmp<br />&nbsp; <span style="color: #00C800;">local</span> oDlg, oIco ,cCity:= <span style="color: #ff0000;">"Marbella"</span>+space<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">local</span> cUrl := <span style="color: #ff0000;">"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"</span><br />&nbsp; <span style="color: #00C800;">local</span> ofont<br />&nbsp; <span style="color: #00C800;">local</span> lProxy<br />&nbsp; <span style="color: #00C800;">Local</span> cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">Font</span> ofont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Verdana"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIco FILE <span style="color: #ff0000;">".<span style="color: #000000;">\B</span>itmaps<span style="color: #000000;">\f</span>ivetech.ico"</span><br /><br /><br />&nbsp; &nbsp; lProxy:=Request_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; cSection :=<span style="color: #ff0000;">"Config"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp; &nbsp; &nbsp; PROXY_SCHOOL &nbsp;:= GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Proxy"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; NPORT &nbsp; &nbsp; := val<span style="color: #000000;">&#40;</span>GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Port"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; USERNAME := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Username"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PASSWORD := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Password"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">// ?PROXY_SCHOOL</span><br /><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Città da cercare"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ICON</span> oIco <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">350</span>, <span style="color: #000000;">240</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">30</span>,<span style="color: #000000;">10</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmp FILE cBmp <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">142</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">pixel</span> NOBORDER<br /><br />&nbsp; &nbsp; &nbsp;obmp:<span style="color: #000000;">lTransparent</span> := .t.<br />&nbsp; &nbsp; &nbsp;cargaBmp<span style="color: #000000;">&#40;</span>cUrl,oBmp,lProxy<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp;oBmp:display()</span><br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Introdurre la citta da trovare :"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">12</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">70</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">GET</span> cCity <span style="color: #0000ff;">size</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">105</span>, <span style="color: #000000;">85</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Cerca"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">pixel</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> oFont ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> llamada_meteo<span style="color: #000000;">&#40;</span>cCity,lProxy<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">105</span>,<span style="color: #000000;">130</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Uscita"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">FONT</span> oFont ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>DlgBarTitle<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #ff0000;">" &nbsp;Servizio Metereologico"</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\B</span>itmaps<span style="color: #000000;">\w</span>eather.bmp"</span> ,<span style="color: #000000;">44</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &nbsp;;<br />&nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> DlgStatusBar<span style="color: #000000;">&#40;</span>oDlg, <span style="color: #000000;">68</span>,, .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><br /><span style="color: #00C800;">Function</span> llamada_Meteo<span style="color: #000000;">&#40;</span>cCity,lProxy<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oHttp<br /><span style="color: #00C800;">local</span> cResp<br /><span style="color: #00C800;">local</span> cDir<br /><span style="color: #00C800;">local</span> Formato := &nbsp;<span style="color: #ff0000;">"json"</span> &nbsp;<span style="color: #B900B9;">// "xml"</span><br /><span style="color: #00C800;">local</span> cUnits:= <span style="color: #ff0000;">"c"</span><br /><br />cDir := <span style="color: #ff0000;">"https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.places(1)"</span><br />cDir:= cDir + <span style="color: #ff0000;">" where text= '"</span>+ cCity +<span style="color: #ff0000;">"' ) and u='"</span>+cUnits+<span style="color: #ff0000;">"'&format="</span> + Formato<br /><br /><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; cSection :=<span style="color: #ff0000;">"Config"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp; &nbsp; &nbsp; PROXY_SCHOOL &nbsp; &nbsp;:= GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Proxy"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; NPORT &nbsp; &nbsp; := val<span style="color: #000000;">&#40;</span>GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Port"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; USERNAME := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Username"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PASSWORD := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Password"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//?PROXY_SCHOOL ,NPORT ,USERNAME ,PASSWORD</span><br /><br /><br />&nbsp; <span style="color: #00C800;">Try</span><br />&nbsp; &nbsp; &nbsp; oHttp := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"winhttp.winhttprequest.5.1"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oHttp:<span style="color: #000000;">SetProxy</span><span style="color: #000000;">&#40;</span> HTTPREQUEST_PROXYSETTING_PROXY, PROXY_SCHOOL+<span style="color: #ff0000;">":"</span>+alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>NPORT<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br /><br />&nbsp; &nbsp; &nbsp; oHttp:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"GET"</span>, cDir, .f. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oHttp:<span style="color: #000000;">SetCredentials</span><span style="color: #000000;">&#40;</span>USERNAME,PASSWORD,HTTPREQUEST_SETCREDENTIALS_FOR_PROXY<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; oHttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;*cResp := oHttp:<span style="color: #000000;">ResponseBody</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; cResp := oHttp:<span style="color: #000000;">ResponseText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oHttp:<span style="color: #000000;">WaitForResponse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; leejson_Meteo<span style="color: #000000;">&#40;</span> cResp,lProxy <span style="color: #000000;">&#41;</span><br /><br />&nbsp; Catch<br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Errore"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Return</span> cResp<br />&nbsp; &nbsp;End <span style="color: #00C800;">Try</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Return</span> cResp<br /><br /><br /><br />&nbsp; <span style="color: #B900B9;">/*<br /><br />&nbsp;Try<br />&nbsp; &nbsp; &nbsp; oHttp := CreateObject("winhttp.winhttprequest.5.1")<br />&nbsp; &nbsp; &nbsp; oHttp:Open("GET", cDir, .f. )<br />&nbsp; &nbsp; &nbsp; oHttp:Send()<br />&nbsp; &nbsp; &nbsp; cResp := oHttp:ResponseText()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oHttp:WaitForResponse()<br />&nbsp; &nbsp; &nbsp;// memowrit("eltiempo.txt",cResp )<br />&nbsp; &nbsp; &nbsp;// msginfo("grabado")<br />&nbsp; &nbsp; &nbsp;// winexec( "notepad.exe eltiempo.txt" )<br /><br />&nbsp; &nbsp; &nbsp;leejson_Meteo( cResp )<br />&nbsp; &nbsp;Catch<br />&nbsp; &nbsp; &nbsp; MsgStop( "Error" )<br />&nbsp; &nbsp; &nbsp; Return cResp<br />&nbsp; &nbsp;End Try<br />&nbsp; &nbsp; &nbsp;*/</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;">function</span> Leejson_Meteo<span style="color: #000000;">&#40;</span>cResp ,lProxy<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> hvar<br /><span style="color: #00C800;">local</span> hvar1,hvar2<br /><span style="color: #00C800;">local</span> cTexto:=<span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">local</span> oDlg, cBmp<br /><span style="color: #00C800;">local</span> nValor<br /><span style="color: #00C800;">local</span> oBmp<br /><span style="color: #00C800;">local</span> ofont1,ofont2<br /><span style="color: #00C800;">Local</span> oBrwForecast<br /><br /><br /><span style="color: #00C800;">local</span> i<br /><span style="color: #00C800;">local</span> cImage,cMin,cMax,cData,cDay<br /><span style="color: #00C800;">local</span> ahTexto,hDias,cPrev<br /><span style="color: #00C800;">local</span> cUrl<br /><span style="color: #00C800;">local</span> &nbsp;oBmp2,cBmp2<br /><br />hb_jsondecode<span style="color: #000000;">&#40;</span> cResp, @hvar <span style="color: #000000;">&#41;</span><br /><br />hvar1:= hvar<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"query"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"results"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"channel"</span><span style="color: #000000;">&#93;</span><br /><br />&nbsp;<span style="color: #0000ff;">define</span> <span style="color: #0000ff;">font</span> ofont1 <span style="color: #0000ff;">name</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">16</span> bold<br /><br />&nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">Font</span> ofont2 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Verdana"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">13</span><br /><br />&nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Risultati"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">600</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE<br /><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">10</span> ,<span style="color: #000000;">80</span> <span style="color: #0000ff;">SAY</span> alltrim<span style="color: #000000;">&#40;</span>hvar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"title"</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">Font</span> ofont1 <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">25</span>, <span style="color: #000000;">70</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Data : "</span>+ alltrim<span style="color: #000000;">&#40;</span>hvar<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"query"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"created"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;hvar2:= hvar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"wind"</span><span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">40</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">say</span> alltrim<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Vento"</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">20</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont1<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> alltrim<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Sensazione Termica :"</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">50</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> alltrim<span style="color: #000000;">&#40;</span> hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"chill"</span><span style="color: #000000;">&#93;</span>+chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">186</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" "</span>+ hvar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"units"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"temperature"</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">60</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Direzione "</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">60</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> &nbsp;hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"direction"</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">70</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Velocità "</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">70</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> &nbsp;hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"speed"</span><span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">" "</span>+ hvar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"units"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"speed"</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; hvar2:= hvar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"atmosphere"</span><span style="color: #000000;">&#93;</span><br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">85</span>, <span style="color: #000000;">95</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Atmosfera "</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont1<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">100</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Umidità "</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">100</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> &nbsp;hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"humidity"</span><span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" %"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">110</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Pressione Barometrica "</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp; <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">110</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"pressure"</span><span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" "</span>+ hvar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"units"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"pressure"</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp; <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp;nValor:= hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"rising"</span><span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> &nbsp;nValor == <span style="color: #ff0000;">"0"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cTexto := <span style="color: #ff0000;">"Costante"</span><br />&nbsp; &nbsp; &nbsp;elseif nValor == <span style="color: #ff0000;">"1"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cTexto := <span style="color: #ff0000;">"In aumento"</span><br />&nbsp; &nbsp; &nbsp;elseif nValor == <span style="color: #ff0000;">"2"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cTexto := <span style="color: #ff0000;">"In diminuizione"</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">120</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Tendenza Barometrica: "</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">120</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> cTexto <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp; hvar2:= hvar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"astronomy"</span><span style="color: #000000;">&#93;</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">160</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Alba "</span> + hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"sunrise"</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">160</span>, <span style="color: #000000;">160</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Tramonto "</span> + hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"sunset"</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br /><br />&nbsp; &nbsp; &nbsp; hvar2:= hvar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"item"</span><span style="color: #000000;">&#93;</span><br /><br /><br /><br /><br /><br />aHTexto:=hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"forecast"</span><span style="color: #000000;">&#93;</span><br />nRow:=<span style="color: #000000;">185</span><br />nCol:= <span style="color: #000000;">5</span><br />@ nRow,nCol <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Data"</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">8</span><br />@ nRow,nCol <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Giorno"</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">8</span><br />@ nRow,nCol <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Massima"</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">8</span><br />@ nRow,nCol <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Minimima"</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">8</span><br />@ nRow,nCol <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Previsione"</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />nCol+=<span style="color: #000000;">45</span><br />nRow:=<span style="color: #000000;">185</span><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;">&#40;</span>aHTexto<span style="color: #000000;">&#41;</span><br />hDias:=aHTexto<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><br />cData:= hDias<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"date"</span><span style="color: #000000;">&#93;</span><br />cDay:= hDias<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"day"</span><span style="color: #000000;">&#93;</span><br />cMax:= hDias<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"high"</span><span style="color: #000000;">&#93;</span><br />cMin:= hDias<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"low"</span><span style="color: #000000;">&#93;</span><br />cPrev:= hDias<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"text"</span><span style="color: #000000;">&#93;</span><br />cUrl:= <span style="color: #ff0000;">"http://l.yimg.com/a/i/us/we/52/"</span>+hDias<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"code"</span><span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">".gif"</span><br />@ nRow,nCol <span style="color: #0000ff;">say</span> cData <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">8</span><br />@ nRow,nCol<span style="color: #000000;">+15</span> <span style="color: #0000ff;">say</span> cDay <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">8</span><br />@ nRow,nCol<span style="color: #000000;">+15</span> <span style="color: #0000ff;">say</span> cMax <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">8</span><br />@ nRow,nCol<span style="color: #000000;">+15</span> <span style="color: #0000ff;">say</span> cMin &nbsp;<span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">8</span><br />@ nRow,nCol <span style="color: #0000ff;">say</span> cPrev <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />nRow+= <span style="color: #000000;">10</span><br />@ nRow,nCol &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmp FILE cBmp <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">32</span>,<span style="color: #000000;">32</span> <span style="color: #0000ff;">pixel</span> NOBORDER<br />cargaBmp<span style="color: #000000;">&#40;</span>cUrl,oBmp,lProxy<span style="color: #000000;">&#41;</span><br />nCol+=<span style="color: #000000;">50</span><br />nRow:=<span style="color: #000000;">185</span><br /><span style="color: #00C800;">next</span><br /><br />@ <span style="color: #000000;">170</span>, <span style="color: #000000;">2</span> GROUP oGroup <span style="color: #0000ff;">TO</span> <span style="color: #000000;">260</span>,<span style="color: #000000;">288</span> LABEL <span style="color: #ff0000;">"Previsione settimanale"</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp;<span style="color: #0000ff;">pixel</span> TRANSPARENT<br /><br /><br /><br />&nbsp; &nbsp; &nbsp;cUrl := <span style="color: #ff0000;">"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">189</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmp2 FILE cBmp2 <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">142</span>,<span style="color: #000000;">55</span> <span style="color: #0000ff;">pixel</span> NOBORDER<br /><br />&nbsp; &nbsp; &nbsp;obmp2:<span style="color: #000000;">lTransparent</span> := .t.<br />&nbsp; &nbsp; &nbsp;cargaBmp<span style="color: #000000;">&#40;</span>cUrl,oBmp2,lProxy<span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; cTexto:=hVar2<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"condition"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"code"</span><span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; cTexto:=<span style="color: #ff0000;">"http://l.yimg.com/a/i/us/we/52/"</span>+cTexto+<span style="color: #ff0000;">".gif"</span><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">12</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmp FILE cBmp <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">32</span>,<span style="color: #000000;">32</span> <span style="color: #0000ff;">pixel</span> NOBORDER<br /><br /><br />&nbsp; &nbsp; &nbsp; cargaBmp<span style="color: #000000;">&#40;</span>cTexto,oBmp,lProxy<span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">285</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">pixel</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> odlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">FONT</span> oFont2<br /><br />&nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">paint</span> &nbsp;DlgStatusBar<span style="color: #000000;">&#40;</span>oDlg, <span style="color: #000000;">68</span>,, .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; ofont1:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; ofont2:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><br /><br /><br />&nbsp;</div>[/code:1dvcbvtw] [b:1dvcbvtw]Finance.prg[/b:1dvcbvtw] [code=fw:1dvcbvtw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Our first DialogBox sample</span><br /><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;">"ttitle.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"constant.ch"</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">".<span style="color: #000000;">\y</span>ahoo.ch"</span><br /><br /><br /><br /><br /><br /><span style="color: #00C800;">Function</span> Finance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">local</span> obmp ,cBmp<br />&nbsp; <span style="color: #00C800;">local</span> oDlg, oIco ,cValor:= <span style="color: #ff0000;">"BHP.AX"</span>+space<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// "GOOGL"+space(20) // "AAPL"+space(20)</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> ofont<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cUrl :=<span style="color: #ff0000;">"http://eur.i1.yimg.com/eur.yimg.com/i/it/fi/fi6.gif"</span><br /><br />&nbsp; <span style="color: #00C800;">local</span> lProxy<br />&nbsp; <span style="color: #00C800;">Local</span> cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">Font</span> ofont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Verdana"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIco FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\w</span>ork<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\i</span>cons<span style="color: #000000;">\f</span>ivewin.ico"</span><br /><br /><br />&nbsp; &nbsp; lProxy:=Request_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; cSection :=<span style="color: #ff0000;">"Config"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp; &nbsp; &nbsp; PROXY_SCHOOL &nbsp;:= GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Proxy"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; NPORT &nbsp; &nbsp; := val<span style="color: #000000;">&#40;</span>GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Port"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; USERNAME := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Username"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PASSWORD := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Password"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br /><br /><br /><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Quote da ricercare"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ICON</span> oIco <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">350</span>, <span style="color: #000000;">240</span><br /><br />&nbsp; @ <span style="color: #000000;">30</span>,<span style="color: #000000;">10</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmp FILE cBmp <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">142</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">pixel</span> NOBORDER<br /><br />&nbsp; &nbsp; &nbsp;obmp:<span style="color: #000000;">lTransparent</span> := .t.<br />&nbsp; &nbsp; &nbsp;cargaBmp<span style="color: #000000;">&#40;</span>cUrl,oBmp,lProxy<span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Introduce el Valor a buscar :"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">12</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">70</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">GET</span> cValor <span style="color: #0000ff;">size</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">105</span>, <span style="color: #000000;">85</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Buscar"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">pixel</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> oFont ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> llamada_Finance<span style="color: #000000;">&#40;</span>cValor,lProxy<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">105</span>,<span style="color: #000000;">130</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Salir"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">FONT</span> oFont ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> &nbsp;DlgBarTitle<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #ff0000;">" &nbsp;Servicio Finaciero"</span>,<span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\a</span>lphaBmp<span style="color: #000000;">\w</span>eather.bmp"</span> ,<span style="color: #000000;">44</span> <span style="color: #000000;">&#41;</span> &nbsp;;<br />&nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> DlgStatusBar<span style="color: #000000;">&#40;</span>oDlg, <span style="color: #000000;">68</span>,, .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oFont:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">Function</span> llamada_Finance<span style="color: #000000;">&#40;</span>cValor,lProxy<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oHttp<br /><span style="color: #00C800;">local</span> cResp<br /><span style="color: #00C800;">local</span> cDir<br /><span style="color: #00C800;">local</span> Formato := &nbsp;<span style="color: #ff0000;">"json"</span><br /><br /><br />cDir := <span style="color: #ff0000;">"https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.quotes where symbol in ( '"</span>+ cValor+ <span style="color: #ff0000;">"')"</span><br /><br />cDir := cDir + <span style="color: #ff0000;">"&format="</span>+ Formato +<span style="color: #ff0000;">"&region=ES"</span>+<span style="color: #ff0000;">"&lang=it-IT"</span>+<span style="color: #ff0000;">"&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback="</span><br /><br /><span style="color: #B900B9;">//cDir := cDir + "&format="+ Formato +"&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback="</span><br /><br /><span style="color: #B900B9;">//cDir := "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.places(1)"</span><br /><span style="color: #B900B9;">//cDir:= cDir + " where text= '"+ cValor +"' ) and u='"+cUnits+"'&format=" + Formato</span><br /><br /><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; cSection :=<span style="color: #ff0000;">"Config"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp; &nbsp; &nbsp; PROXY_SCHOOL &nbsp; &nbsp;:= GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Proxy"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; NPORT &nbsp; &nbsp; := val<span style="color: #000000;">&#40;</span>GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Port"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; USERNAME := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Username"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PASSWORD := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Password"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br /><br /><br /><br /><br /><br /><br /><br />&nbsp; <span style="color: #00C800;">Try</span><br />&nbsp; &nbsp; &nbsp; oHttp := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"winhttp.winhttprequest.5.1"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oHttp:<span style="color: #000000;">SetProxy</span><span style="color: #000000;">&#40;</span> HTTPREQUEST_PROXYSETTING_PROXY, PROXY_SCHOOL+<span style="color: #ff0000;">":"</span>+alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>NPORT<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br /><br />&nbsp; &nbsp; &nbsp; oHttp:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"GET"</span>, cDir, .f. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oHttp:<span style="color: #000000;">SetCredentials</span><span style="color: #000000;">&#40;</span>USERNAME,PASSWORD,HTTPREQUEST_SETCREDENTIALS_FOR_PROXY<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; oHttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;*cResp := oHttp:<span style="color: #000000;">ResponseBody</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; cResp := oHttp:<span style="color: #000000;">ResponseText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// memowrit("finance.txt",cResp )</span><br />&nbsp; &nbsp; &nbsp; leejson_Finance<span style="color: #000000;">&#40;</span> cResp, cValor ,lProxy<span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; Catch<br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Return</span> cResp<br />&nbsp; &nbsp;End <span style="color: #00C800;">Try</span><br /><br /><br /><span style="color: #00C800;">Return</span> cResp<br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">Function</span> Leejson_Finance<span style="color: #000000;">&#40;</span>cResp,cValor ,lProxy<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> hvar<br /><span style="color: #00C800;">local</span> hvar1,hvar2<br /><span style="color: #00C800;">local</span> cTexto:=<span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">local</span> oDlg, cBmp<br /><span style="color: #00C800;">local</span> nValor<br /><span style="color: #00C800;">local</span> oBmp<br /><span style="color: #00C800;">local</span> ofont1,ofont2<br /><span style="color: #00C800;">Local</span> oBrwForecast<br /><br /><span style="color: #00C800;">local</span> aForecast:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> i<br /><span style="color: #00C800;">local</span> cImage,cMin,cMax,cData,cDay<br /><span style="color: #00C800;">local</span> ahTexto,hDias,cPrev<br /><span style="color: #00C800;">local</span> cUrl<br /><span style="color: #00C800;">local</span> nRow:=<span style="color: #000000;">185</span><br /><span style="color: #00C800;">local</span> nCol:= <span style="color: #000000;">5</span><br /><span style="color: #00C800;">local</span> cTitle := <span style="color: #ff0000;">"Resultados para el Valor: "</span> + cValor<br /><br /><br /><span style="color: #00C800;">local</span> cRegion:= <span style="color: #ff0000;">"IT"</span><br /><span style="color: #00C800;">local</span> cLang := <span style="color: #ff0000;">"it-IT"</span><br /><span style="color: #00C800;">local</span> aTipo :=<span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Line"</span>, <span style="color: #ff0000;">"Bar"</span>, <span style="color: #ff0000;">"Candle"</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"l"</span>, <span style="color: #ff0000;">"b"</span>, <span style="color: #ff0000;">"c"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> aSize := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Large"</span>,<span style="color: #ff0000;">"Middle"</span>,<span style="color: #ff0000;">"Small"</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"l"</span>, <span style="color: #ff0000;">"m"</span>, <span style="color: #ff0000;">"s"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br /><br /><br /><br /><br /><br />hb_jsondecode<span style="color: #000000;">&#40;</span> cResp, @hvar <span style="color: #000000;">&#41;</span><br /><br /><br />hvar1:= hvar<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"query"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"results"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"quote"</span><span style="color: #000000;">&#93;</span><br /><br />&nbsp;<span style="color: #0000ff;">define</span> <span style="color: #0000ff;">font</span> ofont1 <span style="color: #0000ff;">name</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">16</span> bold<br /><br />&nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">Font</span> ofont2 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Verdana"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">13</span><br /><br /><br />&nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Resultados"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">570</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE<br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">10</span> ,<span style="color: #000000;">80</span> <span style="color: #0000ff;">SAY</span> alltrim<span style="color: #000000;">&#40;</span> cTitle <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">180</span>, <span style="color: #000000;">20</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">Font</span> ofont1 <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">25</span>, <span style="color: #000000;">70</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Fecha : "</span>+ alltrim<span style="color: #000000;">&#40;</span>hvar<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"query"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"created"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">180</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> alltrim<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Valor :"</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">50</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> alltrim<span style="color: #000000;">&#40;</span> hVar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"symbol"</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">60</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Volumen Medio "</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">60</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> &nbsp;hVar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"AverageDailyVolume"</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">70</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Demanda "</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">70</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> &nbsp;hVar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"AskRealtime"</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">80</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Oferta "</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">80</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> &nbsp;hVar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"BidRealtime"</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br /><br /><br /><br />&nbsp; <span style="color: #B900B9;">// &nbsp; @ 85, 95 say "Atmosfera " OF oDlg ;</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pixel &nbsp;color CLR_BLACK,CLR_WHITE FONT ofont1</span><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">100</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Ultimo Cambio "</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">100</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> &nbsp;hVar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"Change_PercentChange"</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp;<span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">110</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Maximo Anual "</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp; <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">110</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> hVar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"YearHigh"</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> &nbsp; <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">120</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Minimo Anual: "</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">120</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">say</span> &nbsp;hVar1<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"YearLow"</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">color</span> CLR_BLACK,CLR_WHITE <span style="color: #0000ff;">FONT</span> ofont2<br /><br /><br /><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;cTexto:=<span style="color: #ff0000;">"http://chart.finance.yahoo.com/z?s="</span> + alltrim<span style="color: #000000;">&#40;</span>cValor<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"&q="</span>+aTipo<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> +<span style="color: #ff0000;">"&region="</span>+cRegion+<span style="color: #ff0000;">"&lang="</span>+ cLang<br />&nbsp; &nbsp; cTexto:= cTexto+<span style="color: #ff0000;">"&z="</span> + aSize<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">140</span>,<span style="color: #000000;">1</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmp FILE cBmp <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">248</span>,<span style="color: #000000;">124</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ADJUST</span> &nbsp;<span style="color: #0000ff;">pixel</span> NOBORDER<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;cargaBmp<span style="color: #000000;">&#40;</span>cTexto,oBmp,lProxy<span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br /><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">270</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> &nbsp;<span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">pixel</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> odlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">FONT</span> oFont2<br /><br />&nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">paint</span> &nbsp;DlgStatusBar<span style="color: #000000;">&#40;</span>oDlg, <span style="color: #000000;">68</span>,, .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; ofont1:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; ofont2:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><br />&nbsp;</div>[/code:1dvcbvtw]
to Mastintin : yahoo financial
[b:1im0wb1g]Modifies[/b:1im0wb1g] [img:1im0wb1g]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2014/12/menu&#46;jpg[/img:1im0wb1g] [b:1im0wb1g]Yahoo.prg[/b:1im0wb1g] [code=fw:1im0wb1g]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"constant.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">".<span style="color: #000000;">\i</span>nclude<span style="color: #000000;">\y</span>ahoo.ch"</span><br /><br /><br /><span style="color: #00C800;">Function</span> &nbsp;Yahoo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> oDlgYahoo,oFont<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nBottom &nbsp; := <span style="color: #000000;">14</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nRight &nbsp; &nbsp;:= <span style="color: #000000;">55</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nWidth := &nbsp;<span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nRight * DLG_CHARPIX_W, <span style="color: #000000;">180</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> nHeight := nBottom * DLG_CHARPIX_H<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> oBtnOption<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> cUrl_Finance := &nbsp;<span style="color: #ff0000;">"http://eur.i1.yimg.com/eur.yimg.com/i/it/fi/fi6.gif"</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> cUrl_Meteo := <span style="color: #ff0000;">"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> oBmpMeteo,cBmpMeteo<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Local</span> oBmpFinance,cBmpFinance<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">local</span> cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">local</span> lProxy &nbsp; := IIF<span style="color: #000000;">&#40;</span>GetIni<span style="color: #000000;">&#40;</span> cIniFile, <span style="color: #ff0000;">"Config"</span>, <span style="color: #ff0000;">"ProxyYes"</span>,<span style="color: #ff0000;">"1"</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"1"</span> , .T. , .F. <span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span> lProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; cSection :=<span style="color: #ff0000;">"Config"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp; &nbsp; &nbsp; PROXY_SCHOOL &nbsp;:= GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Proxy"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; NPORT &nbsp; &nbsp; := val<span style="color: #000000;">&#40;</span>GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Port"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; USERNAME := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Username"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PASSWORD := GetIni<span style="color: #000000;">&#40;</span>cIniFile, cSection, <span style="color: #ff0000;">"Password"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br /><br />&nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"MS Sans Serif"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">8</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgYahoo <span style="color: #0000ff;">TITLE</span> TITLE_MANAGER ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">430</span>,<span style="color: #000000;">600</span> &nbsp;<span style="color: #0000ff;">pixel</span><br /><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">30</span>,<span style="color: #000000;">10</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmpMeteo FILE cBmpMeteo <span style="color: #0000ff;">OF</span> oDlgYahoo <span style="color: #0000ff;">size</span> <span style="color: #000000;">142</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">pixel</span> NOBORDER &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> &nbsp; &nbsp; Meteo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">80</span>,<span style="color: #000000;">10</span> &nbsp;<span style="color: #0000ff;">IMAGE</span> oBmpFinance FILE cBmpFinance <span style="color: #0000ff;">OF</span> oDlgYahoo <span style="color: #0000ff;">size</span> <span style="color: #000000;">142</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">pixel</span> NOBORDER &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> &nbsp;Finance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp;oBmpMeteo:<span style="color: #000000;">lTransparent</span> := .t.<br />&nbsp; &nbsp; &nbsp;oBmpFinance:<span style="color: #000000;">lTransparent</span> := .t.<br /><br /><br /><br />&nbsp; &nbsp; &nbsp;cargaBmp<span style="color: #000000;">&#40;</span>cUrl_Meteo,oBmpMeteo,lProxy<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;cargaBmp<span style="color: #000000;">&#40;</span>cUrl_Finance,oBmpFinance,lProxy<span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgYahoo <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> BuildMenu<span style="color: #000000;">&#40;</span>oDlgYahoo<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br />&nbsp;<span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> BuildMenu<span style="color: #000000;">&#40;</span>oDlgYahoo<span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #B900B9;">// Menu</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> IsWinxp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; ELSEIF IsWinVista<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu &nbsp;<span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ELSEIF IsWin8<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu <span style="color: #000000;">2010</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ELSEIF IsWin7<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Info"</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Configuration"</span> &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> Request_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Authors"</span> &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> Authors<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Exit"</span> &nbsp; <span style="color: #0000ff;">ACTION</span> oDlgYahoo:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br />&nbsp; &nbsp; &nbsp;oDlgYahoo:<span style="color: #000000;">SetMenu</span><span style="color: #000000;">&#40;</span>oMenu<span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ButtonBar</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> IsWinxp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar 3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> &nbsp;oDlgYahoo <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ELSEIF IsWinVista<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar 3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> &nbsp;oDlgYahoo <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ELSEIF IsWin8<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar 3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> &nbsp;oDlgYahoo <span style="color: #000000;">2010</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ELSEIF IsWin7<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar 3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> &nbsp;oDlgYahoo &nbsp; <span style="color: #000000;">2013</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><br /><br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> IsWinxp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oDlgYahoo <span style="color: #0000ff;">TO</span> TITLE_MANAGER <span style="color: #0000ff;">CENTER</span> NOINSET &nbsp;<span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; ELSEIF IsWinVista<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oDlgYahoo <span style="color: #0000ff;">TO</span> TITLE_MANAGER <span style="color: #0000ff;">CENTER</span> NOINSET <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ELSEIF IsWin8<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oDlgYahoo <span style="color: #0000ff;">TO</span> TITLE_MANAGER <span style="color: #0000ff;">CENTER</span> NOINSET <span style="color: #000000;">2010</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ELSEIF IsWin7<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oDlgYahoo <span style="color: #0000ff;">TO</span> TITLE_MANAGER <span style="color: #0000ff;">CENTER</span> NOINSET &nbsp;<span style="color: #000000;">2010</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><br /><br /><br /><br /><br /><br /><br />&nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><span style="color: #00C800;">Function</span> Authors<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;msgabout<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Services Yahoo"</span>, TITLE_MANAGER+CRLF+ <span style="color: #ff0000;">"MastinTin Manuel "</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />&nbsp;</div>[/code:1im0wb1g] [b:1im0wb1g]on proxy.prg[/b:1im0wb1g] modify the function Request_Proxy() [code=fw:1im0wb1g]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Request_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> &nbsp; lReturn<br />&nbsp;<span style="color: #00C800;">Local</span> cIniFile &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + PROXY_MEM<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> MsgyesNo<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Devo usare il proxy ?"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lReturn :=.t.<br /><br />&nbsp; &nbsp; &nbsp; Valid_Proxy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; lReturn :=.f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><br />&nbsp; &nbsp;SetIni<span style="color: #000000;">&#40;</span> cInifile, <span style="color: #ff0000;">"Config"</span>, <span style="color: #ff0000;">"ProxyYes"</span>, IIF<span style="color: #000000;">&#40;</span>lReturn,<span style="color: #ff0000;">"1"</span>,<span style="color: #ff0000;">"0"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">return</span> lReturn</div>[/code:1im0wb1g] [b:1im0wb1g]On Meteo.prg and Finance.prg[/b:1im0wb1g] insert these lines local cIniFile := cFilePath(GetModuleFileName( GetInstance() ) ) + PROXY_MEM local lProxy := IIF(GetIni( cIniFile, "Config", "ProxyYes","1" ) == "1" , .T. , .F. ) instead of this line lProxy:=Request_Proxy()
to Mastintin : yahoo financial
Silvio, Gran Trabajo . Dentro de los datos que se consiguen veo uno : "Currency":"AUD".... hVar1[ "Currency" ] nos da la moneda usada <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Pongo aqui una listas de todos los datos que puedes conseguir .... [code=fw:pwv45238]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />   <span style="color: #B900B9;">// Todo cuelga de hVar1..... hVar1["symbol"],hVar1["Ask"],, hvar1["AverageDailyvolume"],...</span><br /> <br />     <span style="color: #ff0000;">"symbol"</span>:<span style="color: #ff0000;">"BHP.AX"</span>,<br />      <span style="color: #ff0000;">"Ask"</span>:<span style="color: #00C800;">null</span>,   <br />      <span style="color: #ff0000;">"AverageDailyVolume"</span>:<span style="color: #ff0000;">"7897170"</span>, <br />      <span style="color: #ff0000;">"Bid"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"AskRealtime"</span>:<span style="color: #ff0000;">"27.450"</span><br />      ,<span style="color: #ff0000;">"BidRealtime"</span>:<span style="color: #ff0000;">"27.410"</span>,<br />      <span style="color: #ff0000;">"BookValue"</span>:<span style="color: #ff0000;">"14.873"</span>,<br />      <span style="color: #ff0000;">"Change_PercentChange"</span>:<span style="color: #ff0000;">"-0.910 - -3.21%"</span>,<br />      <span style="color: #ff0000;">"Change"</span>:<span style="color: #ff0000;">"-0.910"</span>,<br />      <span style="color: #ff0000;">"Commission"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"Currency"</span>:<span style="color: #ff0000;">"AUD"</span>,<br />      <span style="color: #ff0000;">"ChangeRealtime"</span>:<span style="color: #ff0000;">"-0.910"</span>,<br />      <span style="color: #ff0000;">"AfterHoursChangeRealtime"</span>:<span style="color: #ff0000;">"N/A - N/A"</span>,<br />      <span style="color: #ff0000;">"DividendShare"</span>:<span style="color: #ff0000;">"1.3092"</span>,<br />      <span style="color: #ff0000;">"LastTradeDate"</span>:<span style="color: #ff0000;">"12/16/2014"</span>,<br />      <span style="color: #ff0000;">"TradeDate"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"EarningsShare"</span>:<span style="color: #ff0000;">"2.591"</span>,<br />      <span style="color: #ff0000;">"ErrorIndicationreturnedforsymbolchangedinvalid"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"EPSEstimateCurrentYear"</span>:<span style="color: #ff0000;">"2.110"</span>,<br />      <span style="color: #ff0000;">"EPSEstimateNextYear"</span>:<span style="color: #ff0000;">"2.310"</span>,<br />      <span style="color: #ff0000;">"EPSEstimateNextQuarter"</span>:<span style="color: #ff0000;">"0.000"</span>,<br />      <span style="color: #ff0000;">"DaysLow"</span>:<span style="color: #ff0000;">"27.290"</span>,<br />      <span style="color: #ff0000;">"DaysHigh"</span>:<span style="color: #ff0000;">"27.630"</span>,<br />      <span style="color: #ff0000;">"YearLow"</span>:<span style="color: #ff0000;">"27.720"</span>,<br />      <span style="color: #ff0000;">"YearHigh"</span>:<span style="color: #ff0000;">"39.790"</span>,<br />      <span style="color: #ff0000;">"HoldingsGainPercent"</span>:<span style="color: #ff0000;">"- - -"</span>,<br />      <span style="color: #ff0000;">"AnnualizedGain"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"HoldingsGain"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"HoldingsGainPercentRealtime"</span>:<span style="color: #ff0000;">"N/A - N/A"</span>,<br />      <span style="color: #ff0000;">"HoldingsGainRealtime"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"MoreInfo"</span>:<span style="color: #ff0000;">"cnprIed"</span>,<br />      <span style="color: #ff0000;">"OrderBookRealtime"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"MarketCapitalization"</span>:<span style="color: #ff0000;">"145.9B"</span>,<br />      <span style="color: #ff0000;">"MarketCapRealtime"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"EBITDA"</span>:<span style="color: #ff0000;">"29.777B"</span>,<br />      <span style="color: #ff0000;">"ChangeFromYearLow"</span>:<span style="color: #ff0000;">"-0.300"</span>,<br />      <span style="color: #ff0000;">"PercentChangeFromYearLow"</span>:<span style="color: #ff0000;">"-1.08%"</span>,<br />      <span style="color: #ff0000;">"LastTradeRealtimeWithTime"</span>:<span style="color: #ff0000;">"N/A - <b>27.420</b>"</span>,<br />      <span style="color: #ff0000;">"ChangePercentRealtime"</span>:<span style="color: #ff0000;">"N/A - -3.21%"</span>,<br />      <span style="color: #ff0000;">"ChangeFromYearHigh"</span>:<span style="color: #ff0000;">"-12.370"</span>,<br />      <span style="color: #ff0000;">"PercebtChangeFromYearHigh"</span>:<span style="color: #ff0000;">"-31.09%"</span>,<br />      <span style="color: #ff0000;">"LastTradeWithTime"</span>:<span style="color: #ff0000;">"12:10am - <b>27.420</b>"</span>,<br />      <span style="color: #ff0000;">"LastTradePriceOnly"</span>:<span style="color: #ff0000;">"27.420"</span>,<br />      <span style="color: #ff0000;">"HighLimit"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"LowLimit"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"DaysRange"</span>:<span style="color: #ff0000;">"27.290 - 27.630"</span>,<br />      <span style="color: #ff0000;">"DaysRangeRealtime"</span>:<span style="color: #ff0000;">"N/A - N/A"</span>,<br />      <span style="color: #ff0000;">"FiftydayMovingAverage"</span>:<span style="color: #ff0000;">"32.0939"</span>,<br />      <span style="color: #ff0000;">"TwoHundreddayMovingAverage"</span>:<span style="color: #ff0000;">"35.271"</span>,<br />      <span style="color: #ff0000;">"ChangeFromTwoHundreddayMovingAverage"</span>:<span style="color: #ff0000;">"-7.851"</span>,<br />      <span style="color: #ff0000;">"PercentChangeFromTwoHundreddayMovingAverage"</span>:<span style="color: #ff0000;">"-22.26%"</span>,<br />      <span style="color: #ff0000;">"ChangeFromFiftydayMovingAverage"</span>:<span style="color: #ff0000;">"-4.6739"</span>,<br />      <span style="color: #ff0000;">"PercentChangeFromFiftydayMovingAverage"</span>:<span style="color: #ff0000;">"-14.56%"</span><br />      ,<span style="color: #ff0000;">"Name"</span>:<span style="color: #ff0000;">"BHP BLT FPO"</span>,<br />      <span style="color: #ff0000;">"Notes"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"Open"</span>:<span style="color: #ff0000;">"27.530"</span>,<br />      <span style="color: #ff0000;">"PreviousClose"</span>:<span style="color: #ff0000;">"28.330"</span>,<br />      <span style="color: #ff0000;">"PricePaid"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"ChangeinPercent"</span>:<span style="color: #ff0000;">"-3.21%"</span>,<br />      <span style="color: #ff0000;">"PriceSales"</span>:<span style="color: #ff0000;">"2.24"</span>,<br />      <span style="color: #ff0000;">"PriceBook"</span>:<span style="color: #ff0000;">"1.90"</span>,<br />      <span style="color: #ff0000;">"ExDividendDate"</span>:<span style="color: #ff0000;">"Sep  3"</span>,<br />      <span style="color: #ff0000;">"PERatio"</span>:<span style="color: #ff0000;">"10.93"</span>,<br />      <span style="color: #ff0000;">"DividendPayDate"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"PERatioRealtime"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"PEGRatio"</span>:<span style="color: #ff0000;">"3.93"</span>,<br />      <span style="color: #ff0000;">"PriceEPSEstimateCurrentYear"</span>:<span style="color: #ff0000;">"13.43"</span>,<br />      <span style="color: #ff0000;">"PriceEPSEstimateNextYear"</span>:<span style="color: #ff0000;">"12.26"</span>,<br />      <span style="color: #ff0000;">"Symbol"</span>:<span style="color: #ff0000;">"BHP.AX"</span>,<br />      <span style="color: #ff0000;">"SharesOwned"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"ShortRatio"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"LastTradeTime"</span>:<span style="color: #ff0000;">"12:10am"</span>,<br />      <span style="color: #ff0000;">"TickerTrend"</span>:<span style="color: #ff0000;">"&nbsp;======&nbsp;"</span>,<br />      <span style="color: #ff0000;">"OneyrTargetPrice"</span>:<span style="color: #ff0000;">"34.100"</span>,<br />      <span style="color: #ff0000;">"Volume"</span>:<span style="color: #ff0000;">"12587657"</span>,<br />      <span style="color: #ff0000;">"HoldingsValue"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"HoldingsValueRealtime"</span>:<span style="color: #00C800;">null</span>,<br />      <span style="color: #ff0000;">"YearRange"</span>:<span style="color: #ff0000;">"27.720 - 39.790"</span>,<br />      <span style="color: #ff0000;">"DaysValueChange"</span>:<span style="color: #ff0000;">"- - -3.21%"</span>,<br />      <span style="color: #ff0000;">"DaysValueChangeRealtime"</span>:<span style="color: #ff0000;">"N/A - N/A"</span>,<br />      <span style="color: #ff0000;">"StockExchange"</span>:<span style="color: #ff0000;">"ASX"</span>,<br />      <span style="color: #ff0000;">"DividendYield"</span>:<span style="color: #ff0000;">"4.62"</span>,<br />      <span style="color: #ff0000;">"PercentChange"</span>:<span style="color: #ff0000;">"-3.21%"</span><br /><br /> </div>[/code:pwv45238]
to Mastintin : yahoo financial
Thanks I 'll try to make a dialog as Yahoo I wish ask you 3 questions 1) I saw there are two chart for each symbols for a sample : <!-- m --><a class="postlink" href="https://it.finance.yahoo.com/echarts?s=FNC.MI#symbol=FNC.MI;range=1d">https://it.finance.yahoo.com/echarts?s= ... I;range=1d</a><!-- m --> 2) When we can download all quotes for each NAtion ? I saw there are a browse list quotes Sample : <!-- m --><a class="postlink" href="https://it.finance.yahoo.com/q/cp?s=FTSEMIB.MI">https://it.finance.yahoo.com/q/cp?s=FTSEMIB.MI</a><!-- m --> or <!-- m --><a class="postlink" href="https://es.finance.yahoo.com/q/cp?s=FTSEMIB.MI">https://es.finance.yahoo.com/q/cp?s=FTSEMIB.MI</a><!-- m --> and the values are changed on line ... Symbol Name Variation Volume 3) with this url sample for IBM <!-- m --><a class="postlink" href="https://es.finance.yahoo.com/q/h?s=IBM&t=2014-12-09T17:03:00+01:00">https://es.finance.yahoo.com/q/h?s=IBM& ... 3:00+01:00</a><!-- m --> we can have all news for each symbol If it return a array we can use a xbrowse to list all news the I can make a Rss reader
to Mastintin : yahoo financial
Silvio , more in Charts ....Technical Indicators ... creo que lo que me enseñas son 2 imagenes distintas con dos graficos distintos . uno enseña cotizacion con &q="l" y el otro enseña Volumen &p=v&q=b ... use "&p=" in the url .... Values for p= Stochastic fs Moving-Average-Convergence-Divergence m26-12-9 Money Flow Index f14 Rate of Change p12 Relative Strength Index r14 Slow Stochastic ss Volume v Volume with Moving Average vm Williams Percent Range w14 Bollinger Bands b Parabolic Stop And Reverse p Splits s
to Mastintin : yahoo financial
Manuel, Sorry for the delay I not found youe mail , can you write a message at my mail please silvio[dot]falconi[at]gmail[dot]com thanks
to Mr Nages : Import Excel into Xbrowse
Someone have asample to import a excel sheet into xbrowse ? I saw a sample but not run [code=fw:2h8kvddg]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> oRange, aData<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;oRange &nbsp; := GetExcelRange<span style="color: #000000;">&#40;</span> ExePath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"Articoli"</span>, <span style="color: #ff0000;">"ArrayTest"</span>,<span style="color: #ff0000;">"A1:B6"</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;aData &nbsp; &nbsp;:= ArrTranspose<span style="color: #000000;">&#40;</span> oRange:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oRange:<span style="color: #000000;">WorkSheet</span>:<span style="color: #000000;">Parent</span>:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">function</span> ExePath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> cFilePath<span style="color: #000000;">&#40;</span> GetModuleFileName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2h8kvddg] I must converte this from A1 to BH50 [img:2h8kvddg]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2015/11/ff&#46;jpg[/img:2h8kvddg]
to Mr Nages : Import Excel into Xbrowse
SIlvo Consider this code .. Rick Lipkin [code=fw:124sic8d]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//------------------------------------</span><br /><span style="color: #00C800;">Static</span> Func _DoIt<span style="color: #000000;">&#40;</span>oRsInvt <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> SITEDBF, DBF_STRU<br /><span style="color: #00C800;">LOCAL</span> oEXCEL,nROW, nROWS,nCOL,nCOLS, oBOOK, xVALUE<br /><span style="color: #00C800;">LOCAL</span> nREC<br /><span style="color: #00C800;">LOCAL</span> oDLG1,oLBX1,oBTN1,oBTN2<br /><span style="color: #00C800;">LOCAL</span> cALIAS<br /><br />cSAY := <span style="color: #ff0000;">"Creating Temporary files"</span><br />oSAY:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> .T.<br />&nbsp; &nbsp;SITEDBF := <span style="color: #ff0000;">"TEMP"</span>+<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>TIME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">7</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>TIME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">".DBF"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> .not. FILE<span style="color: #000000;">&#40;</span> xVOL+<span style="color: #ff0000;">"<span style="color: #000000;">\D</span>BTMP<span style="color: #000000;">\"</span>+SITEDBF )<br />&nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp;ENDIF<br />ENDDO<br /><br />DBF_STRU := { }<br />AADD( DBF_STRU, { "</span>AGENCY<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp; 5, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>USER<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;30, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>PHONE<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp;"</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>DECAL<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp;"</span>C<span style="color: #ff0000;">", &nbsp; 7, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>TYPE<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;35, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>SERNO<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp;"</span>C<span style="color: #ff0000;">", &nbsp;20, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>CLASSIF<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp;"</span>N<span style="color: #ff0000;">", &nbsp;15, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>MODELYR<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp;"</span>N<span style="color: #ff0000;">", &nbsp; 7, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>MAKE<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>MANUFACT<span style="color: #ff0000;">", &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>STREET<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>CITY<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>COST<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp; "</span>N<span style="color: #ff0000;">", &nbsp;10, &nbsp;2 } )<br />AADD( DBF_STRU, { "</span>ACQUIRED<span style="color: #ff0000;">", &nbsp; &nbsp; "</span>N<span style="color: #ff0000;">", &nbsp; 7, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>PURCHASE<span style="color: #ff0000;">", &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;10, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>ROOM<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp; 7, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>SECTION<span style="color: #ff0000;">", &nbsp; &nbsp; &nbsp;"</span>C<span style="color: #ff0000;">", &nbsp; 8, &nbsp;0 } )<br />AADD( DBF_STRU, { "</span>DATE_RCVD<span style="color: #ff0000;">", &nbsp; &nbsp;"</span>D<span style="color: #ff0000;">", &nbsp; 8, &nbsp;0 } )<br /><br /><br />DBCREATE( xVOL+"</span>\DBTMP\<span style="color: #ff0000;">"+SITEDBF, DBF_STRU )<br /><br />SELECT 9<br />IF NETUSE( xVOL+"</span>\DBTMP\<span style="color: #ff0000;">"+SITEDBF, .T.,5)<br />ELSE<br />&nbsp; &nbsp;SELECT( GOBACK )<br />&nbsp; &nbsp;_Cleanup()<br />&nbsp; &nbsp;RETURN(.F.)<br />ENDIF<br /><br />nREC := 0<br /><br />cSAY := "</span>Opening Excel File <span style="color: #ff0000;">"+STR(nREC)<br />oSAY:ReFresh()<br />SysReFresh()<br /><br />oEXCEL := TOleAuto():New( "</span>Excel.Application<span style="color: #ff0000;">" )<br />oExcel:Workbooks:Open( cPATH )<br /><br />oBook := oExcel:Get( "</span>ActiveSheet<span style="color: #ff0000;">" )<br />nROWS := oBook:UsedRange:Rows:Count()<br />nCOLS := oBook:UsedRange:Columns:Count()<br /><br />SELECT 9<br />FOR nROW := 2 to nROWS<br />&nbsp; &nbsp;APPEND BLANK<br />&nbsp; &nbsp;FOR nCOL := 1 to 15 //nCOLS<br />&nbsp; &nbsp; &nbsp; xVALUE := oBook:Cells( nROW, nCOL):Value<br />&nbsp; &nbsp; &nbsp; FieldPut( nCol,xValue )<br /><br />&nbsp; &nbsp; &nbsp; nREC++<br />&nbsp; &nbsp; &nbsp; cSAY := "</span>Opening Excel File <span style="color: #ff0000;">"+STR(nREC)<br />&nbsp; &nbsp; &nbsp; oSAY:ReFresh()<br />&nbsp; &nbsp; &nbsp; SysReFresh()<br /><br />&nbsp; &nbsp;NEXT<br />NEXT<br /><br />SELECT 9<br />dbCommit()<br /><br />oExcel:Quit()<br /><br />SELECT 9<br />GO TOP<br /><br />xBrowse()<br /><br />CLose databases<br /><br />Return(.t.)<br /></span></div>[/code:124sic8d]
to Mr Nages : Import Excel into Xbrowse
Rick. Thanks for sharing your code. Regards.
to Mr Nages : Import Excel into Xbrowse
Esta es la forma en que lo hago desde Excel a Mysql, espero les sirva , saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> [code=fw:1th8t4da]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROCEDURE excel_tabla<span style="color: #000000;">&#40;</span> oMeter, oText, oDlg, lEnd, cFileXls <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oExcel, oBook, nRows, nCols, nCol, nRow, oError, cSql<br /><br />&nbsp; &nbsp;oExcel := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Excel.Application"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ACTIVANDO EXCEL</span><br />&nbsp; &nbsp;oExcel:<span style="color: #000000;">Workbooks</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cFileXls <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ABRO EL ARCHIVO SELECCIONADO</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp;oBook := oExcel:<span style="color: #0000ff;">Get</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ActiveSheet"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ACTIVO HOJA EXCEL</span><br />&nbsp; &nbsp;nRows := oBook:<span style="color: #000000;">UsedRange</span>:<span style="color: #000000;">Rows</span>:<span style="color: #0000ff;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// CANTIDAD LINEAS EXCEL INCLUYENDO LA LINEA 1 QUE ES LA CABECERA</span><br />&nbsp; &nbsp;nCols := oBook:<span style="color: #000000;">UsedRange</span>:<span style="color: #000000;">Columns</span>:<span style="color: #0000ff;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// CANTIDAD COLUMNAS EXCEL</span><br /><br />&nbsp; &nbsp;oMeter:<span style="color: #000000;">nTotal</span> = nRows <span style="color: #B900B9;">// PASO AL METER TOTAL DE LINEAS</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">FOR</span> nRow = <span style="color: #000000;">2</span> <span style="color: #0000ff;">TO</span> nRows <span style="color: #B900B9;">// CARGANDO DE EXCEL TABLA REPORTES</span><br />&nbsp; &nbsp; &nbsp; cSql := <span style="color: #ff0000;">"INSERT INTO servicios_reportes SET "</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_nombre_cliente='"</span> + oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> + <span style="color: #ff0000;">"', "</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_num_reporte="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_equipo_cliente="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><span style="color: #B900B9;">// ojo - esta columna esta llegando de tipo numerica</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_num_serial="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> <span style="color: #B900B9;">// 18/12/2014</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_num_llamada="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_preventivo="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> <span style="color: #B900B9;">// SIEMPRE ES PREVENTIVO - COL.6 DE EXCEL</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_tiempo_viaje_inicio="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_tiempo_viaje_fin="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_tiempo_espera_inicio="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_tiempo_espera_fin="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_tiempo_rep_inicio="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_tiempo_rep_fin="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_localidad="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> +; <span style="color: #B900B9;">// COL.10 y 11</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">", "</span> + AllTrim<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">11</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_estado="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">11</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> <span style="color: #B900B9;">// 05/01/2015</span><br /><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_codi_ingeniero="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">12</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <= <span style="color: #000000;">50</span> <span style="color: #B900B9;">// DESDE 1-50</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql += <span style="color: #ff0000;">"rep_observa1="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1</span>, Len<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql += <span style="color: #ff0000;">"rep_observa1="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">50</span> .and. LEN<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <= <span style="color: #000000;">110</span> <span style="color: #B900B9;">// DESDE 51-110</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql += <span style="color: #ff0000;">"rep_observa2="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">51</span>, Len<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span> <span style="color: #B900B9;">// DESDE 111-170</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql += <span style="color: #ff0000;">"rep_observa2="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">51</span>, <span style="color: #000000;">110</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql += <span style="color: #ff0000;">"rep_observa3="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">111</span>, Len<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_np1="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">14</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SUBST<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">14</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_np2="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SUBST<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><span style="color: #B900B9;">//</span><br />*** COL <span style="color: #000000;">16</span> - FECHA DE IMPRESION<br />cSql += <span style="color: #ff0000;">"rep_fch_impresion='"</span> + oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">16</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> + <span style="color: #ff0000;">"', "</span><br />*** COL <span style="color: #000000;">17</span> - TIPO DE ZONA<br />cSql += <span style="color: #ff0000;">"rep_tipo_zona='"</span> + oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">17</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> + <span style="color: #ff0000;">"', "</span><br />*** COL <span style="color: #000000;">18</span> - SERVICIO<br />cSql += <span style="color: #ff0000;">"rep_servicio='"</span> + oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">18</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> + <span style="color: #ff0000;">"', "</span><br />*** COL <span style="color: #000000;">19</span> - TARIFA<br />cSql += <span style="color: #ff0000;">"rep_tarifa="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">19</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"rep_fch_emision="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br /><span style="color: #B900B9;">// AUDITORIA</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"usuario="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"00"</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"hora="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; cSql += <span style="color: #ff0000;">"fchcrea="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDatos:<span style="color: #000000;">oConex</span>:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cSql <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; CATCH oError<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MSGALERT<span style="color: #000000;">&#40;</span> oError:<span style="color: #000000;">Description</span> + CRLF + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Error Grabando en Tabla servicios_reportes, Sentencia"</span> + CRLF + CRLF + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cSql, oDatos:<span style="color: #000000;">cTitMsg</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; END<br /><br />&nbsp; &nbsp; &nbsp; oMeter:<span style="color: #000000;">Set</span><span style="color: #000000;">&#40;</span> nRow <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #B900B9;">// CERRANDO EXCEL</span><br />&nbsp; &nbsp;oExcel:<span style="color: #000000;">WorkBooks</span>:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oExcel:<span style="color: #000000;">Application</span>:<span style="color: #000000;">Quit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oExcel:<span style="color: #000000;">Quit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oExcel := <span style="color: #00C800;">Nil</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> nRows <span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" Reportes Importados Correctamente"</span>, oDatos:<span style="color: #000000;">cTitMsg</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><br />&nbsp;</div>[/code:1th8t4da]
to Mr Nages : Import Excel into Xbrowse
Jose Luis. Thanks
to Mr Nages : Import Excel into Xbrowse
But why not exist a general function ? I must make a Prg for each dbf ?
to Mr Nages : Import Excel into Xbrowse
[quote="Silvio.Falconi":c2mr5ape]But why not exist a general function ? I must make a Prg for each dbf ?[/quote:c2mr5ape] Buen dia, no se si existe una funcion, pero podrias leyendo la hoja de excel, crearte un array con las cabezeras de las columnas, y basado en ello crear las dbf con sus campos por dicho array y luego hacer la importacion, tambien puedes crear un array con los nombres de los libros y leerlos uno por uno, como es mi caso, cualquier duda estoy a la orden, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
to Mr Nages : Import Excel into Xbrowse
Hi to all! You know what? The funniest thing is: SILVIO´S ROUTINE DOES WORK! Only have to put the right xls and worksheet names. Thanks for the info! It is an excellent general purpose routine. <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) --> Euclides
to Mr Nages : Import Excel into Xbrowse
[quote="Euclides":2amyduu2]Hi to all! You know what? The funniest thing is: SILVIO´S ROUTINE DOES WORK! Only have to put the right xls and worksheet names. Thanks for the info! It is an excellent general purpose routine. <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) --> Euclides[/quote:2amyduu2] <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=31574">viewtopic.php?f=3&t=31574</a><!-- l --> IMPORTANTE <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=29989&p=170683&hilit=FW_ExcelToDBF#p170683">viewtopic.php?f=3&t=29989&p=170683&hilit=FW_ExcelToDBF#p170683</a><!-- l -->
to Mr Nages : Import Excel into Xbrowse
1) We can read Excel Range into an Array and browse. Mr Silvio: The sample you posted should work. Please check if your paramters are correct or not. 2) We can *directly* browse an Excel Range in XBrowse and even make changes to Excel sheet through XBrowse. [code=fw:2ckyh068]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;oRange := GetExcelRange<span style="color: #000000;">&#40;</span> cExcelFile, <span style="color: #000000;">&#91;</span>cSheet<span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span>cRange<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ r,c, <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> w,h <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd DATASOURCE oRange <span style="color: #0000ff;">AUTOCOLS</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2ckyh068] 3) We can also import a range from Excel to DBF with function [code=fw:2ckyh068]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;oRange := GetExcelRange<span style="color: #000000;">&#40;</span> cExcelFile, <span style="color: #000000;">&#91;</span>cSheet<span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span>cRange<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;FW_ExcelToDbf<span style="color: #000000;">&#40;</span> oRange, cFieldList, lHasHeaders, bProgress <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2ckyh068]
to Mr Nages : Import Excel into Xbrowse
Mr Jose Luis I suggest simplification and general function [code=fw:4r4qzio9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#xtranslate SQL INSERT INTO <tbl> <span style="color: #000000;">&#40;</span> <cols,...> <span style="color: #000000;">&#41;</span> ARRAY <a> => ;<br /><span style="color: #ff0000;">"INSERT INTO "</span> + <<span style="color: #000000;">&#40;</span>tbl<span style="color: #000000;">&#41;</span>> + <span style="color: #ff0000;">" ( "</span> + &nbsp;FW_QuotedColSQL<span style="color: #000000;">&#40;</span> #<cols> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" ) "</span> + <span style="color: #ff0000;">" VALUES "</span> + ;<br />&nbsp;StrTran<span style="color: #000000;">&#40;</span> StrTran<span style="color: #000000;">&#40;</span> FW_ValToSql<span style="color: #000000;">&#40;</span> AClone<span style="color: #000000;">&#40;</span> <a> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'( ('</span>, <span style="color: #ff0000;">'('</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">') )'</span>, <span style="color: #ff0000;">')'</span> <span style="color: #000000;">&#41;</span><br /><br />#xtranslate SQL INSERT INTO <tbl> ARRAY <a> => ;<br /><span style="color: #ff0000;">"INSERT INTO "</span> + <<span style="color: #000000;">&#40;</span>tbl<span style="color: #000000;">&#41;</span>> + <span style="color: #ff0000;">" VALUES "</span> + ;<br />&nbsp;StrTran<span style="color: #000000;">&#40;</span> StrTran<span style="color: #000000;">&#40;</span> FW_ValToSql<span style="color: #000000;">&#40;</span> AClone<span style="color: #000000;">&#40;</span> <a> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'( ('</span>, <span style="color: #ff0000;">'('</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">') )'</span>, <span style="color: #ff0000;">')'</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">// note: These translates are available in FWH15.10</span><br /><span style="color: #B900B9;">//------------------------------------</span><br /><br />&nbsp; oRange := GetExcelRange<span style="color: #000000;">&#40;</span> cExcelFile, <span style="color: #000000;">&#91;</span>cSheet<span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span>cRange<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; aData &nbsp;:= ArrTranspose<span style="color: #000000;">&#40;</span> oRange:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span><br />&nbsp; cSql := INSERT INTO MyTable ARRAY aData<br />&nbsp; oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cSql <span style="color: #000000;">&#41;</span> <br />&nbsp;</div>[/code:4r4qzio9]
to Mr Nages : Import Excel into Xbrowse
Mr Nages, [code=fw:2ru79gkc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">Local</span> oRange,lOpened:=.f.<br />&nbsp; &nbsp; &nbsp; oRange &nbsp; := GetExcelRange<span style="color: #000000;">&#40;</span> ExePath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"PRODOTTI.xls"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; USE ARTICOLI <span style="color: #0000ff;">ALIAS</span> AR<br />&nbsp; &nbsp; <span style="color: #0000ff;">SELECT</span> AR<br /><br />&nbsp; &nbsp; FW_ExcelToDBF<span style="color: #000000;">&#40;</span> oRange, <span style="color: #00C800;">nil</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;oRange &nbsp; := <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> ExePath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> cFilePath<span style="color: #000000;">&#40;</span> GetModuleFileName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:2ru79gkc] here run ok but ....How can you do to keep the existing values on Dbf when importing empty cells?
to Mr Nages xbrowse footer
It is possible create two lines of xbrowser footer ? in first line we can insert a text and on second the data numeric with maketotals ? [img:1gjfh633]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2014/05/MUTUO_QUESTION&#46;jpg[/img:1gjfh633] I insert the text after the xbrowse now because I not Know how insert a line text before the footer xbrowse
to Mr Nages xbrowse footer
Use Mr Carlos extension in the posting <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=28488">viewtopic.php?f=3&t=28488</a><!-- l --> and oCol:cFooterPicture := "YOURTEXT" + CRLF + "9999999" oCol:nFooterLines := 2
to Mr Nages xbrowse footer
it make me error Error occurred at: 26-05-2014, 10:47:16 Error description: Warning BASE/1005 Message not found: TXBRWCOLUMN:_NFOOTERLINES Stack Calls =========== Called from: source\rtl\tobject.prg => TXBRWCOLUMN:ERROR( 0 ) Called from: source\rtl\tobject.prg => TXBRWCOLUMN:MSGNOTFOUND( 0 ) Called from: source\rtl\tobject.prg => TXBRWCOLUMN:_NFOOTERLINES( 0 ) Called from: source\ut\ut_mutuo.prg => CREATEBRW( 216 ) Called from: source\ut\ut_mutuo.prg => CALCOLOMUTUO( 136 ) IF I ADD EXTEND CLASS TXBRWCOLUMN WITH DATA nFooterLines it run but on footer I not see anything this is source cPict is a static variable cPict:="999,999.99" [code=fw:hnlbtedh]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Static</span>  <span style="color: #00C800;">Function</span> CreateBrw<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />EXTEND <span style="color: #00C800;">CLASS</span> TXBRWCOLUMN WITH <span style="color: #00C800;">DATA</span> cFooterPicture<br />EXTEND <span style="color: #00C800;">CLASS</span> TXBRWCOLUMN WITH <span style="color: #00C800;">DATA</span> nFooterLines<br /><br />OVERRIDE <span style="color: #00C800;">METHOD</span> FOOTERSTR IN <span style="color: #00C800;">CLASS</span> TXBRWCOLUMN WITH KFOOTERSTR<br /><br /><br />   @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">adialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>              ;<br />      COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>                    ;<br />      HEADERS <span style="color: #ff0000;">"Num."</span>,<span style="color: #ff0000;">"Rata"</span>,<span style="color: #ff0000;">"Quota Capitale"</span>,<span style="color: #ff0000;">"Quota interessi"</span>,<span style="color: #ff0000;">"Capitale residuo"</span>   ;<br />      COLSIZES <span style="color: #000000;">30</span>, <span style="color: #000000;">80</span>, <span style="color: #000000;">110</span>, <span style="color: #000000;">110</span>,<span style="color: #000000;">110</span>           ;<br />      ARRAY <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span> LINES FASTEDIT  <span style="color: #0000ff;">SIZE</span> oFld:<span style="color: #000000;">adialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nwidth</span><span style="color: #000000;">-3</span>, oFld:<span style="color: #000000;">adialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nheight</span><span style="color: #000000;">-16</span> <span style="color: #0000ff;">PIXEL</span>  NOBORDER<br /><br /><br /><br /><br /><br /><br /><br /><br />                   WITH OBJECT oBrw<br />                          :<span style="color: #000000;">lHScroll</span>         := .F.<br />                          :<span style="color: #000000;">nMarqueeStyle</span>    := MARQSTYLE_HIGHLWIN7<br /><br /><br />                                             WITH OBJECT   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />                                                  :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />                                                <span style="color: #B900B9;">//  :cEditPicture := cPict</span><br />                                                  :<span style="color: #000000;">lTotal</span> := .t.<br />                                                  :<span style="color: #000000;">nTotal</span> :=<span style="color: #000000;">0</span><br />                                                  :<span style="color: #000000;">nFooterType</span> := AGGR_SUM<br />                                                  :<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT<br />                                                 <br />                                                  :<span style="color: #000000;">cFooterPicture</span> := <span style="color: #ff0000;">"Capitale Rimborsato"</span> + CRLF + cPict<br />                                               END<br /><br />                                              WITH OBJECT   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><br />                                                  :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />                                                  :<span style="color: #000000;">cEditPicture</span> := cPict<br />                                                  :<span style="color: #000000;">lTotal</span> := .t.<br />                                                  :<span style="color: #000000;">nTotal</span> :=<span style="color: #000000;">0</span><br />                                                  :<span style="color: #000000;">nFooterType</span> := AGGR_SUM<br />                                                  :<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT<br />                                               END<br />                                              WITH OBJECT   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span><br />                                                  :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />                                                  :<span style="color: #000000;">cEditPicture</span> := cPict<br />                                                  :<span style="color: #000000;">lTotal</span> := .t.<br />                                                  :<span style="color: #000000;">nTotal</span> :=<span style="color: #000000;">0</span><br />                                                  :<span style="color: #000000;">nFooterType</span> := AGGR_SUM<br />                                                  :<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT<br />                                               END<br /><br />                                               WITH OBJECT   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span><br />                                                  :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />                                                  :<span style="color: #000000;">cEditPicture</span> := cPict<br />                                               END<br /><br /><br /><br />                          :<span style="color: #000000;">lFooter</span>:=.t.<br />                          :<span style="color: #000000;">nFooterLines</span> := <span style="color: #000000;">2</span><br />                          :<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                          :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                   END<br /><br /><br /><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:hnlbtedh] [img:hnlbtedh]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2014/05/err_xb&#46;jpg[/img:hnlbtedh] I see on footer two lines but it not print the text but only the number I'm afraid it run ok with dbf but in my case I have an array data
to Mr Nages xbrowse footer
Any solution please ?
to Mr Nages xbrowse footer
Try ADD oCol TO oBrw DATA ARRAY ELEMENT 3 ; HEADER "Column 2" ; SIZE 120 ; PICTURE "99999" ; EDITABLE ; TOTAL 0 ; FOOTER { |oCol,nNew,nOld| "Test: " + CRLF + TRANSFORM( oCol:nTotal += ( IfNil( nNew, 0 ) - IfNil( nOld, 0 ) ), "99999999" ) } oBrw:nFooterLines := 2 BTW take care (if you use ADD oCol) xbrowse.ch have BUG [quote:1aru5620]in xbrowse.ch, line 196 is now CODE: SELECT ALL EXPAND VIEW <.lite.>, <nOrder>, <nAt>, <nBmpElem>, [\{ <aBmp> \}], <.hide.>,, ; The two commas at the end of the line should be made as one comma only like this: CODE: SELECT ALL EXPAND VIEW <.lite.>, <nOrder>, <nAt>, <nBmpElem>, [\{ <aBmp> \}], <.hide.>, ; [/quote:1aru5620]
to Mr Nages xbrowse footer
Tested ?
to Mr Nages xbrowse footer
sorry But I have an oldest version
to Mr Nages xbrowse footer
[quote="Silvio.Falconi":3os63zi3]sorry But I have an oldest version[/quote:3os63zi3] What is your version?
to Mr Nages xbrowse footer
9.10
to Mr. Nages - xBrowse and LetoRDD
[quote="lucasdebeltran":2wbil6tq]Hola, Tienes que usar un cliente cvs, por ejemplo tortoise, o este: <!-- m --><a class="postlink" href="http://www.syntevo.com/smartcvs/download.html">http://www.syntevo.com/smartcvs/download.html</a><!-- m --> Y ejecutar el comando. Luego, tienes los .bat según el compilador de Harbour y C. En samples tienes ejemplos. Y en el blog de Biel tienes un artículo: <!-- m --><a class="postlink" href="http://bielsys.blogspot.com/2008/07/letodb-rdd-cliente-servidor-para.html">http://bielsys.blogspot.com/2008/07/let ... -para.html</a><!-- m --> LetoDB es una pasada. Estoy haciendo pruebas con mi aplicación y no he tenido que tocar apenas nada de código. Un saludo[/quote:2wbil6tq] Gracias Lucas, Estas probando en una Intranet o sales a Internet? Si estás saliendo a Internet, que características debe soportar el servidor para poder usar LeToDB? Es público? Es tuyo? Gracias,
to Mr. Nages - xBrowse and LetoRDD
Hello, I am testing LetoDb RDD via Internet and xBrowse is a bit slow. But other functions (append, filter, locate, REPORT, FAST REPORT) do very well. Is there any way to increase speed of xBrowse?. Thank you very much. Best regads, Lucas
to Mr. Nages - xBrowse and LetoRDD
Hola Lucas, Veo que estas trabajando con LETODB, podrías decirme dónde lo has bajado? Quiero probarlo y ver que tal va, como se integra en Harbour+FWH, etc. He visto que indicabas el uso de "csv" para obtenerlo, pero nunca he sabido como usar esta "herramienta" (en este aspecto soy bastante ignorante). Saludos Carlos G.
to Mr. Nages - xBrowse and LetoRDD
Hola, Tienes que usar un cliente cvs, por ejemplo tortoise, o este: <!-- m --><a class="postlink" href="http://www.syntevo.com/smartcvs/download.html">http://www.syntevo.com/smartcvs/download.html</a><!-- m --> Y ejecutar el comando. Luego, tienes los .bat según el compilador de Harbour y C. En samples tienes ejemplos. Y en el blog de Biel tienes un artículo: <!-- m --><a class="postlink" href="http://bielsys.blogspot.com/2008/07/letodb-rdd-cliente-servidor-para.html">http://bielsys.blogspot.com/2008/07/let ... -para.html</a><!-- m --> LetoDB es una pasada. Estoy haciendo pruebas con mi aplicación y no he tenido que tocar apenas nada de código. Un saludo
to Mr. Nages - xBrowse and LetoRDD
Hi, We have a Windows 2008 hired at an ISP. Yes, I am accesing data via Internet.
to Mr. Nages - xBrowse and LetoRDD
Hello, Please, any clue?. Thank you very much!!!!!!
to Mr. Nages - xBrowse and LetoRDD
Mr.Lucas, Can you please share the reqired LIB file(s) and the test program ? I am using xHarbour 1.2.1 (Simplex) + FWH + BCC582 Regards, - Ramesh Babu P
to Mr. Nages - xBrowse and LetoRDD
Hello, Thanks for reply. Sure. To download leto: [code=fw:22u3847r]<div class="fw" id="{CB}" style="font-family: monospace;">cvs -d:<span style="color: #000000;">pserver</span>:<span style="color: #000000;">anonymous</span>@letodb.cvs.sourceforge.net:/cvsroot/letodb checkout -r rel<span style="color: #000000;">-1</span>-mt letodb</div>[/code:22u3847r] Here is a cvs.exe: <!-- m --><a class="postlink" href="http://bitshare.com/files/685v2mh1/cvs.exe.html">http://bitshare.com/files/685v2mh1/cvs.exe.html</a><!-- m --> To build server and lib, there are bats at letodir. This is a sample: [code=fw:22u3847r]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">Local</span> cPath := <span style="color: #ff0000;">"//127.0.0.1:2812/letodb/"</span><br /><br />&nbsp; &nbsp;REQUEST LETO, DBFCDX<br /><br />&nbsp; &nbsp;RDDSETDEFAULT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"LETO"</span> <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> leto_Connect<span style="color: #000000;">&#40;</span> cPath <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">-1</span> &nbsp; <span style="color: #B900B9;">// check errors</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Can't connect to server ..."</span>+CRLF+CRLF+<span style="color: #ff0000;">"Error: "</span>+cValToChar<span style="color: #000000;">&#40;</span>LETO_CONNECT_ERR<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;quit<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><br /><br /><br />&nbsp; &nbsp;use <span style="color: #000000;">&#40;</span> cPath+<span style="color: #ff0000;">"customer"</span> <span style="color: #000000;">&#41;</span> SHARED <span style="color: #00C800;">New</span><br />&nbsp; &nbsp;dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;dbcloseall<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; QUIT<br /><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span></div>[/code:22u3847r] To this sample, add rddleto.lib. I can also provide access to a public internet server. If interested, please indicate me your mail. Using leto in local mode works very fast. The problem is when accesing data via Internet, particulary xBrowse. The rest of opperations (APPEND, LOCATE, SEEK, SET FILTER, ...) do very well via Internet, but not xBrowse. Thank you very much. Best regards, Lucas
to Mr. Nages - xBrowse and LetoRDD
Dear Lucas, I am really interesting, could you give the internet example. I try to compile Leto Server but it do nothing. I use make_b32.bat with BCC55. [code=fw:3c3jhnpk]<div class="fw" id="{CB}" style="font-family: monospace;"><br />D:\letodb>make_b32<br /><br />                      PBMake <span style="color: #000000;">2</span>.17G  <span style="color: #00C800;">for</span> Clipper, C and ASM<br />                   ?????????????????????????????????????????<br />       Copyright <span style="color: #000000;">&#40;</span>C<span style="color: #000000;">&#41;</span> <span style="color: #000000;">1995</span><span style="color: #000000;">-98</span> Phil Barnett, All Rights Reserved Worldwide<br /><br />Make File -L.MAK was not found<br /> </div>[/code:3c3jhnpk] The mistake must be this line [code=fw:3c3jhnpk]<div class="fw" id="{CB}" style="font-family: monospace;"><br />make -l EXE_OBJ_DIR=obj\b32\bin OBJ_DIR=obj\b32 -fmakefile.bc %<span style="color: #000000;">1</span> %<span style="color: #000000;">2</span> %<span style="color: #000000;">3</span> > make_b32.log<br /> </div>[/code:3c3jhnpk] How do I get it? Thanks, Dutch
to Mr. Nages - xBrowse and LetoRDD
Dear Lucas, I've got the new error. I use HARBOUR 3.1 from FW and BCC582. [quote:30aq6mn0] MAKE Version 5.2 Copyright (c) 1987, 2000 Borland IF EXIST "bin\letodb.exe" del "bin\letodb.exe" > NUL bcc32 @MAKE0001.@@@ Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland Error: Unresolved external '_HB_FUN_HB_CODEPAGE_HR437' referenced from D:\LETODB\OBJ\B32\SERVER.OBJ Error: Unresolved external '_HB_FUN_HB_CODEPAGE_RUWIN' referenced from D:\LETODB\OBJ\B32\SERVER.OBJ Error: Unresolved external '_HB_FUN___CLSACTIVE' referenced from D:\LETODB\OBJ\B32\SERVER.OBJ Error: Unresolved external '_hb_retcAdopt' referenced from D:\LETODB\OBJ\B32\LETOFUNC.OBJ Error: Unresolved external '_hb_itemPutDTL' referenced from D:\LETODB\OBJ\B32\LETOFUNC.OBJ Error: Unresolved external '_hb_GetSetStructPtr' referenced from D:\LETODB\OBJ\B32\LETOFUNC.OBJ [/quote:30aq6mn0]
to Mr. Nages - xBrowse and LetoRDD
Hello, I use Harbour 3.1 and BCC 5.8.2 and I built it without problem using make_b32.bat Please check paths at makefile.bc I choose SRV_MODE = __CONSOLE__ Hope it helps. Regards,
to Mr. Nages - xBrowse and LetoRDD
Dear Lucas, I try as your mention, change in Makefile.bc and I use Harbour 3.1 and BCC582 too. I've got error as below. [quote:92k4eg7v]MAKE Version 5.2 Copyright (c) 1987, 2000 Borland bcc32 -c -Iinclude;D:\HARBOUR\include -d -tWM -D__WIN32__ -D__CONSOLE__ -oobj\b32\leto1.obj source\client\leto1.c Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland source\client\leto1.c: Warning W8075 source\client\leto1.c 442: Suspicious pointer conversion in function leto_ConnectionNew Error E2451 source\client\leto1.c 2218: Undefined symbol 'UINT16' in function letoPutValue Error E2293 source\client\leto1.c 2218: ) expected in function letoPutValue Warning W8065 source\client\leto1.c 4945: Call to function 'ISNUM' with no prototype in function HB_FUN_LETO_BEGINTRANSACTION Warning W8065 source\client\leto1.c 4962: Call to function 'ISNIL' with no prototype in function HB_FUN_LETO_ROLLBACK Warning W8065 source\client\leto1.c 4962: Call to function 'ISLOG' with no prototype in function HB_FUN_LETO_ROLLBACK Warning W8065 source\client\leto1.c 4982: Call to function 'ISLOG' with no prototype in function HB_FUN_LETO_COMMITTRANSACTION Warning W8065 source\client\leto1.c 5029: Call to function 'ISCHAR' with no prototype in function HB_FUN_LETO_SUM Warning W8065 source\client\leto1.c 5038: Call to function 'ISCHAR' with no prototype in function HB_FUN_LETO_SUM Warning W8065 source\client\leto1.c 5185: Call to function 'ISNIL' with no prototype in function HB_FUN_LETO_SETFASTAPPEND Warning W8065 source\client\leto1.c 5196: Call to function 'ISCHAR' with no prototype in function HB_FUN_LETO_CLOSEALL *** 2 errors in Compile *** ** error 1 ** deleting obj\b32\leto1.obj[/quote:92k4eg7v] [quote="lucasdebeltran":92k4eg7v]Hello, I use Harbour 3.1 and BCC 5.8.2 and I built it without problem using make_b32.bat Please check paths at makefile.bc I choose SRV_MODE = __CONSOLE__ Hope it helps. Regards,[/quote:92k4eg7v]
to Mr. Nages - xBrowse and LetoRDD
Dutch, How do you get Leto source code?. It seems you are using an old version, as in latest 2.43 ISNIL, etc calls are properly converted to HB_ISNILL. Best regards,
to Mr. Nages - xBrowse and LetoRDD
I downloade from SourceForge.net. [url:13y5pab4]http&#58;//letodb&#46;cvs&#46;sourceforge&#46;net/viewvc/letodb/[/url:13y5pab4] Where do I get the latest version? Regards, Dutch
to Mr. Nages - xBrowse and LetoRDD
Please, use this command: cvs -d:pserver:[email protected]:/cvsroot/letodb checkout -r rel-1-mt letodb You are not downloading the latest version. The same happened to me at first time.
to Mr. Nages - xBrowse and LetoRDD
excuse me, I download that link and get in letodb directory four .bat, I use make_b32.bat and i get several errors, I use make_xhb but i don't have xhb.exe. can you help me please?
to Mr. Rao
Mr. Rao: I would like to know if this code is correct to use xBrowse: [code=fw:bwkvp6p4]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;@ <span style="color: #000000;">14</span>,<span style="color: #000000;">72</span> <span style="color: #0000ff;">XBROWSE</span> oVMenuBrowse <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-21</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CUST"</span> <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PICTURES <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"999-999999999"</span><br /><br />&nbsp; &nbsp;oVMenuBrowse:<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">7</span> &nbsp;<span style="color: #B900B9;">//CELL</span><br />&nbsp; &nbsp;oVMenuBrowse:<span style="color: #000000;">nColDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oVMenuBrowse:<span style="color: #000000;">lColDividerComplete</span> := .T.<br />&nbsp; &nbsp;oVMenuBrowse:<span style="color: #000000;">nHeaderLines</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">1.5</span><br /><br /><br />&nbsp; &nbsp;oVMenuBrowse:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:bwkvp6p4] Do I have to use SetRdd()? If I want to use ADS, do I have to add anything else?. Thank you very much.
to Mr. Rao
The code is ok. [quote:386cf9i9]Do I have to use SetRdd()? [/quote:386cf9i9] No. XBROWSE command does what all necessary, including SetRDD in the correct manner. You should not again use SetRDD. [quote:386cf9i9] If I want to use ADS, do I have to add anything else?. [/quote:386cf9i9] Nothing. XBrowse automatically detects if the Alias is opened with ADD and appropriately builds the codeblocks.
to Mr. Rao
Thank you. Your work has improved so much xBrowse and simplified original sintax.
to Mr. Rao
Mr. Rao, I sent you a private mail. Did you receive it from <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->?. Thank you.
to Mr. Rao
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=19&t=22041">viewtopic.php?f=19&t=22041</a><!-- l --> Have you seen this topic? Best regards, Otto
to Mr. Rao
[quote="ukservice":3mb2vh40]Mr. Rao, I sent you a private mail. Did you receive it from <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->?. Thank you.[/quote:3mb2vh40] Sorry, I did not receive any mail from you. My email id is <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
to Mr. Rao
Thank you. I sent you an email. Did you receive it?.
to Mr. Rao
Mr. Nao, I have two questions about xBrowse. I would appreciate your help please. Regarding <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=23113">viewtopic.php?f=3&t=23113</a><!-- l --> <!-- m --><a class="postlink" href="http://imageshack.us/photo/my-images/192/xbrowsegreat.png/">http://imageshack.us/photo/my-images/19 ... great.png/</a><!-- m --> Is it possible to exclude spaces, as the picture?. Also, in [code=fw:35wz4lml]<div class="fw" id="{CB}" style="font-family: monospace;"> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span>   := EDIT_GET_BUTTON</div>[/code:35wz4lml] Is it possible in the button to indicate a Bmp as BUTTONBMP?. Thanks a lot.
to Mr. Rao
Don't you mean Mr [b:3j40cka7][u:3j40cka7]R[/u:3j40cka7][/b:3j40cka7]ao? <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
to Mr. Rao
[quote:9oqfhnty]Is it possible to exclude spaces, as the picture?.[/quote:9oqfhnty] If this is a character field, use Trim(<fieldname>) while defining xbrowse. Example: [code=fw:9oqfhnty]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">&#123;</span> |x| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> x == <span style="color: #00C800;">nil</span>, Trim<span style="color: #000000;">&#40;</span><fieldname><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> <fieldname> := x, Trim<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:9oqfhnty] I do not know why you want this behavior. Users will not be able to enter longer value than the trimmed value shown in the browse.
to Mr. Rao
[quote:1krro51r]Is it possible in the button to indicate a Bmp as BUTTONBMP?. [/quote:1krro51r] Please use oCol:nBtnBmp for this purpose
to Mr. Rao
Thank you very much. Also, one last thing. I do double click to edit a field or just press enter. To save changes, I should press enter too. Also, is it possible to save changes when clicking in another cell?. Thanks.
to Mr. Rao
Hi, Mr. Nao. I also am interested in exposing ukservice. Is it possible save changes on EDIT_GET without pressing ENTER and clicking another cell or the header's column? Thanks
to Mr. Rao
Hi Mr.ukservice and Mr.FranciscoA [quote:31171247] Don't you mean Mr Rao? [/quote:31171247] Mr.hua already pointed out that error in addressing Mr.Rao as Mr.Nao. Inspite of Mr.Hua's pointing, Mr.ukservice did not mind to rectify the error:( and kept on asking for Mr.Rao's help. It is very sad that Mr.FranciscoA is also on the same path of Mr.ukservice <!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o --> Let us respect our Seniors, at least by calling them with their own names. Mr.ukservice and Mr.FranciscoA I hope you don't think bad of my comment. Regards, - Ramesh Babu P
to Mr. Rao
Sorry, I thought if was Nao as others call him too. Sorry again and thanks for your help and interest.
to Nages - sample test xbrowse with datepick
Nages, Can ypu publish a little sample with datepick ( with setrange) into xbrowse , pls thanks
to Nages - sample test xbrowse with datepick
ok
to Nages - sample test xbrowse with datepick
thanks I tried with WITH OBJECT oBrowse:aCols[ 8] :nEditType:= EDIT_DATE :cEditPicture := "dd-mmmm-yyyy" <!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o -->EditGet:SetRange( dStagioneMin,dStagioneMax ) :bOnChange := bCalcRow END but make error
to Nages : drag and drop from buttons
I have some buttons on a wnd and each button i s link a numbers ( sample 1) I wish press on this buttons and move the mouse into a xbrowse and insert a record for each button I click with the number of button and the dates that the final user selected from a datepick control on xbrowse must be showed : Header of xbrowse | Umbrella | dateinit | datefinal | 1 01/04/12 02/04/12 7 11/06/12 12/06/12 how I can make it ?
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Mr Nages, I not understood why it save bad I open oServizi oServizi:= TServizi():new() oServizi:gotop() [b:1pfznqu6]at init I have this dbf[/b:1pfznqu6] [img:1pfznqu6]https&#58;//i&#46;postimg&#46;cc/q7MXXGVS/0&#46;png[/img:1pfznqu6] [b:1pfznqu6]and I have this dialog [/b:1pfznqu6] [img:1pfznqu6]https&#58;//i&#46;postimg&#46;cc/52tS83MG/iiii&#46;png[/img:1pfznqu6] the services on first xbrowse are single, the services on second xbrowse are Multi Services 1,2,3,4 are single and have the field multiple = .f. and have the field struttura empty services 5,6,7 are Multi and have the field multiple = .t. and have the field struttura with words [b:1pfznqu6]then open the order function and I see it [/b:1pfznqu6] [img:1pfznqu6]https&#58;//i&#46;postimg&#46;cc/jSvy5JwX/1&#46;png[/img:1pfznqu6] [b:1pfznqu6]Now I try to move servizi7 to top[/b:1pfznqu6] [img:1pfznqu6]https&#58;//i&#46;postimg&#46;cc/65pWK2Kw/2&#46;png[/img:1pfznqu6] [b:1pfznqu6]Now save and return to my dialog [/b:1pfznqu6] [img:1pfznqu6]https&#58;//i&#46;postimg&#46;cc/hPk5r6pw/3&#46;png[/img:1pfznqu6] [b:1pfznqu6]ERROR[/b:1pfznqu6] as you can see there is something of wrong there are two record "servizi7" one on first xbrowse the other on second xbrowse the record "Servizi1" now is on second xbrowse while it must be on first xbrowse because it is single service then If you see the dbf you can see the error [img:1pfznqu6]https&#58;//i&#46;postimg&#46;cc/g2DkbVXY/fin&#46;png[/img:1pfznqu6] the service have ID 0001 "Servizi1" now have the filed "struttura" full ( instead empty) and the field multiple now is .t. ( instead .f.) WHY ? [b:1pfznqu6]this is the code [/b:1pfznqu6] [code=fw:1pfznqu6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> Order<span style="color: #000000;">&#40;</span>oBrw1,oBrw2,cFilter1,cfilter2,oServizi<span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">local</span> aArray,oLbx,oFont<br />  <span style="color: #00C800;">local</span> cFieldList:=<span style="color: #ff0000;">"id,name,breve,price,image,struttura,unit,a4,pos,multiple,islock,ordine"</span><br />  <span style="color: #00C800;">local</span> oDlgOrder<br />  <span style="color: #00C800;">Local</span> cCursor:= TCursor<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>,<span style="color: #ff0000;">'HAND'</span><span style="color: #000000;">&#41;</span><br /><br />      oServizi:<span style="color: #000000;">GOTOP</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      aArray    := oServizi:<span style="color: #000000;">FW_DbfToArray</span><span style="color: #000000;">&#40;</span> cFieldList <span style="color: #000000;">&#41;</span><br /><br /><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"VERDANA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgOrd   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">480</span> ;<br />  <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">" Cambia la posizione"</span><br /><br /><br />            @ <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">XBROWSE</span>  oLbx <span style="color: #0000ff;">OF</span> oDlgOrd ;<br />            DATASOURCE  aArray  ;<br />            COLUMNS <span style="color: #000000;">5</span>,<span style="color: #000000;">2</span> ;<br />            HEADERS <span style="color: #ff0000;">"Servizio"</span>,<span style="color: #ff0000;">"Desc"</span> ;<br />            <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">210</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />               WITH OBJECT  oLbx<br />                         WITH OBJECT  oLbx:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />                               :<span style="color: #000000;">cDataType</span>     := <span style="color: #ff0000;">'F'</span><br />                               :<span style="color: #000000;">nWidth</span>        := <span style="color: #000000;">80</span><br />                               :<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER<br />                               :<span style="color: #000000;">lBmpTransparent</span> := .T.<br />                            END<br />                      :<span style="color: #000000;">lheader</span>:=.f.<br />                      :<span style="color: #000000;">nMarqueeStyle</span>       := MARQSTYLE_HIGHLWIN7<br />                      :<span style="color: #000000;">lHscroll</span>         := .F.<br />                      :<span style="color: #000000;">l2007</span>            := .F.<br />                      :<span style="color: #000000;">l2015</span>            := .T.<br />                      :<span style="color: #000000;">nStretchCol</span>  := STRETCHCOL_WIDEST<br />                      :<span style="color: #000000;">lAllowRowSizing</span>     := .F.<br />                      :<span style="color: #000000;">lAllowColSwapping</span>   := .F.<br />                      :<span style="color: #000000;">lAllowColHiding</span>     := .F.<br />                      :<span style="color: #000000;">lRecordSelector</span>     := .F.<br />                      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                   END<br /><br /><br />   @ <span style="color: #000000;">22</span>,<span style="color: #000000;">208</span> <span style="color: #0000ff;">BTNBMP</span> oBtnUp    <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&UP"</span> ;<br />               <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BTN_PNG_SCROLLUP"</span> FLAT;<br />               <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span>  oDlgOrd  ;<br />               <span style="color: #0000ff;">ACTION</span>  oLbx:<span style="color: #000000;">SwapUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />               <br />   @ <span style="color: #000000;">72</span>,<span style="color: #000000;">208</span> <span style="color: #0000ff;">BTNBMP</span> oBtnDown <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Down"</span> ;<br />              <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BTN_PNG_SCROLLDOWN"</span> FLAT;<br />              <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">LEFT</span>  <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span>  oDlgOrd;<br />              <span style="color: #0000ff;">ACTION</span> oLbx:<span style="color: #000000;">SwapDn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                       <br /><br />   @ <span style="color: #000000;">122</span>,<span style="color: #000000;">208</span> <span style="color: #0000ff;">BTNBMP</span> oBtnOrdine    <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Save"</span> ;<br />               <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BTN_PNG_SAVE"</span> FLAT;<br />               <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span>  oDlgOrd ;<br />               <span style="color: #0000ff;">ACTION</span> oDlgOrd:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span> IDOK <span style="color: #000000;">&#41;</span><br />                              <br /><br />   @ <span style="color: #000000;">162</span>,<span style="color: #000000;">208</span> <span style="color: #0000ff;">BTNBMP</span> oBtnUscita    <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Exit"</span> ;<br />               <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BTN_PNG_USCITA"</span> FLAT;<br />               <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span>  oDlgOrd  ;<br />               <span style="color: #0000ff;">ACTION</span> oDlgOrd:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span> IDCANCEL <span style="color: #000000;">&#41;</span><br />                              <br /><br /><br />             oBtnUp:<span style="color: #000000;">oCursor</span>:= cCursor<br />             oBtnDown:<span style="color: #000000;">oCursor</span>:= cCursor<br />             oBtnOrdine:<span style="color: #000000;">oCursor</span>:= cCursor<br />             oBtnUscita:<span style="color: #000000;">oCursor</span>:= cCursor<br /><br /><br />      <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgOrd <span style="color: #0000ff;">CENTER</span><br />      <span style="color: #00C800;">if</span> oDlgOrd:<span style="color: #000000;">nresult</span> == IDOK<br /><br />                   <span style="color: #B900B9;">//save the poistion on records of array</span><br />                    AEval<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> |a,i| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">12</span> <span style="color: #000000;">&#93;</span> := i <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />                 <span style="color: #B900B9;">// save the oServizi</span><br />                 oServizi:<span style="color: #000000;">GOTOP</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                 aArray    := oServizi:<span style="color: #000000;">FW_ArrayToDbf</span><span style="color: #000000;">&#40;</span> aArray, cFieldList, <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />                 oServizi:<span style="color: #000000;">GOTOP</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />            <span style="color: #00C800;">Endif</span><br /><br /><br /><br />    <span style="color: #B900B9;">//refresh the xbrowses</span><br /><br />      <span style="color: #00C800;">if</span> oBrw1 != <span style="color: #00C800;">nil</span><br />          <span style="color: #00C800;">IF</span> !empty<span style="color: #000000;">&#40;</span>cFilter1<span style="color: #000000;">&#41;</span><br />            <span style="color: #000000;">&#40;</span>oBrw1:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DbSetFilter<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span>|| &cFilter1  <span style="color: #000000;">&#125;</span>,  <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #000000;">&#40;</span>oBrw1:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">ENDIF</span><br />        oBrw1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br />        oBrw1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">endif</span><br /><br />    <span style="color: #00C800;">if</span> oBrw2 != <span style="color: #00C800;">nil</span><br />        <span style="color: #00C800;">IF</span> !empty<span style="color: #000000;">&#40;</span>cFilter2<span style="color: #000000;">&#41;</span><br />           <span style="color: #000000;">&#40;</span>oBrw2:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DbSetFilter<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span>|| &cFilter2  <span style="color: #000000;">&#125;</span>,  <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />          <span style="color: #000000;">&#40;</span>oBrw2:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">ENDIF</span><br />        oBrw2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br />        oBrw2:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1pfznqu6]
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
There is no method FW_DbfToArray( cFieldList ) of TDatabase. aArray := oServizi:FW_DbfToArray( cFieldList ) Try: aArray := oServizi:cAlias->(FW_DBFToArray( cFieldList ))
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
oServizi:GOTOP() aArray := (oServizi:cAlias)->(FW_ArrayToDbf( aArray, cFieldList, nil, .T. )) oServizi:GOTOP() give me the same error two record with "servizi7" [img:2pc055c2]https&#58;//i&#46;postimg&#46;cc/hPk5r6pw/3&#46;png[/img:2pc055c2]
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Did you check to see if there are actually two records with the same name?
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
[quote="James Bott":5gbaloai]There is no method FW_DbfToArray( cFieldList ) of TDatabase. aArray := oServizi:FW_DbfToArray( cFieldList ) [/quote:5gbaloai] Both [code=fw:5gbaloai]<div class="fw" id="{CB}" style="font-family: monospace;">aArray := oServizi:<span style="color: #000000;">FW_DbfToArray</span><span style="color: #000000;">&#40;</span> cFieldList <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">// and</span><br />aArray := oServizi:<span style="color: #000000;">DbfToArray</span><span style="color: #000000;">&#40;</span> cFieldList <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:5gbaloai] work and work the same way. Here is a sample to test: [code=fw:5gbaloai]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDbf, aArray1, aArray2<br /><br />&nbsp; &nbsp;oDbf &nbsp;:= TDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> , <span style="color: #ff0000;">"STATES"</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oDbf:<span style="color: #000000;">Used</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oDbf:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aArray1 := oDbf:<span style="color: #000000;">FW_DbfToArray</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"RECNO(),CODE,NAME"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oDbf:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aArray2 := oDbf:<span style="color: #000000;">DbfToArray</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CODE,NAME"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; XBROWSER aArray1<br />&nbsp; &nbsp; &nbsp; XBROWSER aArray2<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;oDbf &nbsp;:= <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:5gbaloai] [quote="James Bott":5gbaloai] Try: aArray := oServizi:cAlias->(FW_DBFToArray( cFieldList ))[/quote:5gbaloai] I am afraid the syntax is not correct. It should be: [code=fw:5gbaloai]<div class="fw" id="{CB}" style="font-family: monospace;">aArray := <span style="color: #000000;">&#40;</span> oServizi:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FW_DbfToArray<span style="color: #000000;">&#40;</span> cFieldList <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:5gbaloai]
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
RAO the problem is when it go to save I tried with aArray := oServizi:FW_ArrayToDbf( aArray, cFieldList, nil, .T. ) or aArray := (oServizi:cAlias)->(FW_ArrayToDbf( aArray, cFieldList, nil, .T. )) I'm afraid Tdata of JAmes not run well because I tried your sample ( with states.dbf) and it run ok
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
[quote:1un0p3ig]I'm afraid Tdata of JAmes not run well[/quote:1un0p3ig] The problem can not be with TData class. It must be with your program somewhere.
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Rao, I tried also with tdatabase and not run ok [b:2ir47qsr]First[/b:2ir47qsr] [img:2ir47qsr]https&#58;//i&#46;postimg&#46;cc/qvDVDZX9/1&#46;png[/img:2ir47qsr] please see the "0004" first column and 6th column [b:2ir47qsr]then open the dialog to change the position [/b:2ir47qsr] [img:2ir47qsr]https&#58;//i&#46;postimg&#46;cc/R0J8sC0H/2&#46;png[/img:2ir47qsr] [b:2ir47qsr]now I move the last record to top[/b:2ir47qsr] [img:2ir47qsr]https&#58;//i&#46;postimg&#46;cc/hvZ1RxyP/3&#46;png[/img:2ir47qsr] [b:2ir47qsr]Now I check the database[/b:2ir47qsr] [img:2ir47qsr]https&#58;//i&#46;postimg&#46;cc/j21PFT2D/4&#46;png[/img:2ir47qsr] the Seven record is moved but there is an error ... [b:2ir47qsr]please see the 0004 ( first column) it have the 6th colum full and the field multiple = .t. instead .f. [/b:2ir47qsr] please see it (it is your test I add my servizi.dbf and dialog to change position) [code=fw:2ir47qsr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oDlg,oLbx<br />    <span style="color: #00C800;">Local</span> oBtnUp,oBtnDown,oBtnOrdine,oBtnUscita <br /><br />   <span style="color: #00C800;">local</span> oDbf, aArray1, aArray2<br />   <span style="color: #00C800;">local</span> cFieldList:=<span style="color: #ff0000;">"id,name,breve,price,image,struttura,unit,a4,pos,multiple,islock,ordine"</span><br /><br /><br />   oDbf  := TDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> , <span style="color: #ff0000;">"SERVIZI"</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">if</span> oDbf:<span style="color: #000000;">Used</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />      oDbf:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      aArray1 := oDbf:<span style="color: #000000;">FW_DbfToArray</span><span style="color: #000000;">&#40;</span> cFieldList <span style="color: #000000;">&#41;</span><br /><br /><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"VERDANA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">480</span> ;<br />  <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">" Change the position"</span><br /><br />      @ <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">XBROWSE</span>  oLbx <span style="color: #0000ff;">OF</span> oDlg ;<br />            DATASOURCE  aArray1 ;<br />            COLUMNS <span style="color: #000000;">5</span>,<span style="color: #000000;">2</span> ;<br />            HEADERS <span style="color: #ff0000;">"Servizio"</span>,<span style="color: #ff0000;">"Desc"</span> ;<br />            <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">210</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><br />                 WITH OBJECT  oLbx<br />                         WITH OBJECT  oLbx:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />                               :<span style="color: #000000;">cDataType</span>     := <span style="color: #ff0000;">'F'</span><br />                               :<span style="color: #000000;">nWidth</span>        := <span style="color: #000000;">80</span><br />                               :<span style="color: #000000;">nDataBmpAlign</span> := AL_CENTER<br />                               :<span style="color: #000000;">lBmpTransparent</span> := .T.<br />                            END<br />                      :<span style="color: #000000;">lheader</span>:=.f.<br />                      :<span style="color: #000000;">nMarqueeStyle</span>       := MARQSTYLE_HIGHLWIN7<br />                      :<span style="color: #000000;">lHscroll</span>         := .F.<br />                      :<span style="color: #000000;">l2007</span>            := .F.<br />                      :<span style="color: #000000;">l2015</span>            := .T.<br />                      :<span style="color: #000000;">nStretchCol</span>  := STRETCHCOL_WIDEST<br />                      :<span style="color: #000000;">lAllowRowSizing</span>     := .F.<br />                      :<span style="color: #000000;">lAllowColSwapping</span>   := .F.<br />                      :<span style="color: #000000;">lAllowColHiding</span>     := .F.<br />                      :<span style="color: #000000;">lRecordSelector</span>     := .F.<br />                      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                   END<br /><br /><br /><br /> @ <span style="color: #000000;">22</span>,<span style="color: #000000;">208</span> <span style="color: #0000ff;">BTNBMP</span> oBtnUp    <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&UP"</span> ;<br />               <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BTN_PNG_SCROLLUP"</span> FLAT;<br />               <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span>  oDlg  ;<br />               <span style="color: #0000ff;">ACTION</span>  oLbx:<span style="color: #000000;">SwapUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                <br />   @ <span style="color: #000000;">72</span>,<span style="color: #000000;">208</span> <span style="color: #0000ff;">BTNBMP</span> oBtnDown <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Down"</span> ;<br />              <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BTN_PNG_SCROLLDOWN"</span> FLAT;<br />              <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">LEFT</span>  <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span>  oDlg;<br />              <span style="color: #0000ff;">ACTION</span> oLbx:<span style="color: #000000;">SwapDn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                        <br /><br />   @ <span style="color: #000000;">122</span>,<span style="color: #000000;">208</span> <span style="color: #0000ff;">BTNBMP</span> oBtnOrdine    <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Save"</span> ;<br />               <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BTN_PNG_SAVE"</span> FLAT;<br />               <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span>  oDlg ;<br />               <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span> IDOK <span style="color: #000000;">&#41;</span><br />                             <br />   @ <span style="color: #000000;">162</span>,<span style="color: #000000;">208</span> <span style="color: #0000ff;">BTNBMP</span> oBtnUscita    <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Exit"</span> ;<br />               <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BTN_PNG_USCITA"</span> FLAT;<br />               <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span>  oDlg ;<br />               <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span> IDCANCEL <span style="color: #000000;">&#41;</span><br />                                <br />            <br /><br /><br />      <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #00C800;">if</span> oDlg:<span style="color: #000000;">nresult</span> == IDOK<br />         AEval<span style="color: #000000;">&#40;</span> aArray1, <span style="color: #000000;">&#123;</span> |a,i| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">12</span> <span style="color: #000000;">&#93;</span> := i <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />                 oDbf:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                 aArray1    := oDbf:<span style="color: #000000;">FW_ArrayToDbf</span><span style="color: #000000;">&#40;</span> aArray1, cFieldList, <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />                 oDbf:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">endif</span><br /><br /><br />      oDbf:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      aArray2 := oDbf:<span style="color: #000000;">DbfToArray</span><span style="color: #000000;">&#40;</span> cFieldList <span style="color: #000000;">&#41;</span><br />      XBROWSER aArray2<br /><br /><span style="color: #00C800;">endif</span><br /><br />   oDbf  := <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><br /><br /><br /> </div>[/code:2ir47qsr] [b:2ir47qsr]It change the position of the record I moved but it change also the the content of the fourth record (in this case) in the sixth column and the multiple field, changing it from F to T[/b:2ir47qsr] Use this if you want create my dbf ( with sample data) [code=fw:2ir47qsr]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> BuildDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> aCols       := <span style="color: #000000;">&#123;</span> ;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"id"</span>    , <span style="color: #ff0000;">"C"</span>,    <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"name"</span>  , <span style="color: #ff0000;">"C"</span>,   <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"breve"</span>  , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"price"</span> , <span style="color: #ff0000;">"N"</span>,    <span style="color: #000000;">9</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"image"</span> , <span style="color: #ff0000;">"C"</span>,   <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"struttura"</span>,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"unit"</span>  , <span style="color: #ff0000;">"N"</span>,    <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"a4"</span>    , <span style="color: #ff0000;">"L"</span>,    <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"pos"</span>   , <span style="color: #ff0000;">"L"</span>,    <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"multiple"</span>, <span style="color: #ff0000;">"L"</span>,  <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"islock"</span>  , <span style="color: #ff0000;">"L"</span>,  <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ordine"</span>  , <span style="color: #ff0000;">"N"</span>,  <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /> <span style="color: #B900B9;">//sample data</span><br />   <span style="color: #00C800;">local</span> aData       := <span style="color: #000000;">&#123;</span> ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0001"</span>,<span style="color: #ff0000;">"Lettino"</span>,<span style="color: #ff0000;">"ser1"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\1</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0002"</span>,<span style="color: #ff0000;">"Sdraio"</span>,<span style="color: #ff0000;">"ser2"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\2</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0003"</span>,<span style="color: #ff0000;">"Regista"</span>,<span style="color: #ff0000;">"ser3"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\3</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">3</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0004"</span>,<span style="color: #ff0000;">"Parcheggio"</span>,<span style="color: #ff0000;">"parcheggio"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\4</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">4</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0005"</span>,<span style="color: #ff0000;">"Lettino+sdrario+regista"</span>,<span style="color: #ff0000;">"ser5"</span>,<span style="color: #000000;">18</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\5</span>.png"</span>,<span style="color: #ff0000;">"[lettino][sdraio][regista]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">5</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0006"</span>,<span style="color: #ff0000;">"sdrario+lettino"</span>,<span style="color: #ff0000;">"ser6"</span>,<span style="color: #000000;">12</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\6</span>.png"</span>,<span style="color: #ff0000;">"[sdraio][lettino]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">6</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0007"</span>,<span style="color: #ff0000;">"regista+lettino"</span>,<span style="color: #ff0000;">"ser7"</span>,<span style="color: #000000;">16</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\7</span>.png"</span>,<span style="color: #ff0000;">"[regista][lettino]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">7</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />DBCREATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SERVIZI.DBF"</span>, aCols, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br />   FW_ArrayToDBF<span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br />   CLOSE <span style="color: #00C800;">DATA</span><br /><br /><br /><br />USE Servizi.dbf <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">ID</span> TAG SE001 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">NAME</span><span style="color: #000000;">&#41;</span> TAG SE002 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> ORDINE TAG SE003 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />CLOSE <span style="color: #00C800;">DATA</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><br /><br /><br /><br /> </div>[/code:2ir47qsr] you sad "It must be with your program somewhere." ok but where ?
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Mr. Silvio [quote:3uwx1qm2]you sad "It must be with your program somewhere." ok but where ? [/quote:3uwx1qm2] You are right. I am wrong. I sent you revised lib. Please test with the revised lib.
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
[b:2n778kbm]YOU're FANTASTIC [/b:2n778kbm] [b:2n778kbm]NOW RUN OK[/b:2n778kbm] [img:2n778kbm]https&#58;//i&#46;postimg&#46;cc/3JQSLpkC/siiiiiiiiiiiiiii&#46;png[/img:2n778kbm]
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Your main objective is to swap records in servizi.dbf. For this purpose, you are copying the data into an array, swapping array elements and then copy the array back to the dbf. All that is not necessary. You can swap the records in the dbf directly and forget about copying to and from array. Test this sample code: [code=fw:36kye6y7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oFont, oServizi<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cSwapFields:=<span style="color: #ff0000;">"id,name,breve,price,image,struttura,unit,a4,pos,multiple,islock"</span> <span style="color: #B900B9;">//,ordine"</span><br /><br />&nbsp; &nbsp;SET DELETED <span style="color: #0000ff;">ON</span><br /><br />&nbsp; &nbsp;BuildDBF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;USE SERVIZI <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp;OrdSetFocus<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">900</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SERVIZI.DBF"</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">70</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE <span style="color: #ff0000;">"SERVIZI"</span> <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; := MARQSTYLE_HIGHLROW<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">AutoFit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">SetChecks</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bChange</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">15</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"ADD"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> AddRec<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">15</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"UP"</span> &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> oBrw:<span style="color: #000000;">KeyNo</span> > <span style="color: #000000;">1</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> SwapRec<span style="color: #000000;">&#40;</span> VK_UP, cSwapFields <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">15</span>,<span style="color: #000000;">350</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"DOWN"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> oBrw:<span style="color: #000000;">KeyNo</span> < oBrw:<span style="color: #000000;">nLen</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> SwapRec<span style="color: #000000;">&#40;</span> VK_DOWN, cSwapFields <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<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> SwapRec<span style="color: #000000;">&#40;</span> nKey, cList <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRec, aRows<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nKey == VK_UP<br />&nbsp; &nbsp; &nbsp; DBSKIP<span style="color: #000000;">&#40;</span> <span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> BOF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRec &nbsp; &nbsp; := RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRows &nbsp; &nbsp;:= FW_DbfToArray<span style="color: #000000;">&#40;</span> cList, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBGOTO<span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aRows <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AINS<span style="color: #000000;">&#40;</span> aRows, <span style="color: #000000;">1</span>, aRows<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FW_ArrayToDBF<span style="color: #000000;">&#40;</span> aRows, cList, <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DBGOTO<span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;elseif nKey == VK_DOWN<br />&nbsp; &nbsp; &nbsp; nRec &nbsp; &nbsp; := RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aRows &nbsp; &nbsp;:= FW_DbfToArray<span style="color: #000000;">&#40;</span> cList, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DBGOTO<span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aRows <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AINS<span style="color: #000000;">&#40;</span> aRows, <span style="color: #000000;">1</span>, aRows<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FW_ArrayToDBF<span style="color: #000000;">&#40;</span> aRows, cList, <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBGOTO<span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBSKIP<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</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> AddRec<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oRec &nbsp;:= TDataRow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,, .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oRec:<span style="color: #000000;">oBrw</span> &nbsp; := oBrw<br />&nbsp; &nbsp;oRec:<span style="color: #000000;">SetDefault</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ORDINE"</span>, <span style="color: #000000;">&#123;</span> || LASTREC<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span>, .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oRec:<span style="color: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">Function</span> BuildDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field <span style="color: #0000ff;">ID</span>,<span style="color: #0000ff;">NAME</span>,ORDINE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aCols &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"id"</span> &nbsp; &nbsp;, <span style="color: #ff0000;">"C"</span>, &nbsp; &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"name"</span> &nbsp;, <span style="color: #ff0000;">"C"</span>, &nbsp; <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"breve"</span> &nbsp;, <span style="color: #ff0000;">"C"</span>, &nbsp;<span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"price"</span> , <span style="color: #ff0000;">"N"</span>, &nbsp; &nbsp;<span style="color: #000000;">9</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"image"</span> , <span style="color: #ff0000;">"C"</span>, &nbsp; <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"struttura"</span>,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"unit"</span> &nbsp;, <span style="color: #ff0000;">"N"</span>, &nbsp; &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"a4"</span> &nbsp; &nbsp;, <span style="color: #ff0000;">"L"</span>, &nbsp; &nbsp;<span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"pos"</span> &nbsp; , <span style="color: #ff0000;">"L"</span>, &nbsp; &nbsp;<span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"multiple"</span>, <span style="color: #ff0000;">"L"</span>, &nbsp;<span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"islock"</span> &nbsp;, <span style="color: #ff0000;">"L"</span>, &nbsp;<span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ordine"</span> &nbsp;, <span style="color: #ff0000;">"N"</span>, &nbsp;<span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp;<span style="color: #B900B9;">//sample data</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0001"</span>,<span style="color: #ff0000;">"Lettino"</span>,<span style="color: #ff0000;">"ser1"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\1</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0002"</span>,<span style="color: #ff0000;">"Sdraio"</span>,<span style="color: #ff0000;">"ser2"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\2</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0003"</span>,<span style="color: #ff0000;">"Regista"</span>,<span style="color: #ff0000;">"ser3"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\3</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">3</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0004"</span>,<span style="color: #ff0000;">"Parcheggio"</span>,<span style="color: #ff0000;">"parcheggio"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\4</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">4</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0005"</span>,<span style="color: #ff0000;">"Lettino+sdrario+regista"</span>,<span style="color: #ff0000;">"ser5"</span>,<span style="color: #000000;">18</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\5</span>.png"</span>,<span style="color: #ff0000;">"[lettino][sdraio][regista]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">5</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0006"</span>,<span style="color: #ff0000;">"sdrario+lettino"</span>,<span style="color: #ff0000;">"ser6"</span>,<span style="color: #000000;">12</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\6</span>.png"</span>,<span style="color: #ff0000;">"[sdraio][lettino]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">6</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0007"</span>,<span style="color: #ff0000;">"regista+lettino"</span>,<span style="color: #ff0000;">"ser7"</span>,<span style="color: #000000;">16</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\7</span>.png"</span>,<span style="color: #ff0000;">"[regista][lettino]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">7</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />DBCREATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SERVIZI.DBF"</span>, aCols, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br /><br />FW_ArrayToDBF<span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">ID</span> TAG SE001 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">NAME</span><span style="color: #000000;">&#41;</span> TAG SE002 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> ORDINE TAG SE003 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />CLOSE <span style="color: #00C800;">DATA</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:36kye6y7] [url=https&#58;//imageshack&#46;com/i/pmOqymLvg:36kye6y7][img:36kye6y7]https&#58;//imageshack&#46;com/a/img922/8818/OqymLv&#46;gif[/img:36kye6y7][/url:36kye6y7]
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Wonderful, I also tried it in the main program. this thing is very useful for ordering the most used products to display in a look up for an order
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Now I kill myself... I try the test also with another dbf ( elementi.dbf) I sent you and with tdatabase features and I have problems 1. If I take the first record and move it down it is not fast and each time I must reselect the row I wish to move down 2. it not change the field ElOrdine ( the number is allways the same) If I change dbf and the cSwapFields I must change another thing ? [img:l3z785q3]https&#58;//i&#46;postimg&#46;cc/zfQ2Z7kP/mm&#46;jpg[/img:l3z785q3]
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
[quote:2e9r1pac] and with tdatabase features and I have problems [/quote:2e9r1pac] The sample I posted is for DBF. Not for TDatabase. [quote:2e9r1pac] 1. If I take the first record and move it down it is not fast and each time I must reselect the row I wish to move down [/quote:2e9r1pac] Do not use WIN7 marqueestyle. [quote:2e9r1pac] 2. it not change the field ElOrdine ( the number is allways the same) [/quote:2e9r1pac] Obviously. Changes only the fields contained in cSwapFields. Does not change fields no contained in cSwapFields. You decide what fields you want to swap Note: Keep the DBF in natural order ( OrdSetFocus( 0 ) )
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Nages, I insert the field of Elementi.dbf into cSwapFields: [code=fw:3n5qxmfo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;<span style="color: #00C800;">local</span> cSwapFields:=<span style="color: #ff0000;">"ELNUMERO,ELORDINE,ELNOME,ELCOLORE,ELATTIVO,ELIMGLIB,ELIMGOCC,ELIMGALT,ELLOCK"</span></div>[/code:3n5qxmfo] I use [code=fw:3n5qxmfo]<div class="fw" id="{CB}" style="font-family: monospace;"> :<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; := MARQSTYLE_HIGHLROW</div>[/code:3n5qxmfo] I think the problem is tdatabase [code=fw:3n5qxmfo]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp;oElementi:= TDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>,<span style="color: #ff0000;">"Elementi"</span>,,.f.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oElementi:<span style="color: #000000;">use</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oElementi:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span></div>[/code:3n5qxmfo] How we resolve if I open the dbf with tdatabase ?
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
The sample I provided above is converted to use TDatabase. [code=fw:r8jz71wk]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field ORDINE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oFont, oServizi<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cSwapFields:=<span style="color: #ff0000;">"id,name,breve,price,image,struttura,unit,a4,pos,multiple,islock"</span> <span style="color: #B900B9;">//,ordine"</span><br /><br />&nbsp; &nbsp;SET DELETED <span style="color: #0000ff;">ON</span><br /><br />&nbsp; &nbsp;BuildDBF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oServizi := TDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> , <span style="color: #ff0000;">"SERVIZI"</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oServizi:<span style="color: #000000;">bTrigger</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> ORDINE <span style="color: #000000;">&#41;</span>, ORDINE := RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oServizi:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oServizi:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">900</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SERVIZI.DBF"</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">70</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE oServizi <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; := MARQSTYLE_HIGHLROW<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">AutoFit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">SetChecks</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bChange</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">15</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"ADD"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> AddRec<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">15</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"UP"</span> &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> oBrw:<span style="color: #000000;">KeyNo</span> > <span style="color: #000000;">1</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> SwapRec<span style="color: #000000;">&#40;</span> oBrw, VK_UP, cSwapFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">15</span>,<span style="color: #000000;">350</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"DOWN"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> oBrw:<span style="color: #000000;">KeyNo</span> < oBrw:<span style="color: #000000;">nLen</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> SwapRec<span style="color: #000000;">&#40;</span> oBrw, VK_DOWN, cSwapFields <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<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> SwapRec<span style="color: #000000;">&#40;</span> oBrw, nKey, cList <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRec, aRows<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">oDbf</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nKey == VK_UP<br />&nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> :<span style="color: #000000;">Bof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRec &nbsp; &nbsp; := :<span style="color: #000000;">RecNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRows &nbsp; &nbsp;:= :<span style="color: #000000;">DbfToArray</span><span style="color: #000000;">&#40;</span> cList, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aRows <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AINS<span style="color: #000000;">&#40;</span> aRows, <span style="color: #000000;">1</span>, aRows<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">ArrayToDBF</span><span style="color: #000000;">&#40;</span> aRows, cList, <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp;elseif nKey == VK_DOWN<br />&nbsp; &nbsp; &nbsp; &nbsp; nRec &nbsp; &nbsp; := :<span style="color: #000000;">RecNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aRows &nbsp; &nbsp;:= :<span style="color: #000000;">DbfToArray</span><span style="color: #000000;">&#40;</span> cList, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aRows <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AINS<span style="color: #000000;">&#40;</span> aRows, <span style="color: #000000;">1</span>, aRows<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">ArrayToDBF</span><span style="color: #000000;">&#40;</span> aRows, cList, <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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> AddRec<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oRec &nbsp;:= oBrw:<span style="color: #000000;">oDbf</span>:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oRec:<span style="color: #000000;">oBrw</span> &nbsp; := oBrw<br />&nbsp; &nbsp;oRec:<span style="color: #000000;">FieldReadOnly</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ORDINE"</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oRec:<span style="color: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">Function</span> BuildDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field <span style="color: #0000ff;">ID</span>,<span style="color: #0000ff;">NAME</span>,ORDINE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDbf<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aCols &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"id"</span> &nbsp; &nbsp;, <span style="color: #ff0000;">"C"</span>, &nbsp; &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"name"</span> &nbsp;, <span style="color: #ff0000;">"C"</span>, &nbsp; <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"breve"</span> &nbsp;, <span style="color: #ff0000;">"C"</span>, &nbsp;<span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"price"</span> , <span style="color: #ff0000;">"N"</span>, &nbsp; &nbsp;<span style="color: #000000;">9</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"image"</span> , <span style="color: #ff0000;">"C"</span>, &nbsp; <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"struttura"</span>,<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"unit"</span> &nbsp;, <span style="color: #ff0000;">"N"</span>, &nbsp; &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"a4"</span> &nbsp; &nbsp;, <span style="color: #ff0000;">"L"</span>, &nbsp; &nbsp;<span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"pos"</span> &nbsp; , <span style="color: #ff0000;">"L"</span>, &nbsp; &nbsp;<span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"multiple"</span>, <span style="color: #ff0000;">"L"</span>, &nbsp;<span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"islock"</span> &nbsp;, <span style="color: #ff0000;">"L"</span>, &nbsp;<span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ordine"</span> &nbsp;, <span style="color: #ff0000;">"N"</span>, &nbsp;<span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp;<span style="color: #B900B9;">//sample data</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0001"</span>,<span style="color: #ff0000;">"Lettino"</span>,<span style="color: #ff0000;">"ser1"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\1</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0002"</span>,<span style="color: #ff0000;">"Sdraio"</span>,<span style="color: #ff0000;">"ser2"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\2</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0003"</span>,<span style="color: #ff0000;">"Regista"</span>,<span style="color: #ff0000;">"ser3"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\3</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">3</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0004"</span>,<span style="color: #ff0000;">"Parcheggio"</span>,<span style="color: #ff0000;">"parcheggio"</span>,<span style="color: #000000;">10</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\4</span>.png"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">100</span>,.t.,.t.,.f.,.t.,<span style="color: #000000;">4</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0005"</span>,<span style="color: #ff0000;">"Lettino+sdrario+regista"</span>,<span style="color: #ff0000;">"ser5"</span>,<span style="color: #000000;">18</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\5</span>.png"</span>,<span style="color: #ff0000;">"[lettino][sdraio][regista]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">5</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0006"</span>,<span style="color: #ff0000;">"sdrario+lettino"</span>,<span style="color: #ff0000;">"ser6"</span>,<span style="color: #000000;">12</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\6</span>.png"</span>,<span style="color: #ff0000;">"[sdraio][lettino]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">6</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0007"</span>,<span style="color: #ff0000;">"regista+lettino"</span>,<span style="color: #ff0000;">"ser7"</span>,<span style="color: #000000;">16</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\7</span>.png"</span>,<span style="color: #ff0000;">"[regista][lettino]"</span>,<span style="color: #000000;">0</span>,.t.,.t.,.t.,.t.,<span style="color: #000000;">7</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />&nbsp; &nbsp;oDbf &nbsp;:= TDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Create</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SERVIZI.DBF"</span>, aCols, <span style="color: #ff0000;">"DBFCDX"</span>, <span style="color: #ff0000;">"*"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">ArrayToDbf</span><span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:r8jz71wk]
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
[size=200:1x9zdurg][b:1x9zdurg]THANKS[/b:1x9zdurg][/size:1x9zdurg] But on Xbrowse [b:1x9zdurg]no need the command :SetoDbf(oServizi) [/b:1x9zdurg] ??? why you rem [b:1x9zdurg]ordine field[/b:1x9zdurg] from [b:1x9zdurg]cSwapFields[/b:1x9zdurg] ? Problem ....when you add a record the field ORDINE IS ZERO , then if you move it up ( 1 step) the number is 7 but the last record have the field ordine zero.... [img:1x9zdurg]https&#58;//i&#46;postimg&#46;cc/QtwDgqgZ/ordine-odbf&#46;gif[/img:1x9zdurg]
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
[quote:1t2kj707]But on Xbrowse no need the command :SetoDbf(oServizi) ??? [/quote:1t2kj707] You should NOT. In the XBROWSE command we state "DATASOURCE oServizi". XBrowse automatically sets SetOdbf(). We should not again do it. [quote:1t2kj707]why you rem ordine field from cSwapFields ? [/quote:1t2kj707] This is to demonstrate that only the fields listed in cSwapFields are swapped. The fields not included in the list are not swapped. You decide whether to include ordine also in the list. If you include ordine in the list, ordine field also is swapped. Note: AutoInc fields are never swapped. [quote:1t2kj707]Problem ....when you add a record the field ORDINE IS ZERO [/quote:1t2kj707] I revised the program. Please test the revised program.
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
[quote="nageswaragunupudi":zgtcp8yx][quote:zgtcp8yx]But on Xbrowse no need the command :SetoDbf(oServizi) ??? [/quote:zgtcp8yx] You should NOT. In the XBROWSE command we state "DATASOURCE oServizi". XBrowse automatically sets SetOdbf(). We should not again do it. [quote:zgtcp8yx]why you rem ordine field from cSwapFields ? [/quote:zgtcp8yx] This is to demonstrate that only the fields listed in cSwapFields are swapped. The fields not included in the list are not swapped. You decide whether to include ordine also in the list. If you include ordine in the list, ordine field also is swapped. Note: AutoInc fields are never swapped. [quote:zgtcp8yx]Problem ....when you add a record the field ORDINE IS ZERO [/quote:zgtcp8yx] I revised the program. Please test the revised program.[/quote:zgtcp8yx] The first time I tried with James to convert my sources with the Tdata class, James and I found that xbrowse did not work well, ie did not display all the required fields, and we arrived at this solution Sample: [code=fw:zgtcp8yx]<div class="fw" id="{CB}" style="font-family: monospace;"> oServiziSingoli:= TServizi<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oServiziSingoli:<span style="color: #000000;">setFilter</span><span style="color: #000000;">&#40;</span> cFilter1<span style="color: #000000;">&#41;</span><br />   oServiziSingoli:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> cAlias1:= oServiziSingoli:<span style="color: #000000;">cAlias</span><br /><br />@ <span style="color: #000000;">95</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">XBROWSE</span> oBrw1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">-65</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgServizi  ;<br />         COLUMNS <span style="color: #000000;">5</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">7</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">9</span>,<span style="color: #000000;">12</span>,<span style="color: #000000;">11</span>;<br />      HEADERS <span style="color: #ff0000;">"Tipo"</span>,<span style="color: #ff0000;">"Descrizione"</span>,<span style="color: #ff0000;">"Costo"</span>,<span style="color: #ff0000;">"Disp."</span>,<span style="color: #ff0000;">"A4"</span>, <span style="color: #ff0000;">"Pos"</span>, <span style="color: #ff0000;">"Ord."</span>,<span style="color: #ff0000;">""</span>;<br />      COLSIZES <span style="color: #000000;">40</span>,<span style="color: #000000;">110</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">28</span>,<span style="color: #000000;">28</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">34</span> ;<br />      CELL LINES NOBORDER ;<br />      <span style="color: #0000ff;">ALIAS</span> cAlias1 <span style="color: #B900B9;">//oServiziSingoli:cAlias (Can't use this)</span><br /> WITH OBJECT oBrw1<br />      :<span style="color: #000000;">nRowHeight</span>    := <span style="color: #000000;">30</span><br /> :<span style="color: #000000;">lHscroll</span>            := .F.<br />      :<span style="color: #000000;">l2007</span>               := .F.<br />      :<span style="color: #000000;">l2015</span>               := .T.<br />      :<span style="color: #000000;">lRecordSelector</span>     := .f.<br />      :<span style="color: #000000;">nStretchCol</span>         := STRETCHCOL_WIDEST<br />      :<span style="color: #000000;">lAllowRowSizing</span>     := .F.<br />      :<span style="color: #000000;">lAllowColSwapping</span>   := .F.<br />      :<span style="color: #000000;">lAllowColHiding</span>     := .F.<br />      :<span style="color: #000000;">nMarqueeStyle</span>       := MARQSTYLE_HIGHLWIN7<br />      :<span style="color: #000000;">SetoDBF</span><span style="color: #000000;">&#40;</span> oServiziSingoli <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   END<br /> </div>[/code:zgtcp8yx] Now every time I create an xbrowse with tdata, [b:zgtcp8yx]James recommends that I insert the command ": setodbf (oDbf)"[/b:zgtcp8yx] Changing your test and Inserting the columns I wish show (5 and 2) the xbrowse not run ok @ 70,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ; [b:zgtcp8yx]COLUMNS 5,2 ; HEADERS "Service","Desc" [/b:zgtcp8yx]; DATASOURCE oServizi AUTOCOLS ; LINES NOBORDER I need to insert DATASOURCE oServizi:cAlias to show the fields an[b:zgtcp8yx]d then make error [/b:zgtcp8yx] when I click up and down [code=fw:zgtcp8yx]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br />   Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\Work\Errori\Nages_ordine_tdatabase\test.Exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">3</span>,<span style="color: #000000;">875</span>,<span style="color: #000000;">840</span> bytes<br />   Compiler version: <span style="color: #000000;">Harbour</span> <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">&#40;</span>r1712141320<span style="color: #000000;">&#41;</span><br />   FiveWin  version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">18.10</span><br />   C compiler version: <span style="color: #000000;">Borland</span>/Embarcadero C++ <span style="color: #000000;">7.3</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span>-bit<span style="color: #000000;">&#41;</span><br />   Windows version: <span style="color: #000000;">6.1</span>, Build <span style="color: #000000;">7601</span> Service Pack <span style="color: #000000;">1</span><br /><br />   Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">6</span> secs <br />   Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">01</span>/<span style="color: #000000;">31</span>/<span style="color: #000000;">19</span>, <span style="color: #000000;">09</span>:<span style="color: #000000;">44</span>:<span style="color: #000000;">29</span><br />   Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span>  No exported <span style="color: #00C800;">method</span>: <span style="color: #000000;">SKIP</span><br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = U   <br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = N   <span style="color: #000000;">-1</span><br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>:  => SKIP<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test</span>.prg => SWAPREC<span style="color: #000000;">&#40;</span> <span style="color: #000000;">71</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test</span>.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>MAIN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">53</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BUTTON</span>.PRG => TBUTTON:<span style="color: #0000ff;">CLICK</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">179</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TBUTTON:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1755</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3541</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => SENDMESSAGE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">COMMAND</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">433</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1136</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOXINDIRECT<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">304</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test</span>.prg => MAIN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">58</span> <span style="color: #000000;">&#41;</span></div>[/code:zgtcp8yx] if I add :setodbf(oServizi) run ok any solution please
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Use DATASOURCE oServizi Do no use DATASOURCE oServizi:cAlias With COLUMNS clause never use field numbers. Use only field names Do not again use :SetODbf() Do not use COLUMNS clause and also AUTOCOLS. Both are mutually exclusive. WRONG: [code=fw:1tdgivxr]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ <span style="color: #000000;">70</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />COLUMNS <span style="color: #000000;">5</span>,<span style="color: #000000;">2</span> ;<br />HEADERS <span style="color: #ff0000;">"Service"</span>,<span style="color: #ff0000;">"Desc"</span> ;<br />DATASOURCE oServizi <span style="color: #0000ff;">AUTOCOLS</span> ;<br />LINES NOBORDER<br />&nbsp;</div>[/code:1tdgivxr] CORRECT: [code=fw:1tdgivxr]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ <span style="color: #000000;">70</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />COLUMNS <span style="color: #ff0000;">"IMAGE"</span>, <span style="color: #ff0000;">"NAME"</span> ;<br />HEADERS <span style="color: #ff0000;">"Service"</span>,<span style="color: #ff0000;">"Desc"</span> ;<br />DATASOURCE oServizi ;<br />LINES NOBORDER<br />&nbsp;</div>[/code:1tdgivxr] Please remove :SetODbf(...) You will get errors if you do not use the command the correct way
to Nages : probl..FW_ArrayToDbf with tdatabase - RESOLVED!!
Thanks I remember i inserted allways numbers with columns command in past
to Nages: test for tdatabase
I saw your test and run ok ( NextID) it is used only for Sclienti.dbf How i can to use the same system for other archives ? Must I create a control.dbf for each dbf ? Regards
to Nages: test for tdatabase
We can have one control file for many DBFs I will post a sample to work with more DBFs I will also change the name of the control file and some classes You can then use that revised sample as a final template
to Nages: test for tdatabase
Do you remember my idea function? I know it was very elementary written by a child but maybe it could work besides the various archives I had also thought about the different lengths of the code because each archive could have different dimensions example customers ---> 0001 Invoices -----> 0000000001
to Nages: test for tdatabase
Nages on the test I add a new Method to duplicate a record ( seem run ok) @ 20,360 BTNBMP PROMPT "Duplicate" SIZE 100,35 PIXEL OF oDlg FLAT ; ACTION oClients:Duplicate(oClients) [code=fw:1cupc311]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> Duplicate<span style="color: #000000;">&#40;</span>oClients<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TClients<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oClienteTemp &nbsp; := oClients:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oClienteNew<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;oClienteTemp:<span style="color: #000000;">Copy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oClienteNew &nbsp; := oClients:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span> , .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oClienteNew:<span style="color: #000000;">Paste</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp;oClienteNew:<span style="color: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1cupc311] only not refresh the xbrowser ( id) when save or not) I thinked the index is on ID ....
to Nages: test for tdatabase
Hello Silvio, I would suggest for better understanding this program insert following code. @ 150, 40 BTNBMP PROMPT "SAVE" SIZE 100,35 PIXEL OF oDlg FLAT WHEN oRec:Modified() ; ACTION ( oRec:City := dtos( date() ) + "/" + time() ,oRec:Save(), lExit := .t., oDlg:End() ) The customer numbers are one after the other but chronology is not guaranteed. Best regards Otto [img:8gfx4bmw]http&#58;//mybergland&#46;com/FWForum/Clip6&#46;jpg[/img:8gfx4bmw]
to Nages: test for tdatabase
Dear Friend Silvio The inherent problem in this approach is that the IDs are not chronologically in ascending order and there can be gaps in the serial order. In case of invoices, invoice numbers not being in serial order would be highly objectionable. Some programmer friends even felt that such database may be viewed with suspicion by tax authorities. You were always insisting on displaying the next serial number in the append dialog. None of us can guess what exactly will be the next serial number in chronological order when the new record is saved in a multi-user environment. This can be known only when the new record is appended. I remember very well that you refused all advices in this regard. Even at the risk of you blaming me also, I would reuest you once again re-consider your insistence to display the next serial in the append dialog even before saving it.
to Nages: test for tdatabase
Mr. Rao, I suppose ID’s are the same as account numbers. In many cases they are just a field for quick connection of data and I’m not sure why chronological order would be of any value. However, with invoices, you certainly want them in the exact order created. I use a Counters.dbf that has one record and it contains the latest assigned number in fields for each ID assigned ( ie. Workorder/Invoice, customer number, accounting, etc ). Since I have classes for each process like work orders, my Add() method appends a record, fills the buffers with blanks, then goes to the counter dbf, increments the proper number, saves the value back to the record, and saves it to the appended record. The interaction with the counters file takes a fraction of a second and that is never an issue in multi-user environments. It is important to not have gaps, especially in invoices. Customer data, parts and labor, and all other info is assigned after the record is created, so if one were started accidentally it could still be used for another job. The first part of the workorder process is to create an estimate. If the work is refused, I tell my clients to make a note on the invoice, have the customer sign it, then save the result. Thus, in an audit, there are never anyone holes. I’ve done this for over 30 years in multi-user environments and never had a problem with assigning the IDs nor have any of my clients ever had problems with audits. I think your points are very valid.
to Nages: test for tdatabase
[quote:1plr7m6n] I suppose ID’s are the same as account numbers. In many cases they are just a field for quick connection of data and I’m not sure why chronological order would be of any value. [/quote:1plr7m6n] Agree. That is what the already posted Clients sample does. [quote:1plr7m6n] However, with invoices, you certainly want them in the exact order created. [/quote:1plr7m6n] Yes. [quote:1plr7m6n] I use a Counters.dbf that has one record and it contains the latest assigned number in fields for each ID assigned ( ie. Workorder/Invoice, customer number, accounting, etc ). Since I have classes for each process like work orders, my Add() method appends a record, fills the buffers with blanks, then goes to the counter dbf, increments the proper number, saves the value back to the record, and saves it to the appended record. The interaction with the counters file takes a fraction of a second and that is never an issue in multi-user environments. [/quote:1plr7m6n] Even the above Clients sample uses control.dbf same way you are using counters.dbf. Oracle does not have autoincrement field type. It uses Sequences, which are virtual tables with the same logic as your counters.dbf. Till DBFCDX introduced AutoIncrement field type, we all had to adopt some similar logic to generate sequence numbers. All this logic is no more required if we use AutoIncrement fields. Here is the important difference: You are fetching the incremented value at the time of appending the record. Here we are required to fetch the incremented value in advance and display it in the Append Dialog without being sure whether the user will save or cancel the append and whether other users save their appends prior to or after this user's save. This results in numbers not being in chronological order.
to Nages: test for tdatabase
First of all I have to specify one thing: For the management of customers, the system (the test) that Rao did as well for other archives is fine for me. the only thing I asked for was to use only a control.dbf file for all the archives and to have different types of lengths for example 4-digit customers, 10-digit orders For invoices, the invoice number must be associated with the invoice date In Italy the art. 21 of Presidential Decree 633/1972 establishes the minimum elements that an invoice must contain, so that it can be considered validly issued. In the most serious cases the financial administration can also contest the false invoicing, with implications of a criminal nature (Article 2 and 3 of Legislative Decree 74/2000) Minimum elements of an invoice: issuing date; progressive number that uniquely identifies it; and other data customer,articles , total, vat
to Nages: test for tdatabase
[quote="nageswaragunupudi":36oaiywx]Dear Friend Silvio The inherent problem in this approach is that the IDs are not chronologically in ascending order and there can be gaps in the serial order. In case of invoices, invoice numbers not being in serial order would be highly objectionable. Some programmer friends even felt that such database may be viewed with suspicion by tax authorities. You were always insisting on displaying the next serial number in the append dialog. None of us can guess what exactly will be the next serial number in chronological order when the new record is saved in a multi-user environment. This can be known only when the new record is appended. I remember very well that you refused all advices in this regard. Even at the risk of you blaming me also, I would reuest you once again re-consider your insistence to display the next serial in the append dialog even before saving it.[/quote:36oaiywx] I had only asked to have some compatibility with the old application. the user at the time of edit saw in the dialog the user code as you did in the test [img:36oaiywx]https&#58;//i&#46;postimg&#46;cc/g0V0g8jS/n&#46;jpg[/img:36oaiywx]
to Nages: test for tdatabase
The legal requirements would be met by data saved in the fields, ie. InvoiceNumber, InvoiceDate, InvoiceTime, Customer, Address, etc. As for the control file, one field could be set for each category, and the size of the field denotes the number it could hold, ie. "invoice", N, 10; "customer", N, 6; "inventory", N, 8; etc.
to Nages: test for tdatabase
yes everything is fine but I do not prefer to talk to You mr Tm after the last messages we have had it seems to me that I have spoken clearly, You have a ideas, I have my own: I even had to suffer from your even of the offensive accusations now you have the courage to intrude and give advice: I have no words !!!
to Nages: test for tdatabase
[quote="Silvio.Falconi":3f7nnqa6]First of all I have to specify one thing: For the management of customers, the system (the test) that Rao did as well for other archives is fine for me. the only thing I asked for was to use only a control.dbf file for all the archives and to have different types of lengths for example 4-digit customers, 10-digit orders [/quote:3f7nnqa6] [quote="Silvio.Falconi":3f7nnqa6]Nages on the test I add a new Method to duplicate a record ( seem run ok) [/quote:3f7nnqa6] I have implemented your requirements. This is the program to test. [code=fw:3f7nnqa6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">static</span> cPath      <span style="color: #B900B9;">// give here your path</span><br /><br /><span style="color: #00C800;">static</span> l3BtnStyle := .t.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">DEFAULT</span> cPath  := cFilePath<span style="color: #000000;">&#40;</span> ExeName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   TClients<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Browse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   TItems<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Browse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// View Raw Tables</span><br />   SET DELETED OFF<br />   XBROWSER cPath + <span style="color: #ff0000;">"SCLIENTS.DBF"</span><br />   XBROWSER cPath + <span style="color: #ff0000;">"SITEMS.DBF"</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: #0000ff;">INIT</span> PROCEDURE PrgInit<br /><br />   RDDSETDEFAULT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br />   SET DELETED <span style="color: #0000ff;">ON</span><br /><br />   SET DATE ITALIAN<br />   SET CENTURY <span style="color: #0000ff;">ON</span><br />   SET TIME FORMAT <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"HH:MM:SS"</span><br /><br />   FWNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">&#41;</span><br />   SetGetColorFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// TCLIENTS CLASS DERIVED FROM TDATASEQ in TSEQ.PRG</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TClients <span style="color: #0000ff;">FROM</span> TDataSEQ<br /><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> CONSTRUCTOR<br />   <span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> ValidRec<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> CreateDBF<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br />   <span style="color: #00C800;">local</span> cDBF := cPath + <span style="color: #ff0000;">"SCLIENTS.DBF"</span><br /><br />   <span style="color: #00C800;">if</span> !File<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span>; ::<span style="color: #000000;">CreateDBF</span><span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">endif</span><br />   ::<span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cDBF, <span style="color: #ff0000;">"CLIENTID"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// dbfName, KeyField</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br />   <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br />   <span style="color: #00C800;">local</span> oDlg, oFont, oBrw, oRec<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Clients"</span><br /><br />   @ <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg DATASOURCE <span style="color: #00C800;">Self</span> ;<br />      COLUMNS <span style="color: #ff0000;">"ClientID"</span>, <span style="color: #ff0000;">"First"</span>, <span style="color: #ff0000;">"Last"</span>, <span style="color: #ff0000;">"City"</span> CELL LINES NOBORDER<br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"New"</span>    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">EditSource</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">140</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">EditSource</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Duplicate"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oRec  := oSelf:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />               oRec:<span style="color: #000000;">Paste</span><span style="color: #000000;">&#40;</span> oSelf:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />               oRec:<span style="color: #000000;">oBrw</span> := oBrw, ;<br />               oRec:<span style="color: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">380</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Delete"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">Delete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br />   <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br />   <span style="color: #00C800;">local</span> oDlg, oFont, oBmp, oBmp3, nID<br />   <span style="color: #00C800;">local</span> lExit    := .f.<br /><br />   oRec:<span style="color: #000000;">bValid</span>    := <span style="color: #000000;">&#123;</span> |o| oSelf:<span style="color: #000000;">ValidRec</span><span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"NEW CLIENT"</span>, <span style="color: #ff0000;">"EDIT CLIENT"</span> <span style="color: #000000;">&#41;</span><br /><br />   @  <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"ClientID :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">ClientID</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> READONLY<br />   @  <span style="color: #000000;">70</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"First    :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">First</span>    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br />   @ <span style="color: #000000;">100</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Last     :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">Last</span>     <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br />   @ <span style="color: #000000;">130</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"City     :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">City</span>     <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br /><span style="color: #00C800;">if</span> l3BtnStyle<br />   @ <span style="color: #000000;">180</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SAVE"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">180</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"UNDO"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Undo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">180</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> oBmp3 <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Modified</span>, <span style="color: #ff0000;">"CANCEL"</span>, <span style="color: #ff0000;">"CLOSE"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">UPDATE</span> ;<br />      <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> oBmp3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, oSelf:<span style="color: #000000;">ResetID</span><span style="color: #000000;">&#40;</span> Val<span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">ClientID</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>, ;<br />               lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   oBmp:<span style="color: #000000;">lCancel</span>   := .t.<br /><span style="color: #00C800;">else</span><br />   @ <span style="color: #000000;">180</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SAVE"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">180</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"CANCEL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, oSelf:<span style="color: #000000;">ResetID</span><span style="color: #000000;">&#40;</span> Val<span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">ClientID</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>, ;<br />               lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   oBmp:<span style="color: #000000;">lCancel</span>   := .t.<br /><span style="color: #00C800;">endif</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> lExit <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<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;">METHOD</span> ValidRec<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br />   <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">First</span> <span style="color: #000000;">&#41;</span> .or. Empty<span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Last</span> <span style="color: #000000;">&#41;</span> .or. Empty<span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">City</span> <span style="color: #000000;">&#41;</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"First, Last, City can not be empty"</span>, <span style="color: #ff0000;">"INVALID RECORD"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span> .f.<br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #000000;">UniqueValue</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">First</span> -<span style="color: #ff0000;">"|"</span>- oRec:<span style="color: #000000;">Last</span>, <span style="color: #ff0000;">"FIRSTLAST"</span>, oRec:<span style="color: #000000;">RecNo</span>, .t. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> CreateDBF<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br />   field FIRST,LAST<br />   <span style="color: #00C800;">local</span> aStruct  :=  <span style="color: #000000;">&#123;</span> ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ROWID"</span>,     <span style="color: #ff0000;">"+"</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CREATEDT"</span>,  <span style="color: #ff0000;">"T"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"UPDATEDT"</span>,  <span style="color: #ff0000;">"="</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CLIENTID"</span>,  <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"FIRST"</span>,     <span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"LAST"</span>,      <span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CITY"</span>,      <span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>  <span style="color: #000000;">&#125;</span><br /><br />   DBCREATE<span style="color: #000000;">&#40;</span> cName, aStruct, <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"SD"</span> <span style="color: #000000;">&#41;</span><br />   FW_CdxCreate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">&#40;</span> FIRST-<span style="color: #ff0000;">"|"</span>-LAST <span style="color: #000000;">&#41;</span> TAG FIRSTLAST<br />   CLOSE SD<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// TITEMS CLASS DERIVED FROM TDATASEQ in TSEQ.PRG</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TItems <span style="color: #0000ff;">FROM</span> TDataSEQ<br /><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> CONSTRUCTOR<br />   <span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> ValidRec<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> CreateDBF<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br />   <span style="color: #00C800;">local</span> cDBF := cPath + <span style="color: #ff0000;">"SITEMS.DBF"</span><br /><br />   <span style="color: #00C800;">if</span> !File<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span>; ::<span style="color: #000000;">CreateDBF</span><span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cDBF, <span style="color: #ff0000;">"ITEMID"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// DbfName, KeyField</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br />   <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br />   <span style="color: #00C800;">local</span> oDlg, oFont, oBrw, oRec<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Items"</span><br /><br />   @ <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE <span style="color: #00C800;">Self</span> COLUMNS <span style="color: #ff0000;">"ItemID"</span>, <span style="color: #ff0000;">"ItemName"</span>, <span style="color: #ff0000;">"Rate"</span>, <span style="color: #ff0000;">"VAT"</span> ;<br />      CELL LINES NOBORDER FASTEDIT<br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"New"</span>    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">EditSource</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">140</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">EditSource</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Duplicate"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oRec  := oSelf:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />               oRec:<span style="color: #000000;">Paste</span><span style="color: #000000;">&#40;</span> oSelf:<span style="color: #000000;">Record</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />               oRec:<span style="color: #000000;">oBrw</span> := oBrw, ;<br />               oRec:<span style="color: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">380</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Delete"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">Delete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br />   <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br />   <span style="color: #00C800;">local</span> oDlg, oFont, oBmp, oBmp3, nID<br />   <span style="color: #00C800;">local</span> lExit    := .f.<br /><br />   oRec:<span style="color: #000000;">bValid</span>    := <span style="color: #000000;">&#123;</span> |o| oSelf:<span style="color: #000000;">ValidRec</span><span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"NEW CLIENT"</span>, <span style="color: #ff0000;">"EDIT CLIENT"</span> <span style="color: #000000;">&#41;</span><br /><br />   @  <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"ItemID   :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">ItemID</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> READONLY<br /><br />   @  <span style="color: #000000;">70</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"ItemName :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">ItemName</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br />         <span style="color: #0000ff;">VALID</span> ::<span style="color: #000000;">UniqueValue</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">ItemName</span>, <span style="color: #ff0000;">"ITEMNAME"</span>, oRec:<span style="color: #000000;">RecNo</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">100</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Rate     :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #0000ff;">Rate</span>     <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br />         <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E 99,999.99"</span> <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">VALID</span> oRec:<span style="color: #0000ff;">Rate</span> > <span style="color: #000000;">0.0</span><br /><br />   @ <span style="color: #000000;">130</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"VAT %    :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">Vat</span>      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br />         <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E 99.99 %"</span> <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">VALID</span> oRec:<span style="color: #000000;">Vat</span> >= <span style="color: #000000;">0.0</span><br /><br /><span style="color: #00C800;">if</span> l3BtnStyle<br />   @ <span style="color: #000000;">180</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SAVE"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">180</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"UNDO"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Undo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">180</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> oBmp3 <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Modified</span>, <span style="color: #ff0000;">"CANCEL"</span>, <span style="color: #ff0000;">"CLOSE"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">UPDATE</span> ;<br />      <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> oBmp3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, oSelf:<span style="color: #000000;">ResetID</span><span style="color: #000000;">&#40;</span> Val<span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">ItemID</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>, ;<br />               lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   oBmp:<span style="color: #000000;">lCancel</span>   := .t.<br /><span style="color: #00C800;">else</span><br />   @ <span style="color: #000000;">180</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SAVE"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">180</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"CANCEL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, oSelf:<span style="color: #000000;">ResetID</span><span style="color: #000000;">&#40;</span> Val<span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">ItemID</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>, ;<br />               lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   oBmp:<span style="color: #000000;">lCancel</span> := .t.<br /><span style="color: #00C800;">endif</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> lExit <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ValidRec<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br />   <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">ItemName</span> <span style="color: #000000;">&#41;</span> .or. Empty<span style="color: #000000;">&#40;</span> oRec:<span style="color: #0000ff;">Rate</span> <span style="color: #000000;">&#41;</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ItemName, Rate can not be empty"</span>, <span style="color: #ff0000;">"INVALID RECORD"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span> .f.<br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #000000;">UniqueValue</span><span style="color: #000000;">&#40;</span> oRec:<span style="color: #000000;">ItemName</span>, <span style="color: #ff0000;">"ITEMNAME"</span>, oRec:<span style="color: #000000;">RecNo</span>, .t. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> CreateDBF<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br />   field FIRST,LAST<br /><br />   DBCREATE<span style="color: #000000;">&#40;</span> cName, <span style="color: #000000;">&#123;</span> ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ROWID"</span>,     <span style="color: #ff0000;">"+"</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CREATEDT"</span>,  <span style="color: #ff0000;">"T"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"UPDATEDT"</span>,  <span style="color: #ff0000;">"="</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ITEMID"</span>,    <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ITEMNAME"</span>,  <span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"RATE"</span>,      <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"VAT"</span>,       <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>  <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"SD"</span> <span style="color: #000000;">&#41;</span><br />   FW_CdxCreate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   CLOSE SD<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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// TDATASEQ CLASS: Derive classes for tables from this class</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TDataSEQ <span style="color: #0000ff;">FROM</span> TDatabase<br /><br />   <span style="color: #00C800;">DATA</span> oSequenza<br /><br />   <span style="color: #00C800;">DATA</span> cKeyFld, nKeyLen<br /><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cDbf, cKeyFld <span style="color: #000000;">&#41;</span> CONSTRUCTOR<br />   <span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> <span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> NextID<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> STRZERO<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oSequenza</span>:<span style="color: #000000;">NextVal</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nKeyLen</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> ResetID<span style="color: #000000;">&#40;</span> nID <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">oSequenza</span>:<span style="color: #000000;">Reset</span><span style="color: #000000;">&#40;</span> nID <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> Record<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> UniqueValue<span style="color: #000000;">&#40;</span> uValue, cOrder, nRec, lMsg <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cDbf, cKeyFld <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TDataSEQ<br /><br />   field CREATEDT, UPDATEDT<br /><br />   ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> , cDbf, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">cKeyFld</span>      := cKeyFld<br />   ::<span style="color: #000000;">nKeyLen</span>      := ::<span style="color: #000000;">FieldLen</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cKeyFld</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">oSequenza</span>    := TSequenze<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cFile</span> <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">bEdit</span>        := <span style="color: #000000;">&#123;</span> |oRec| ::<span style="color: #000000;">EditDlg</span><span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CREATEDT"</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> .and. ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"UPDATEDT"</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />      ::<span style="color: #000000;">bTrigger</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> CREATEDT <span style="color: #000000;">&#41;</span>, CREATEDT := UPDATEDT, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Record<span style="color: #000000;">&#40;</span> cFieldList, lNew <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TDataSEQ<br /><br />   <span style="color: #00C800;">local</span> oRec, cID, n<br /><br />   <span style="color: #00C800;">if</span> HB_ISLOGICAL<span style="color: #000000;">&#40;</span> cFieldList <span style="color: #000000;">&#41;</span><br />      lNew        := cFieldList<br />      cFieldList  := <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br /><br />   oRec  := TDataRow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span>, cFieldList, lNew <span style="color: #000000;">&#41;</span><br />   WITH OBJECT oRec<br />      :<span style="color: #000000;">lNavigate</span>     := .f.<br />      :<span style="color: #000000;">bEdit</span>         := ::<span style="color: #000000;">bEdit</span><br />      <span style="color: #00C800;">if</span> lNew == .t.<br />         cID      := ::<span style="color: #000000;">NextID</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">SetDefault</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cKeyFld</span>, cID, .f. <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">aOrg</span><span style="color: #000000;">&#91;</span> :<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cKeyFld</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> := cID<br />      <span style="color: #00C800;">endif</span><br />      :<span style="color: #000000;">FieldReadOnly</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cKeyFld</span>, .t. <span style="color: #000000;">&#41;</span><br />   END<br /><br /><span style="color: #00C800;">return</span> oRec<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> UniqueValue<span style="color: #000000;">&#40;</span> uValue, cOrder, nRec, lMsg <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TDataSEQ<br /><br />   <span style="color: #00C800;">local</span> cSaveOrd := ::<span style="color: #000000;">OrdSetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nSaveRec := ::<span style="color: #000000;">RecNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> cFoundID := <span style="color: #ff0000;">""</span><br />   <span style="color: #00C800;">local</span> nFoundAt := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> lUnique  := .f.<br />   <span style="color: #00C800;">local</span> c<br /><br />   <span style="color: #00C800;">DEFAULT</span> nRec := nSaveRec, lMsg := .f.<br /><br />   ::<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> cOrder <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> HB_ISCHAR<span style="color: #000000;">&#40;</span> C := ::<span style="color: #000000;">OrdKeyVal</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      uValue   := PadR<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span>, Len<span style="color: #000000;">&#40;</span> c <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> <span style="color: #ff0000;">"UPPER"</span> $ ::<span style="color: #000000;">OrdKey</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         uValue   := Upper<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span><br />      nFoundAt := ::<span style="color: #000000;">RecNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      cFoundID := ::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cKeyFld</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br />   ::<span style="color: #000000;">OrdSetFocus</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> cSaveOrd <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>, cSaveOrd <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span> nSaveRec <span style="color: #000000;">&#41;</span><br /><br />   lUnique := <span style="color: #000000;">&#40;</span> nFoundAt == <span style="color: #000000;">0</span> .or. nFoundAt == nRec <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> lMsg .and. !lUnique<br />      MsgAlert<span style="color: #000000;">&#40;</span>  cFoundID + <span style="color: #ff0000;">" has the same value"</span> + CRLF + ;<br />                 cValToChar<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span> , <span style="color: #ff0000;">"DUPLICATE"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> lUnique<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">&#40;</span> oRec <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TDataSEQ<br /><br />   oRec:<span style="color: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// TSEQUENZE CLASS</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TSequenze <span style="color: #0000ff;">FROM</span> TDatabase<br /><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> CONSTRUCTOR<br />   <span style="color: #00C800;">METHOD</span> NextVal<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> Reset<span style="color: #000000;">&#40;</span> nId <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> CreateSEQDBF<span style="color: #000000;">&#40;</span> cPath <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TSequenze<br /><br />   <span style="color: #00C800;">local</span> cPath    := cFilePath<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> cName    := Upper<span style="color: #000000;">&#40;</span> cFileNoExt<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> cSeqDbf  := cPath + <span style="color: #ff0000;">"SEQUENZE.DBF"</span><br />   <span style="color: #00C800;">local</span> cFilter  := <span style="color: #ff0000;">'TRIM( FIELD->DBF ) == "'</span> + cName + <span style="color: #ff0000;">'"'</span><br /><br />   <span style="color: #00C800;">if</span> !File<span style="color: #000000;">&#40;</span> cSeqDbf <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">CreateSEQDBF</span><span style="color: #000000;">&#40;</span> cSeqDbf <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> , cSeqDbf, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">SetFilter</span><span style="color: #000000;">&#40;</span> cFilter <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//      ::Append( "DBF,COUNTER,UNUSED", { cName, 0, {} } )</span><br />      <span style="color: #B900B9;">//</span><br />      ::<span style="color: #000000;">Append</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBF,COUNTER"</span>, <span style="color: #000000;">&#123;</span> cName, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">RecLock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>->UNUSED := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />      ::<span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">RecUnlock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #B900B9;">//</span><br />      ::<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> NextVal<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TSequenze<br /><br />   field COUNTER, UNUSED<br />   <span style="color: #00C800;">local</span> nID, bAction<br /><br />   bAction  := <||<br />      <span style="color: #00C800;">local</span> a := UNUSED<br />      <span style="color: #00C800;">local</span> nRet<br />      <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> a <span style="color: #000000;">&#41;</span><br />         nRet  := ATail<span style="color: #000000;">&#40;</span> a <span style="color: #000000;">&#41;</span><br />         a     := ASize<span style="color: #000000;">&#40;</span> a, Len<span style="color: #000000;">&#40;</span> a <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />         UNUSED := a<br />      <span style="color: #00C800;">else</span><br />         COUNTER    := COUNTER + <span style="color: #000000;">1</span><br />         nRet  := COUNTER<br />      <span style="color: #00C800;">endif</span><br />      DBCOMMIT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span> nRet<br />      ><br /><br />   <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .not. ::<span style="color: #000000;">RecLock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">enddo</span><br /><br />   nID   := ::<span style="color: #000000;">Exec</span><span style="color: #000000;">&#40;</span> bAction <span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">Load</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> nID<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Reset<span style="color: #000000;">&#40;</span> nID <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TSequenze<br /><br />   field COUNTER, UNUSED<br />   <span style="color: #00C800;">local</span> bAction<br /><br />   bAction := <||<br />      <span style="color: #00C800;">local</span> a<br />      <span style="color: #00C800;">if</span> nID == COUNTER<br />         COUNTER := COUNTER - <span style="color: #000000;">1</span><br />      elseif nID < COUNTER<br />         a  := UNUSED<br />         AAdd<span style="color: #000000;">&#40;</span> a, nID <span style="color: #000000;">&#41;</span><br />         UNUSED   := a<br />      <span style="color: #00C800;">endif</span><br />      DBCOMMIT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   ><br /><br />   <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .not. ::<span style="color: #000000;">RecLock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">enddo</span><br /><br />   ::<span style="color: #000000;">Exec</span><span style="color: #000000;">&#40;</span> bAction <span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">Load</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">METHOD</span> CreateSEQDBF<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TSequenze<br /><br />   DBCREATE<span style="color: #000000;">&#40;</span> cName, <span style="color: #000000;">&#123;</span> ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DBF"</span>,     <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"COUNTER"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"UNUSED"</span>,  <span style="color: #ff0000;">"M"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>  <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:3f7nnqa6] This approach has the same cons as discussed above, i.e., the IDs generated may not be ascending the chronological order and some IDs in the serial may be missing. However, the fields RowID (autoincrement), CreateDt, UpdateDt, which are internal to the dbf and not displayed to the user, are in chronologically serial order and are evidence of the genuineness of data. Please delete any tables like "sclients.*" created by the previous sample, before testing this program
to Nages: test for tdatabase
Thank you Rao for the test I tried with my tablet windows even if I am in hospital because I had an assault for a car park under my house: tachycardia and nasiotic state keep me here in the hospital under observation but I can use the tablet lenovo and I answer you that: 1) when I entered customers or items after pressing save the test does not return to xbrowse 2) this is the same even when I duplicate 3) not knowing the new commands "T" and "=" and "+" I would not have problems with these types of files but if you say that it is ok I trust you 4) in the delete function the record is deleted but in xbrowse a trace remains as you can see in this figure:[b:3h9orlyq] I had deleted that record[/b:3h9orlyq] !!! [img:3h9orlyq]https&#58;//i&#46;postimg&#46;cc/q7St025M/ddd&#46;png[/img:3h9orlyq] obviously this is a test I know so something is not yet defined This morning I feel better even though the doctors say I still have a bit of tachycardia thank You however, the function of undo is beautiful
to Nages: test for tdatabase
Please take care of your health first. We will discuss after your discharge. Please also do not work in the hospital. Wish you get well very soon.
to Nages: test for tdatabase
thanks ok
to Nages: test for tdatabase
Hello Silvio, I read that you have a new law starting on 1-7-2019 for billing. How does this effect your software. Best regards Otto google translated According to the new provision, the daily income - electronically recorded and - telematically transmitted to the Agency for Revenue. By introducing the electronically recorded daily income with the already introduced electronic invoice, the circle is closed with which all active sales are electronically occupied. The tax receipt ("Ricevuta fiscale") is de facto abolished with the introduction of telematic daily revenues. As of 01.01.2020 (or from 01.07.2019 for companies with previous year's turnover of more than Euro 400.000) it will no longer be possible to issue tax receipts.