topic
stringlengths
1
63
text
stringlengths
1
577k
ChatGPT
Antonio, paid users of chatgpt can use webbrowsing and plugins, to me openai release yesterday, Otto seams have access before. i will try plugins and make my plugins. best regards
ChatGPT
Hello, Yes, it's as you say. Are you familiar with the plugins? Do you think it's possible to not install a plugin but simply copy and paste the source code into ChatGPT on a case-by-case basis? Best regards, Otto
ChatGPT
Hello friends, I have read that Bing also provides an API. Who has experience with Bing Chat? Best regards, Otto
ChatGPT - connection error
[b:2zv4uvf2]I have the key[/b:2zv4uvf2] [code=fw:2zv4uvf2]<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: #00D7D7;">#define</span> EM_LIMITTEXT <span style="color: #000000;">197</span><br /><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, oGet1, cVar1 := <span style="color: #ff0000;">"Hola OpenAI, cómo estás ? Me llamo Carlos, tú tienes nombre ?"</span><br />   <span style="color: #00C800;">LOCAL</span> oGet2, cVar2 := Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">2048</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> oFont1, oFont2, oBtn1, oSay1, oSay2<br />   <span style="color: #00C800;">LOCAL</span> nChars := <span style="color: #000000;">2048</span><br />   TBtnBmp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">lLegacyLookLeftRight</span> := .T.<br />   <br />   cVar1 := <span style="color: #ff0000;">"Puedes mostrarme el código de un programa escrito en lenguaje Harbour que en la function main tenga un Alert que diga 'Hola Mundo' ?"</span><br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont1 <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;">-12</span> BOLD<br />   <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;">-12</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">39</span>,<span style="color: #000000;">107</span> TRUEPIXEL <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Taking with OPENAI API"</span><br />   <br />       @ <span style="color: #000000;">10</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Talking with OPENAI API"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,15PIXEL <span style="color: #0000ff;">CENTER</span><br />       @ <span style="color: #000000;">28</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"You:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span><br />   <br />       @ <span style="color: #000000;">28</span>,<span style="color: #000000;">680</span> <span style="color: #0000ff;">SAY</span> oSay1 <span style="color: #0000ff;">VAR</span> <span style="color: #ff0000;">"Caracteres: 0 / "</span>+cValToChar<span style="color: #000000;">&#40;</span>nChars<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span>;<br />                        <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">CENTER</span><br />   <br />       @ <span style="color: #000000;">45</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">VAR</span> cVar1 <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>,<span style="color: #000000;">200</span> MEMO <span style="color: #0000ff;">FONT</span> oFont2;<br />               <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span><span style="color: #000000;">&#40;</span>SB_LimitText<span style="color: #000000;">&#40;</span>oGet1, oSay1, nChars<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />            oGet1:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">&#123;</span>||oGet1:<span style="color: #000000;">SetSel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />   <br />       @ <span style="color: #000000;">250</span>,<span style="color: #000000;">345</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Submit"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> Api_OpenAI<span style="color: #000000;">&#40;</span>cVar1, oGet2<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">150</span>,<span style="color: #000000;">45</span>;<br />             FILE <span style="color: #ff0000;">"openai24x24.png"</span> <span style="color: #0000ff;">LEFT</span> NOBORDER <span style="color: #000000;">2007</span><br />   <br />       @ <span style="color: #000000;">300</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"OPENAI:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span><br />   <br />       @ <span style="color: #000000;">317</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet2 <span style="color: #0000ff;">VAR</span> cVar2 <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>,<span style="color: #000000;">200</span> MEMO <span style="color: #0000ff;">FONT</span> oFont2<br />            oGet2:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">&#123;</span>||oGet2:<span style="color: #000000;">SetSel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />   <br />       @ <span style="color: #000000;">535</span>,<span style="color: #000000;">620</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <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;">SIZE</span> <span style="color: #000000;">150</span>,<span style="color: #000000;">45</span>;<br />             FILE <span style="color: #ff0000;">"exit24x24.png"</span> <span style="color: #0000ff;">LEFT</span> NOBORDER <span style="color: #000000;">2007</span><br />   <br />       oDlg:<span style="color: #000000;">bInit</span> := <span style="color: #000000;">&#123;</span>|| oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                          oGet1:<span style="color: #000000;">LimitText</span><span style="color: #000000;">&#40;</span>nChars<span style="color: #000000;">&#41;</span>,;<br />                          oSay1:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Caracteres: "</span> + cValToChar<span style="color: #000000;">&#40;</span>LEN<span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> oGet1:<span style="color: #000000;">cText</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + cValToChar<span style="color: #000000;">&#40;</span>nChars<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />                          oSay1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</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;">ON</span> <span style="color: #0000ff;">PAINT</span> oGet1:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">Function</span> Api_OpenAI<span style="color: #000000;">&#40;</span>cPrompt, oGet2<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> oSoap := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"MSXML2.ServerXMLHTTP.6.0"</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> cUrl   := <span style="color: #ff0000;">"http://api.openai.com/v1/engines/text-davinci-003/completions"</span><br /><br />   <br />    <span style="color: #B900B9;">// [b:2zv4uvf2]I have the key[/b:2zv4uvf2]  :-)</span><br />   <span style="color: #B900B9;">//LOCAL cToken := "sk-....."</span><br />   <span style="color: #00C800;">LOCAL</span> cJSon, cRespApi, hResp := <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span>, cResp<br />   <br />   <span style="color: #0000ff;">TEXT</span> INTO cJson<br />        <span style="color: #000000;">&#123;</span><br />            <span style="color: #ff0000;">"prompt"</span>: <span style="color: #ff0000;">"cPrompt_empty"</span>,<br />            <span style="color: #ff0000;">"temperature"</span>: <span style="color: #000000;">0</span>,<br />            <span style="color: #ff0000;">"max_tokens"</span>: <span style="color: #000000;">2048</span><br />        <span style="color: #000000;">&#125;</span><br />   ENDTEXT<br />   <br />   cPrompt := AllTrim<span style="color: #000000;">&#40;</span>cPrompt<span style="color: #000000;">&#41;</span><br />   cJson := StrTran<span style="color: #000000;">&#40;</span>cJson, <span style="color: #ff0000;">"cPrompt_empty"</span>, cPrompt<span style="color: #000000;">&#41;</span><br />   <br />   oSoap:<span style="color: #000000;">SetTimeouts</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">30000</span>,<span style="color: #000000;">30000</span>,<span style="color: #000000;">30000</span>,<span style="color: #000000;">30000</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">TRY</span><br />      oSoap:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"POST"</span> , cUrl , .F. <span style="color: #000000;">&#41;</span><br />      oSoap:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Content-Type"</span>, <span style="color: #ff0000;">"application/json; charset=utf-8"</span> <span style="color: #000000;">&#41;</span><br />      oSoap:<span style="color: #000000;">setRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Authorization"</span>, <span style="color: #ff0000;">"Bearer "</span>+cToken <span style="color: #000000;">&#41;</span><br />      oSoap:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span>cJson<span style="color: #000000;">&#41;</span><br />   <br />      cRespApi := Alltrim<span style="color: #000000;">&#40;</span>oSoap:<span style="color: #000000;">responseText</span><span style="color: #000000;">&#41;</span><br />      hb_jsondecode<span style="color: #000000;">&#40;</span>cRespApi,@hResp<span style="color: #000000;">&#41;</span><br />   <br />      cResp := hResp<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"choices"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"text"</span><span style="color: #000000;">&#93;</span><br />      cResp := StrTran<span style="color: #000000;">&#40;</span>cResp, Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span>, Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      oGet2:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span>cResp<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      oGet2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />     <span style="color: #B900B9;">// MsgInfo( oSoap:Status )</span><br />   <br />   CATCH<br />      <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Mensaje en el CATCH"</span>+CRLF+CRLF+ <span style="color: #ff0000;">"No hay conexión con el servidor de Rindegastos."</span>+CRLF+ <span style="color: #ff0000;">"  Por favor vuelva a intentarlo."</span>,<span style="color: #ff0000;">"Intente Nuevamente"</span><span style="color: #000000;">&#41;</span><br />   <br />   END<br />   <br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>oSoap<span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> SB_LimitText<span style="color: #000000;">&#40;</span> oGet, oSay, nLimObserv <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">///////////////////////////////////////////////////////////////////////////</span><br />   <span style="color: #B900B9;">// Autor..........: Peguei no Forum FiveWin Brasil                       //</span><br />   <span style="color: #B900B9;">// Modificaçoes...: Ale SB - Soft Camus                                  //</span><br />   <span style="color: #B900B9;">// Descricao......: Restringe o Tamanho de um Texto.                     //</span><br />   <span style="color: #B900B9;">// Parametros ==>                                                        //</span><br />   <span style="color: #B900B9;">//  - oGet  : oBjeto Get.                                                //</span><br />   <span style="color: #B900B9;">//  - nSize : Tamanho que deve ter o Texto.                              //</span><br />   <span style="color: #B900B9;">// Dependencias ==>                                                      //</span><br />   <span style="color: #B900B9;">// Retorno ==> nil                                                       //</span><br />   <span style="color: #B900B9;">///////////////////////////////////////////////////////////////////////////</span><br />   <span style="color: #00C800;">LOCAL</span> nTam, nSize<br />   <span style="color: #00C800;">DEFAULT</span> nSize := nLimObserv  <span style="color: #B900B9;">// 19  // 99 // maximo e 100 caracteres</span><br />   nTam := LEN<span style="color: #000000;">&#40;</span> ALLTRIM<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">cText</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">IF</span> nTam > nSize<br />      <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Lo siento, no puedo continuar, el tamaño máximo "</span> + ;<br />               <span style="color: #ff0000;">"ha excedido el límite permitido."</span>, <span style="color: #ff0000;">"Atención por favor."</span> <span style="color: #000000;">&#41;</span><br />      oGet:<span style="color: #000000;">cText</span> := <span style="color: #0000ff;">Substr</span><span style="color: #000000;">&#40;</span>oGet:<span style="color: #000000;">cText</span>, <span style="color: #000000;">1</span>, nTam<span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br />   oSay:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Caracteres: "</span> + cValToChar<span style="color: #000000;">&#40;</span>nTam<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + cValToChar<span style="color: #000000;">&#40;</span>nLimObserv<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />     oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//------------------------------------------------------------//</span><br /> <br /> </div>[/code:2zv4uvf2] [b:2zv4uvf2]Error[/b:2zv4uvf2] [code=fw:2zv4uvf2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Application<br />===========<br />   Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">c</span>:\sis\fsql901\visual\integrac\sisrev_api\chatgpt.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;">4</span>,<span style="color: #000000;">898</span>,<span style="color: #000000;">816</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>r2008190002<span style="color: #000000;">&#41;</span><br />   FiveWin  version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">22.12</span><br />   C compiler version: <span style="color: #000000;">Borland</span>/Embarcadero C++ <span style="color: #000000;">7.0</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span>-bit<span style="color: #000000;">&#41;</span><br />   Windows <span style="color: #000000;">7</span> <span style="color: #000000;">64</span> Bits, 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;">3</span> secs <br />   Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">08</span>/<span style="color: #000000;">18</span>/<span style="color: #000000;">23</span>, <span style="color: #000000;">09</span>:<span style="color: #000000;">37</span>:<span style="color: #000000;">40</span><br />   Error description: <span style="color: #000000;"><span style="color: #000000;">&#40;</span>DOS</span> Error <span style="color: #000000;">-2147352567</span><span style="color: #000000;">&#41;</span> WINOLE/<span style="color: #000000;">1007</span>  Erro no suporte a canais seguros<br /> <span style="color: #000000;">&#40;</span>0x80072F7D<span style="color: #000000;">&#41;</span>: <span style="color: #000000;">msxml6</span>.dll<br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = C      <span style="color: #000000;">&#123;</span><br />      <span style="color: #ff0000;">"prompt"</span>: <span style="color: #ff0000;">"<span style="color: #000000;">\r</span><span style="color: #000000;">\n</span>don't include the words 'Bot:' 'chatGPT:' 'User:' in your answerola"</span>,<br />      <span style="color: #ff0000;">"temperature"</span>: <span style="color: #000000;">0</span>,<br />      <span style="color: #ff0000;">"max_tokens"</span>: <span style="color: #000000;">2048</span><br />   <span style="color: #000000;">&#125;</span><br /><br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>:  => TOLEAUTO:<span style="color: #000000;">SEND</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>: <span style="color: #000000;">chatgpt</span>.prg => OPENAICALL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">163</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">chatgpt</span>.prg => TOPENAI:<span style="color: #000000;">ASK</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">120</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">chatgpt</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;">36</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;">181</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;">1811</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;">3689</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;">500</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;">1213</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;">307</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">chatgpt</span>.prg => MAIN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">84</span> <span style="color: #000000;">&#41;</span><br /><br />System<br />======<br />   CPU type: <span style="color: #000000;">Intel</span><span style="color: #000000;">&#40;</span>R<span style="color: #000000;">&#41;</span> Core<span style="color: #000000;">&#40;</span>TM<span style="color: #000000;">&#41;</span> i5-4690T CPU @ <span style="color: #000000;">2</span>.50GHz <span style="color: #000000;">2494</span> Mhz<br />   Hardware memory: <span style="color: #000000;">8083</span> megs<br /><br />   Free System resources: <span style="color: #000000;">90</span> %<br />        GDI    resources: <span style="color: #000000;">90</span> %<br />        User   resources: <span style="color: #000000;">90</span> %<br /><br />   Windows total applications running: <span style="color: #000000;">4</span><br />      <span style="color: #000000;">1</span> ,                                                                                                     <br />      <span style="color: #000000;">2</span> , C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5<span style="color: #000000;">.82</span><span style="color: #000000;">.7601</span>.18837_none_ec86b <br />      <span style="color: #000000;">3</span> , c:\sis\fsql901\visual\integrac\sisrev_api\chatgpt.exe                                               <br />      <span style="color: #000000;">4</span> GDI+ <span style="color: #0000ff;">Window</span>, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1<span style="color: #000000;">.1</span><span style="color: #000000;">.7601</span>.24542_none_5c0717c7a00ddc <br /><br />Variables in use<br />================<br />   Procedure     Type   Value<br />   ==========================<br />   TOLEAUTO:<span style="color: #000000;">SEND</span><br />     Param   <span style="color: #000000;">1</span>:    O    <span style="color: #00C800;">Class</span>: <span style="color: #000000;">ERROR</span><br />   OPENAICALL<br />     Param   <span style="color: #000000;">1</span>:    C    <span style="color: #ff0000;">"   {<br />      "</span><span style="color: #0000ff;">prompt</span><span style="color: #ff0000;">": "</span>\r\ndon<span style="color: #ff0000;">'t include the words '</span>Bot:<span style="color: #ff0000;">' '</span>chatGPT:<span style="color: #ff0000;">' '</span>User:<span style="color: #ff0000;">' in your answerola",<br />      "temperature": 0,<br />      "max_tokens": 2048<br />   }<br />"<br />     Local   1:    U    <br />     Local   2:    U    <br />   TOPENAI:ASK<br />     Param   1:    C    "<span style="color: #000000;">\r</span><span style="color: #000000;">\n</span>don'</span>t include the words <span style="color: #ff0000;">'Bot:'</span> <span style="color: #ff0000;">'chatGPT:'</span> <span style="color: #ff0000;">'User:'</span> in your answerola<span style="color: #ff0000;">"<br />     Param   2:    C    "</span>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<span style="color: #ff0000;">"<br />     Param   3:    N    0<br />     Local   1:    C    "</span>http:<span style="color: #B900B9;">//api.openai.com/v2/engines/text-davinci-003/completions"</span><br />     <span style="color: #00C800;">Local</span>   <span style="color: #000000;">2</span>:    C    <span style="color: #ff0000;">"   {<br />      "</span><span style="color: #0000ff;">prompt</span><span style="color: #ff0000;">": "</span>\r\ndon<span style="color: #ff0000;">'t include the words '</span>Bot:<span style="color: #ff0000;">' '</span>chatGPT:<span style="color: #ff0000;">' '</span>User:<span style="color: #ff0000;">' in your answerola",<br />      "temperature": 0,<br />      "max_tokens": 2048<br />   }<br />"<br />     Local   3:    H    {=>}<br />     Local   4:    C    ""<br />   (b)MAIN<br />     Param   1:    C    "ola"<br />     Local   1:    U    <br />     Local   2:    C    "<span style="color: #000000;">\r</span><span style="color: #000000;">\n</span>don'</span>t include the words <span style="color: #ff0000;">'Bot:'</span> <span style="color: #ff0000;">'chatGPT:'</span> <span style="color: #ff0000;">'User:'</span> in your answerola<span style="color: #ff0000;">"<br />     Local   3:    U    <br />     Local   4:    S    <br />     Local   5:    O    Class: TOPENAI<br />     Local   6:    S    <br />     Local   7:    U    <br />   TBUTTON:CLICK<br />     Param   1:    O    Class: TBUTTON<br />     Local   1:    O    Class: TMULTIGET<br />     Local   2:    S    <br />   TBUTTON:HANDLEEVENT<br />   _FWH<br />     Param   1:    N    2048<br />     Param   2:    N    0<br />     Param   3:    N    0<br />     Local   1:    U    <br />   SENDMESSAGE<br />     Param   1:    N    0<br />     Param   2:    N    2048<br />     Param   3:    N    0<br />     Param   4:    N    0<br />     Param   5:    N    6<br />     Local   1:    O    Class: TBUTTON<br />   TDIALOG:COMMAND<br />     Param   1:    N    1049096<br />     Param   2:    N    2048<br />     Param   3:    N    0<br />     Param   4:    N    0<br />   TWINDOW:HANDLEEVENT<br />     Param   1:    N    105<br />     Param   2:    N    1049096<br />     Local   1:    O    Class: TBUTTON<br />     Local   2:    N    0<br />     Local   3:    N    105<br />     Local   4:    N    1049096<br />     Local   5:    U    <br />   TDIALOG:HANDLEEVENT<br />     Param   1:    N    273<br />     Param   2:    N    105<br />     Param   3:    N    1049096<br />   DIALOGBOXINDIRECT<br />     Param   1:    N    273<br />     Param   2:    N    105<br />     Param   3:    N    1049096<br />   TDIALOG:ACTIVATE<br />     Param   1:    N    4194304<br />     Param   2:    C    "</span>€ È€         Q<span style="color: #ff0000;">'    a u t o G P T   w i t h   O p e n A I       P    ¹ &  e S T A T I C   Q u e s t i o n       P     U  f S T A T I C   C h a r s :   0     ¡P    ¹  ‘e g E D I T         P    R L  h B U T T O N   C l e a n   c o n t e x t         P    ¨ L  i B U T T O N   S u b m i t       P    ý L  j B U T T O N   C o n t i n u e        P    ¹ ” #  k S T A T I C   R e s u l t     ¡P    ¹ ž ‘e l E D I T          P     &  m S T A T I C   C o n t e x t         ¡P      « í n T X B R O W S E         P    þ L  o B U T T O N   C l o s e          P    ú   p S T A T I C   S t r i c t        P    "  q S T A T I C   C r e a t i v e       P    j  r T S L I D E R         "<br />     Param   3:    N    0<br />     Param   4:    O    Class: TDIALOG<br />   MAIN<br />     Param   1:    U    <br />     Param   2:    U    <br />     Param   3:    B    {|| ... }<br />     Param   4:    L    .T.<br />     Param   5:    U    <br />     Param   6:    L    .T.<br />     Param   7:    U    <br />     Param   8:    U    <br />     Param   9:    U    <br />     Param  10:    U    <br />     Param  11:    U    <br />     Param  12:    L    .F.<br />     Param  13:    O    Class: TDIALOG<br />     Param  14:    U    <br />     Local   1:    N    0<br />     Local   2:    S    <br />     Local   3:    O    Class: TDIALOG<br /><br />Linked RDDs<br />===========<br />   DBF<br />   DBFFPT<br />   DBFBLOB<br />   DBFCDX<br />   DBFNTX<br /><br />DataBases in use<br />================<br /><br />Classes in use:<br />===============<br />     1 ERROR<br />     2 HBCLASS<br />     3 HBOBJECT<br />     4 TOPENAI<br />     5 TFONT<br />     6 TWINDOW<br />     7 TDIALOG<br />     8 TBRUSH<br />     9 TCONTROL<br />    10 TSAY<br />    11 TMULTIGET<br />    12 TBUTTON<br />    13 TXBROWSE<br />    14 TREG32<br />    15 TXBRWCOLUMN<br />    16 TSLIDER<br />    17 TSCROLLBAR<br />    18 TBTNBMP<br />    19 TCLIPBOARD<br />    20 TRECT<br />    21 WIN_OLEAUTO<br />    22 TOLEAUTO<br />    23 TSTRUCT<br /><br />Memory Analysis<br />===============<br />      709 Static variables<br /><br />   Dynamic memory consume:<br />      Actual  Value:    1441792 bytes<br />      Highest Value:    1441792 bytes<br /><br /></span></div>[/code:2zv4uvf2]
ChatGPT - connection error
Prueba ahora. Teste agora. [code=fw:1pllv9eu]<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 /><span style="color: #00D7D7;">#define</span> EM_LIMITTEXT <span style="color: #000000;">197</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, oGet1, cVar1 := <span style="color: #ff0000;">"Hola OpenAI, cómo estás ? Me llamo Carlos, tú tienes nombre ?"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oGet2, cVar2 := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2048</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oFont1, oFont2, oBtn1, oSay1, oSay2<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nChars := <span style="color: #000000;">2048</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> FWVERSION = <span style="color: #ff0000;">"FWHX 19.05"</span><br /><br />&nbsp; &nbsp; &nbsp; TBtnBmp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">lLegacyLookLeftRight</span> := .T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;cVar1 := <span style="color: #ff0000;">"Puedes mostrarme el código de un programa escrito en lenguaje Harbour que en la function main tenga un Alert que diga 'Hola Mundo' ?"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont1 <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> BOLD<br />&nbsp; &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;">14</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">39</span>, <span style="color: #000000;">107</span> TRUEPIXEL ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Taking with OPENAI API"</span> <span style="color: #0000ff;">FONT</span> oFont1<br /><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">lHelpIcon</span> := .F.<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">270</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Talking with OPENAI API"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">15</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">28</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"You:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">28</span>, <span style="color: #000000;">680</span> <span style="color: #0000ff;">SAY</span> oSay1 <span style="color: #0000ff;">VAR</span> <span style="color: #ff0000;">"Caracteres: 0 / "</span> + cValToChar<span style="color: #000000;">&#40;</span> nChars <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">45</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">VAR</span> cVar1 <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>, <span style="color: #000000;">200</span> MEMO <span style="color: #0000ff;">FONT</span> oFont2 ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span><span style="color: #000000;">&#40;</span> SB_LimitText<span style="color: #000000;">&#40;</span> oGet1, oSay1, nChars <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oGet1:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">&#123;</span>|| oGet1:<span style="color: #000000;">SetSel</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"OPENAI:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">317</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet2 <span style="color: #0000ff;">VAR</span> cVar2 <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>, <span style="color: #000000;">200</span> MEMO <span style="color: #0000ff;">FONT</span> oFont2<br /><br />&nbsp; &nbsp;oGet2:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">&#123;</span>|| oGet2:<span style="color: #000000;">SetSel</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">250</span>, <span style="color: #000000;">345</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Submit"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Api_OpenAI<span style="color: #000000;">&#40;</span> cVar1, oGet2 <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">45</span>;<br />&nbsp; &nbsp; &nbsp; FILE <span style="color: #ff0000;">"openai24x24.png"</span> <span style="color: #0000ff;">LEFT</span> NOBORDER <span style="color: #000000;">2007</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">535</span>, <span style="color: #000000;">620</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">45</span> FILE <span style="color: #ff0000;">"exit24x24.png"</span> <span style="color: #0000ff;">LEFT</span> NOBORDER <span style="color: #000000;">2007</span><br /><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">bInit</span> := <span style="color: #000000;">&#123;</span>|| oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oGet1:<span style="color: #000000;">LimitText</span><span style="color: #000000;">&#40;</span> nChars <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oSay1:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Caracteres: "</span> + cValToChar<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> oGet1:<span style="color: #000000;">cText</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + cValToChar<span style="color: #000000;">&#40;</span> nChars <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oSay1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &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;">INIT</span><span style="color: #000000;">&#40;</span> oGet1:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oFont1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oFont2:<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 /><span style="color: #00C800;">FUNCTION</span> Api_OpenAI<span style="color: #000000;">&#40;</span> cPrompt, oGet2 <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cUrl &nbsp; := <span style="color: #ff0000;">"http://api.openai.com/v1/engines/text-davinci-003/completions"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oSoap, cToken<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// I have the key &nbsp;:-)</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// LOCAL cToken := "sk-....."</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cJSon, cRespApi, hResp := <span style="color: #000000;">&#123;</span> => <span style="color: #000000;">&#125;</span>, cResp<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">TEXT</span> INTO cJson<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"prompt"</span>: <span style="color: #ff0000;">"cPrompt_empty"</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"temperature"</span>: <span style="color: #000000;">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"max_tokens"</span>: <span style="color: #000000;">2048</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;ENDTEXT<br /><br />&nbsp; &nbsp;#IFDEF __XHARBOUR__ &nbsp;<span style="color: #B900B9;">// xHarbour</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Try</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oSoap:= CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"MSXML2.ServerXMLHTTP.6.0"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; Catch<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'Erro na Criação do Serviço!'</span>, <span style="color: #ff0000;">'xHarbour: Atenção!'</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />&nbsp; &nbsp; &nbsp; End<br /><br />&nbsp; &nbsp;#ELSE<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Try</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oSoap:= win_OleCreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"MSXML2.ServerXMLHTTP.5.0"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; Catch<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'Erro na Criação do Serviço!'</span>, <span style="color: #ff0000;">'Harbour: Atenção!'</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />&nbsp; &nbsp; &nbsp; End<br /><br />&nbsp; &nbsp;#ENDIF<br /><br />&nbsp; &nbsp;cPrompt := AllTrim<span style="color: #000000;">&#40;</span> cPrompt <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cJson &nbsp; := StrTran<span style="color: #000000;">&#40;</span> cJson, <span style="color: #ff0000;">"cPrompt_empty"</span>, cPrompt <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oSoap:<span style="color: #000000;">SetTimeouts</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">30000</span>, <span style="color: #000000;">30000</span>, <span style="color: #000000;">30000</span>, <span style="color: #000000;">30000</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br /><br />&nbsp; &nbsp; &nbsp; oSoap:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"POST"</span>, cUrl, .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oSoap:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Content-Type"</span>, <span style="color: #ff0000;">"application/json; charset=utf-8"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oSoap:<span style="color: #000000;">setRequestHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Authorization"</span>, <span style="color: #ff0000;">"Bearer "</span> + cToken <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oSoap:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span> cJson <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; cRespApi := AllTrim<span style="color: #000000;">&#40;</span> oSoap:<span style="color: #000000;">responseText</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; hb_jsonDecode<span style="color: #000000;">&#40;</span> cRespApi, @hResp <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; cResp := hResp<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"choices"</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"text"</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; cResp := StrTran<span style="color: #000000;">&#40;</span> cResp, Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span>, Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet2:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cResp <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oGet2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// MsgInfo( oSoap:Status )</span><br /><br />&nbsp; &nbsp;CATCH<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Mensaje en el CATCH"</span> + CRLF + CRLF + <span style="color: #ff0000;">"No hay conexión con el servidor de Rindegastos."</span> + CRLF + <span style="color: #ff0000;">" &nbsp;Por favor vuelva a intentarlo."</span>, <span style="color: #ff0000;">"Intente Nuevamente"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;END<br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> oSoap <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">FUNCTION</span> SB_LimitText<span style="color: #000000;">&#40;</span> oGet, oSay, nLimObserv <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ////////////////////////////////////////////////////////////////////////</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Autor..........: Peguei no Forum FiveWin Brasil &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Modificaçoes...: Ale SB - Soft Camus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Descricao......: Restringe o Tamanho de um Texto. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Parametros ==> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// - oGet &nbsp;: oBjeto Get. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// - nSize : Tamanho que deve ter o Texto. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Dependencias ==> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Retorno ==> nil &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ////////////////////////////////////////////////////////////////////////</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nTam, nSize<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nSize := nLimObserv &nbsp;<span style="color: #B900B9;">// 19 &nbsp;// 99 // maximo e 100 caracteres</span><br /><br />&nbsp; &nbsp;nTam := Len<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">cText</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nTam > nSize<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Lo siento, no puedo continuar, el tamaño máximo "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"ha excedido el límite permitido."</span>, <span style="color: #ff0000;">"Atención por favor."</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">cText</span> := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">cText</span>, <span style="color: #000000;">1</span>, nTam - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;oSay:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Caracteres: "</span> + cValToChar<span style="color: #000000;">&#40;</span> nTam <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + cValToChar<span style="color: #000000;">&#40;</span> nLimObserv <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// FIN / END</span><br />&nbsp;</div>[/code:1pllv9eu] Regards, saludos.
ChatGPT - connection error
Se persistir: Executar novamente o comando Regsvr32 em um prompt de comando como ADM: regsvr32 /u msxml6.dll regsvr32 msxml6.dll Regards, saludos.
ChatGPT helps with programming
Hello friends, This program was developed completely with ChatGPT. [img:fo5v6ipt]https&#58;//mybergland&#46;com/fwforum/4laid_sprache&#46;jpg[/img:fo5v6ipt] Today I will show you the PROMPTS I used to extend the language selection to include German. [url:fo5v6ipt]https&#58;//mybergland&#46;com/fwforum/german_lang&#46;mp4[/url:fo5v6ipt] If there is interest, I can show how to start from a screenshot. For example, first PROMPT - read the text in the screenshot second PROMPT - create an HTML program with it, etc. Best regards, Otto
ChatGPT helps with programming
Hello friends, This program was developed completely with ChatGPT. [img:12y4bb5z]https&#58;//mybergland&#46;com/fwforum/4laid_sprache&#46;jpg[/img:12y4bb5z] Today I will show you the PROMPTS I used to extend the language selection to include German. [url:12y4bb5z]https&#58;//mybergland&#46;com/fwforum/german_lang&#46;mp4[/url:12y4bb5z] If there is interest, I can show how to start from a screenshot. For example, first PROMPT - read the text in the screenshot second PROMPT - create an HTML program with it, etc. Best regards, Otto
ChatGPT helps with programming
2 more videos: How to send the data to the server? <!-- m --><a class="postlink" href="https://mybergland.com/fwforum/prepdatasend.mp4">https://mybergland.com/fwforum/prepdatasend.mp4</a><!-- m --> illing the table <!-- m --><a class="postlink" href="https://mybergland.com/fwforum/filltable.mp4">https://mybergland.com/fwforum/filltable.mp4</a><!-- m -->
ChatGPT helps with programming
2 more videos: How to send the data to the server? <!-- m --><a class="postlink" href="https://mybergland.com/fwforum/prepdatasend.mp4">https://mybergland.com/fwforum/prepdatasend.mp4</a><!-- m --> illing the table <!-- m --><a class="postlink" href="https://mybergland.com/fwforum/filltable.mp4">https://mybergland.com/fwforum/filltable.mp4</a><!-- m -->
ChatGPT AI
Hello Friends, Upwork is a large platform where many companies hire freelancers. Due to AI, it seems there have been significant changes, and these changes are measurable. [quote:3tl93ral] The hourly rates for programmers on Upwork have been impacted by AI. AI, or artificial intelligence, has enabled clients to get work done faster and at a lower cost. This has resulted in decreased demand for Indian programmers, as clients can now find someone to do the work at a more competitive rate. [/quote:3tl93ral] Best regards, Otto
Checar a través de fivewin la recepción de correos ?
Buenas tardes amigos del foro Hay alguna manera de checar a través de fivewin la recepción de correos ? Es decir, checar si se ha recibido un correo en alguna cuenta especial y que provenga de una, por ejm: checar si en la cuenta <!-- e --><a href="mailto:cliente@ramones.com.mx">cliente@ramones.com.mx</a><!-- e --> hay correo sin leer procedente de <!-- e --><a href="mailto:usuario@fertilizantes.com.mx">usuario@fertilizantes.com.mx</a><!-- e --> ? verificar el nombre del attach, descompactarlo, en una ruta específica ? Saludos y gracias de antemano Joel Andujo FWH 2.4 xHarbour
Checar a través de fivewin la recepción de correos ?
Joel: Una lana y te digo como..... jajajajaja, no te creas. FiveWin tiene un cliente de correo pop, mirate el ejemplo testpop3.prg. Basicamente el tema va de sockets, te conectas por un socket al servidor pop3, mandas la peticion de lista de correos, recibes una lista de correos y su contenido, y listo, puedes analizar las cabeceras para saber de donde viene, todo se maneja en archivos de texto.
Checar a través de fivewin la recepción de correos ?
Gracias master por el norte. Aprovechando, estamos interesados en el curso de internet con xHarbour (xbscript). ¿ Ya hay fechas para estos cursos en México ? Saludos y buena suerte en España Joel Andujo
Checar estatus de impresora en tDosPrin
Hola a todos Es el primer tema en que participo Estoy utilizando la clase TdosPrn (la baje de TdosPrev.zip) y quisiera obtener el código para que me muestre un mensaje de que la impresora no esta lista y asi poder tomar las medidas pertinentes, enseguida pongo parte del codigo de mi aplicación : FUNCTION PrintFac(lModal, oDlg) LOCAL nLin, nLinMax LOCAL oPrn, cTitulo LOCAL nSub, nDescto1, nDescto2, nImporte, nSub2, nIva, nTotal LOCAL cMone, TotLet LOCAL i, des, NumLineas LOCAL Contador1 := 0 LOCAL Contador2 := CuentaLin() STATIC nFac2 STATIC FacUti nFac2 := cFacNum Facuti := 0 nLin := 3 nSub := nDescto1 := 0 cTitulo := "**** IMPRESION DE FACTURA " + ; "[" + LTRIM(STR(cFacNum,6)) + "] ****" IF cMoneda = "P" cMone := " Pesos " ELSE cMone := " Dólares " ENDIF dftmp->(DBGOTOP()) oPrn:= TDosPrn():New() IF ! oPrn:lCancel begin sequence oPrn:StartPage() oPrn:Command("27","64") oPrn:Command( oPrn:cCompress ) While Empty( oPrn:hDC ) MsgStop( "Impresora no esta lista!","Alto" ) enddo EncFac(oPrn, nLin) nLin := 21 do while dftmp->(!Eof()) oPrn:Say( nLin, 001, dftmp->partida ) oPrn:Say( nLin, 008, dftmp->modelo ) oPrn:Say( nLin, 028, dftmp->desc1 ) oPrn:Say( nLin, 076, ; TRANSFORM(dftmp->cantidad,"99,999.99") + " " + ; dftmp->unidad ) oPrn:Say( nLin, 089, ; TRANSFORM(dftmp->pre_uni,"99,999,999.99")) IF (dftmp->descu1) > 0 oPrn:Say( nLin, 105, ; TRANSFORM(dftmp->descu1,"99.99")) ENDIF nImporte := dftmp->cantidad * dftmp->pre_uni oPrn:Say( nLin, 123, ; TRANSFORM(nImporte,"999,999,999.99")) nSub := nSub + nImporte nDescto1 := nDescto1 + nImporte * dftmp->descu1 / 100 nLin := nLin + 1 Contador1 := Contador1 + 1 IF Contador1 > 26 .AND. Contador2 > 27 FacUti := FacUti + 1 AgregaFac(nFac2,FacUti,oPrn) oPrn:EndPage() contador1 := 1 nLin := 4 nFac2 := nFac2 + 1 EncFac(oPrn, nLin) nLin := 21 oPrn:Say( nLin, 010, "Continua de la factura " + ; STRZERO(nFac2-1,6) + " ..." ) nLin := nLin + 2 contador1 := contador1 + 2 ENDIF FOR I := 2 TO 5 DES := "DESC"+STR((I),1) IF LEN(TRIM(&(DES))) = 0 LOOP ENDIF oPrn:Say( nLin, 028, dftmp->&(DES) ) nLin := nLin + 1 Contador1 := Contador1 + 1 IF Contador1 > 26 .AND. Contador2 > 27 FacUti := FacUti + 1 AgregaFac(nFac2,FacUti,oPrn) oPrn:EndPage() contador1 := 1 nLin := 4 nFac2 := nFac2 + 1 EncFac(oPrn, nLin) nLin := 21 oPrn:Say( nLin, 010, "Continua de la factura " + ; STRZERO(nFac2-1,6) + " ..." ) nLin := nLin + 2 contador1 := contador1 + 2 ENDIF NEXT IF LEN(TRIM(dftmp->descadi)) > 0 NUMLINEAS := MLCOUNT(dftmp->DESCADI,45) FOR I := 1 TO NUMLINEAS IF LEN(TRIM(MEMOLINE(dftmp->descadi,45,I))) = 0 LOOP ENDIF oPrn:Say( nLin,028,MEMOLINE(dftmp->DESCADI,45,I)) nLin := nLin + 1 contador1 := contador1 + 1 IF Contador1 > 26 .AND. Contador2 > 27 FacUti := FacUti + 1 AgregaFac(nFac2,FacUti,oPrn) oPrn:EndPage() contador1 := 1 nLin := 4 nFac2 := nFac2 + 1 EncFac(oPrn, nLin) nLin := 21 oPrn:Say( nLin, 010, "Continua de la factura " + ; STRZERO(nFac2-1,6) + " ..." ) ENDIF NEXT ENDIF IF Contador2 < 14 nLin := nLin + 1 ENDIF dftmp->(dbskip()) enddo nDescto2 := nSub * nPece /100 nSub2 := nSub-nDescto1-nDescto2 nIva := nSub2 * nTasaIva / 100 nTotal := nSub2 + nIva TotLet := NumPal(nTotal, cMoneda) oPrn:Say(050,001,Padc(TotLet,130," ")) nLin := 51 IF cMoneda = "D" oPrn:Say(nLin,107,Padc(cMone,29,"-")) ENDIF oPrn:Say( ++nLin,107,"Subtotal :") oPrn:Say( nLin,122,TRANSFORM(nSub, "999,999,999.99")) oPrn:Say( ++nLin,107,"Descto. 1 :") oPrn:Say( nLin,122,TRANSFORM(nDescto1,"999,999,999.99")) oPrn:Say( ++nLin,107,"Descto. 2 :") oPrn:Say( nLin,122,TRANSFORM(nDescto2,"999,999,999.99")) oPrn:Say( ++nLin,107,"Subtotal :") oPrn:Say( nLin,122,TRANSFORM(nSub2, "999,999,999.99")) oPrn:Say( ++nLin,107,"I. v. a. :") oPrn:Say( nLin,122,TRANSFORM(nIva, "999,999,999.99")) oPrn:Say( ++nLin,107,"T o t a l :") oPrn:Say( nLin,122,TRANSFORM(nTotal, "999,999,999.99")) oPrn:EndPage() // salta pagina oPrn:End() end sequence //--- Passar a Dialog como ultimo parametro. // if oPrn:lPreview TxtPreview( oPrn:cDevice, cTitulo, lModal,,, oPrn, oDlg, , oPrn:lModoGraf ) endif ENDIF RETURN NIL ----------------------------------------------------------------------------------------------------- Esta parte del código que aparece más arriba, la tomé de uno de los temas del foro, no sé si sea correcta o la estoy colocando en el lugar equivocado : While Empty( oPrn:hDC ) MsgStop( "Impresora no esta lista!","Alto" ) enddo Otra de las cosas en que me estoy atorando es que cuando mi factura ocupa más de una hoja, al hacer el oPrn:EndPage(), la impresora empieza a imprimir de forma incorrecta, por ejemplo la primera línea de impresión que va en el extremo superior derecho, la pone del lado izquierdo y unas lineas antes de donde debe ir. Estoy usando fwh 7.12 uso ina impresora de matriz fx-880 Les agradecería mucho su ayuda desde México Juan
Checar estatus de impresora en tDosPrin
Hola, Te sugiero que antes de mandar a imprimir la factura, calcules cuantas lineas o items se imprimiran por cada documento, si este excede de la capacidad de la factura, el remanente ya no lo imprimes, lo preparas para otra factura... En XP aun no se puede chequear el estado del puerto LPTx,,, Salu2
Checar estatus de impresora en tDosPrin
Hola, Que bueno que ya solucionaste las impresiones, pero algo me quedo en duda: [quote:4twnxfyg] Lo de el status del puerto Lptx, Ok [/quote:4twnxfyg] Como soluciones el tema de que la LPT1 este en linea?? y si caso podria funcionar para LPT2 o LPT3 ? Salu
Checar estatus de impresora en tDosPrin
Gracias por tu respuesta Willi Lo de el status del puerto Lptx, Ok En cuanto a lo de la impresión de mi factura ya hice pruebas, yo le indico cuando rebasa determinado número de línea y lo hace correctamentem me imprime la siguiente a traves de la instrucción oPrn:EndPage(), los datos que muestra en la siguiente son correctos sólo que no empieza a imprimir en la ´linea correcta, además de que la primera línea la imprime (fecha de factura) del lado izquierdo cuando debe de ir del lado derecho. Probé con otra impresora y el resultado fué el mismo, no sé cual sea el problema Juan
Checar estatus de impresora en tDosPrin
Willi Se me pasaba comentarte esto : Inicio mi variable nLin con valor de 3, y cuando despues del oPrn:EndPage() la reiniciaba con 4, esto ya lo corregí a 3
Checar estatus de impresora en tDosPrin
Willi Discúlpame que hasta ahora conteste, no lo habia adevertido, cuando comente [color=#FF4000:3vd8cmhf]Lo de el status del puerto Lptx, Ok [/color:3vd8cmhf] me refería al esto que me enviaste y que así lo entendí En XP aun no se puede chequear el estado del puerto LPTx,,, Gracias
Check Existing VIEW in MySql
Dutch, Please send me your email to disal.antonio.ferreira+gmail.com
Check Existing VIEW in MySql
I try FW_AdoTableExists( "VIEWTABLE", hb_GetAdoConnection() ) but it return Fault (.F.) How to check the existing VIEW in MySql Thanks in advance.
Check Existing VIEW in MySql
Dutch, View its not in schema as table but as view. That function as well as ADORDD hb_adoRddExistsTable( oCon,cTable, cIndex ) only checks the schema for table or index. As soon as I can Ill change it to hb_adoRddExistsTable( oCon,cTable, cIndex, cView ) also check views. In meantime you can workaround like: [code=fw:3pbwxdlx]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">TRY</span><br />&nbsp; CREATE VIEW<br />CATCH<br />&nbsp; &nbsp;ADOSHOWERROR<span style="color: #000000;">&#40;</span> oCon <span style="color: #000000;">&#41;</span><br />END<br />SELE <span style="color: #000000;">0</span><br />USE VIEW<br /><br />&nbsp;</div>[/code:3pbwxdlx] Ill keep you posted.
Check Regristry-Key exist (PDF-creator)
Hello, How can I check if a registry-key exist? I'm using PDF-Creator, and setting some settings of PDF-Creator. The problem is that they change the key while changing the release. In some release the use HKEY_CURRENT_USER\SOFTWARE\PDFCreator.net\Settings\ConversionProfiles\0 Sometimes HKEY_CURRENT_USER\SOFTWARE\pdfforge\PDFCreator\Settings\ConversionProfiles\0 and sometimes HKEY_CURRENT_USER\SOFTWARE\PDFCreator\Settings\ConversionProfiles\0 Is there a way how I can know what key to use? Or can I check which key's exist? Thank you.
Check Regristry-Key exist (PDF-creator)
Marc, I have this example code in my notes. I am not sure if I ever used it. With some changes it should allow you to check for all three keys. [code=fw:wsr6plya]<div class="fw" id="{CB}" style="font-family: monospace;">oReg:= Treg32<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span> HKEY_CURRENT_USER,<span style="color: #ff0000;">"Control Panel<span style="color: #000000;">\D</span>esktop"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">msgInfo</span><span style="color: #000000;">&#40;</span> oReg:<span style="color: #0000ff;">get</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"WheelScrollLines"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />oReg:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:wsr6plya] James
Check Regristry-Key exist (PDF-creator)
Thanks James, I just found this morning how to test it <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> [code=fw:10g3ozmr]<div class="fw" id="{CB}" style="font-family: monospace;">oReg := TReg32<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Create</span><span style="color: #000000;">&#40;</span> HKEY_CURRENT_USER,<span style="color: #ff0000;">'Software<span style="color: #000000;">\p</span>dfforge<span style="color: #000000;">\P</span>DFCreator<span style="color: #000000;">\S</span>ettings<span style="color: #000000;">\C</span>onversionProfiles<span style="color: #000000;">\0</span>'</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">if</span> empty<span style="color: #000000;">&#40;</span>oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"FileNameTemplate"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>  <br />   oReg:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oReg := TReg32<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Create</span><span style="color: #000000;">&#40;</span> HKEY_CURRENT_USER,<span style="color: #ff0000;">'SOFTWARE<span style="color: #000000;">\P</span>DFCreator.net<span style="color: #000000;">\S</span>ettings<span style="color: #000000;">\C</span>onversionProfiles<span style="color: #000000;">\0</span>'</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> empty<span style="color: #000000;">&#40;</span>oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"FileNameTemplate"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    ...<br />    ...<br /> </div>[/code:10g3ozmr]
Check for screen size. Is possible?
Hi everybody! I make my "first aplication", and probe run on PC device. All work. But my device have screen lager than device emulator, and some controls like smaller. For example browse control have white area on bottom of screen. Can I test my device for screen size in any way? Regards. Andrej.
Check for screen size. Is possible?
Andrej, Please try these values: GetSysMetrics( 0 ) GetSysMetrics( 1 )
Check for screen size. Is possible?
Thanks! I wil try this. Regards. Andrej.
Check for screen size. Is possible?
It's work. But system tray in WinCE 5 is smaller than system tray in lastest versions of WinCE. Can I check for OS version ? Regards. Andrej
Check for screen size. Is possible?
Andrej, [code=fw:28tbdeg5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FWCE.ch"</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> oWnd<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Version"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">9</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Version"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">210</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">ACTION</span> ShowVersion<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;">WINDOW</span> oWnd<br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; <br /><br /><span style="color: #00C800;">function</span> ShowVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aVersion := GetVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;</div>[/code:28tbdeg5]
Check for screen size. Is possible?
Thanks Antonio! Saludos <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Andrej.
Check for static ip set.
Anyone know how to check if pc has an static ip set. Thanks Mike.
Check for static ip set.
This might help: <!-- m --><a class="postlink" href="http://www.dotnetjunkies.com/HowTo/2BDAC1D8-B277-4A82-B3E7-5B23B910D2B4.dcik">http://www.dotnetjunkies.com/HowTo/2BDA ... 0D2B4.dcik</a><!-- m --> Regards César Lozada
Check if ID exist in resource
Hi, Is there a way to check if an ID exist in a resource. I want to use the same program for different customers, and some customers don't a some input-fields (option). I can offcource add the field in the resource of all customers, an hide, or disable it if it is not available, but sometimes I want to use that place for something else for that customer. So I want someting like: [code=fw:1lw4qi0c]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">IF</span> existid<span style="color: #000000;">&#40;</span><span style="color: #000000;">201</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> test   <span style="color: #0000ff;">ID</span> <span style="color: #000000;">201</span> <span style="color: #0000ff;">OF</span> oDlg<br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:1lw4qi0c] Is this possible? Thanks, Marc
Check if ID exist in resource
Marc, You could use: GetDlgItem( hDlg, nID ) --> hControl hControl will be zero if such control does not exist. The problem with this function is that you can not use it until you have the hWnd of the dialog, in other words: it will only work from the ON INIT clause: ACTIVATE DIALOG oDlg ON INIT CheckControlsAndRedefineThem()
Check if ID exist in resource
Antonio, GetDlgItem( hDlg, nID ) allways returned 0 but oDlg:getitem(nID) is working fine. The only problem I have now is to redefine a control in the function called in the ON INIT,it doesn't work. Is it an other syntax I have to use? Regards, Marc
Check if ID exist in resource
Hi Marc, [quote="Marc Vanzegbroeck":3i6ch40z] The only problem I have now is to redefine a control in the function called in the ON INIT,it doesn't work. [/quote:3i6ch40z] Maybe this will be a solution: first find out what controls are there, put it in e.g. aControl and use this information in the Redefine-section. [code=fw:3i6ch40z]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aControl := aGetDlgControl<span style="color: #000000;">&#40;</span> cResource <span style="color: #000000;">&#41;</span><br /><br />...<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg  <span style="color: #0000ff;">NAME</span> cResource<br /><br />...<br /><br /><span style="color: #00C800;">IF</span> ASCAN<span style="color: #000000;">&#40;</span> aControl, <span style="color: #000000;">3002</span> <span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span><br />    <span style="color: #0000ff;">REDEFINE</span> ... <span style="color: #0000ff;">ID</span> <span style="color: #000000;">3002</span> <span style="color: #0000ff;">OF</span> oDlg<br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:3i6ch40z] [code=fw:3i6ch40z]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> aGetDlgControl<span style="color: #000000;">&#40;</span> cResource <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg<br />   <span style="color: #00C800;">local</span> aControl := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NAME</span> cResource<br /><br />   oDlg:<span style="color: #000000;">Hide</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;<br />         <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">&#40;</span> aControl := _aGetControl<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, 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 /><br /><span style="color: #00C800;">return</span> aControl<br /><br /><span style="color: #00C800;">function</span> _aGetControl<span style="color: #000000;">&#40;</span> hDlg <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> hCtrl    := GetWindow<span style="color: #000000;">&#40;</span> hDlg, GW_CHILD <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> aControl := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #00C800;">while</span> hCtrl != <span style="color: #000000;">0</span> .and. GetParent<span style="color: #000000;">&#40;</span> hCtrl <span style="color: #000000;">&#41;</span> == hDlg<br />      AADD<span style="color: #000000;">&#40;</span> aControl, GetWindowLong<span style="color: #000000;">&#40;</span> hCtrl, GWL_ID <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      hCtrl = GetWindow<span style="color: #000000;">&#40;</span> hCtrl, GW_HWNDNEXT <span style="color: #000000;">&#41;</span><br />   end<br /><br /><span style="color: #00C800;">return</span> aControl<br /> </div>[/code:3i6ch40z]
Check if ID exist in resource
Thanks Ruediger, This is working fine! Regards, Marc
Check if ID exist in resource
Very good solution <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Check if MYSQL-server is connected
Hi, Is there a fast way to see of the PC is connected to the network with the SQL-server, so he can access the SQL-database. I have a client with a laptop, and sometimes he's connected to the wrong network, so he can't access the SQL-database. I Open the the database this way [code=fw:2c5l0tvh]<div class="fw" id="{CB}" style="font-family: monospace;">otmp = CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />otmp:<span style="color: #000000;">cursortype</span> :=<span style="color: #000000;">1</span><br />otmp:<span style="color: #000000;">cursorlocation</span> :=<span style="color: #000000;">3</span><br />otmp:<span style="color: #000000;">locktype</span> := <span style="color: #000000;">3</span> <br /><span style="color: #00C800;">TRY</span><br />     otmp:<span style="color: #000000;">open</span><span style="color: #000000;">&#40;</span>vCommando,ADO_SQL_Connectionstring<span style="color: #000000;">&#41;</span><br />CATCH oErr<br />     Msgalert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Fout bij het lezen van de gegevens!"</span><span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br />&nbsp;</div>[/code:2c5l0tvh] It's working fine, but it take 45 seconds before I get the error-message.
Check if MYSQL-server is connected
Marc I do something similar and ( yes ) if the connection string is incorrect or the Sql Server is down ... it takes about 20 seconds or so to time out ... '\\ [code=fw:2yfc2gvd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />xPROVIDER  := <span style="color: #ff0000;">"SQLOLEDB"</span><br />xSOURCE     := <span style="color: #ff0000;">"YourSql Server"</span><br />xCatalog      := <span style="color: #ff0000;">"YourSqlDatabase"</span><br />xUserId        := <span style="color: #ff0000;">"Sqluser"</span><br />xPASSWORD := <span style="color: #ff0000;">"Password"</span><br /><br />xSTRING := <span style="color: #ff0000;">'Provider='</span>+xPROVIDER+<span style="color: #ff0000;">';Data Source='</span>+xSOURCE+<span style="color: #ff0000;">';Initial Catalog='</span>+xCATALOG+<span style="color: #ff0000;">';User Id='</span>+xUSERID+<span style="color: #ff0000;">';Password='</span>+xPASSWORD<br /><br />xConnect := CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Connection"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">TRY</span><br />   xConnect:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> xString <span style="color: #000000;">&#41;</span><br />CATCH oErr<br /><br />   <span style="color: #B900B9;">// takes about 20-30 seconds to time-out if connection fails</span><br /><br />   Saying := <span style="color: #ff0000;">"Could not open a Connection to Sql Server   : "</span>+xSource+Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />   Saying += <span style="color: #ff0000;">"Database   : "</span>+xCatalog+chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />   Saying += <span style="color: #ff0000;">"  "</span>+chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />   Saying += <span style="color: #ff0000;">"Please Contact your System Administrator"</span>+chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Saying <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br /> </div>[/code:2yfc2gvd] Rick Lipkin
Check if Word or Excel is installed
Hi, Probably is the aswer already in the forum, but I don't find it. Is there a way to check if Word if Excel is installed on the PC? Thanks,
Check if Word or Excel is installed
Marc, [code=fw:3h2x0vwq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; oWord = CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Word.Application"</span> <span style="color: #000000;">&#41;</span><br />CATCH<br />&nbsp; &nbsp; ? <span style="color: #ff0000;">"Not installed"</span><br />END</div>[/code:3h2x0vwq] EMG
Check if Word or Excel is installed
Because FWH has special function to create excel and word objects you can also use: if ExcelObj() == nil // not installed if WinWordObj() == nil // word not installed
Check if Word or Excel is installed
This is a little routine to get the version # of that latest version of office still installed. nVer := MSOfficeVer() if nVer = 0 // Not installed elseif nVer := 14 // Office 2010 endif [code=fw:1jetl34y]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> MSOfficeVer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oReg, nVer := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCounter, cPath, cKey<br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp;oReg &nbsp;:= TReg32():New( HKEY_LOCAL_MACHINE, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "SOFTWARE\Microsoft\Office\Common" )<br />&nbsp; &nbsp;nVer &nbsp;:= oReg:Get( 'LastAccessInstall', nVer )<br />&nbsp; &nbsp;oReg:Close()<br />&nbsp; &nbsp;*/</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nCounter := <span style="color: #000000;">20</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">10</span> step <span style="color: #000000;">-1</span><br />&nbsp; &nbsp; &nbsp; cKey := <span style="color: #ff0000;">"SOFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\O</span>ffice<span style="color: #000000;">\"</span>+ltrim(str(nCounter,4,1))+"</span>\Common\InstallRoot<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; oReg &nbsp;:= TReg32():New( HKEY_LOCAL_MACHINE, cKey )<br />&nbsp; &nbsp; &nbsp; cPath &nbsp;:= oReg:Get( 'Path', cPath )<br />&nbsp; &nbsp; &nbsp; oReg:Close()<br />&nbsp; &nbsp; &nbsp; if cPath != nil .and. file( cPath+"</span>excel.exe<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nVer := nCounter<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br />&nbsp; &nbsp; &nbsp; endif<br />&nbsp; &nbsp;next<br />return nVer<br /></span></div>[/code:1jetl34y]
Check if Word or Excel is installed
Enrico, Rao, Gale, Thanks for the reply, I will test it.
Check if a device was connected
How to check if a specific device was connected? I need to check if a specific USB Printer was connected.
Check if a device was connected
Was connected or still is connected ?
Check if a device was connected
Both works for me. But know if the device still is connected will provide me a better solution
Check if a device was connected
Samir, I'm not sure what you are looking for, but the function below will tell you if a specified printer is setup on that PC. FW's own function getPrnName() returns the name of the current printer. James [code=fw:1e3hogw7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> isPrinterModel<span style="color: #000000;">&#40;</span> cModel <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> aPrinters:= getPrinters<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, i:=<span style="color: #000000;">0</span>, lSuccess:=.f.<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> aPrinters <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> aPrinters<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> = cModel<br />         lSuccess:=.t.<br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">next</span><br /><span style="color: #00C800;">return</span> lSuccess</div>[/code:1e3hogw7]
Check if a device was connected
James, the printer isn't recognized as a printer by the OS. Here in Brazil we have the ECF ( Emissor de Cupom Fiscal ) something like fiscal coupons emitter, thermal printers with a specific firmware that must be used to print valid coupons to collect taxes. Most of them connect through the serial port, some connect via USB, but create a virtual serial port and a specific brand connects via USB, but creates another type of device (USBIO). I need to know if this device is connected.
Check if a device was connected
Samir, OK. Well I don't know the answer to that one. Here is a manual for setting up USB drivers which may help. Perhaps you can find a registry entry that you could search for. <!-- m --><a class="postlink" href="http://www.thesycon.de/usbio/usbio_win_manual.pdf">http://www.thesycon.de/usbio/usbio_win_manual.pdf</a><!-- m --> And here is a little utility program that will list all the USB devices that have ever been connected. It doesn't solve your problem but maybe it will be useful in finding a solution. <!-- m --><a class="postlink" href="http://www.nirsoft.net/utils/usb_devices_view.html">http://www.nirsoft.net/utils/usb_devices_view.html</a><!-- m --> James
Check if a file is in use
Hi all, having a .rt file, is there a low level file function to check if it is open ? I need to know if the file is in use from Microsoft Word or another word processor. Thank you in advance.
Check if a file is in use
What I do to check if a file is in use :[code=fw:ln7rgia7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">TRY</span><br />     FOPEN<span style="color: #000000;">&#40;</span>cFile<span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"File is NOT in use"</span><span style="color: #000000;">&#41;</span><br />     FCLOSE<span style="color: #000000;">&#40;</span>cFile<span style="color: #000000;">&#41;</span><br />CATCH<br />     <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"File is in use"</span><span style="color: #000000;">&#41;</span><br />END</div>[/code:ln7rgia7]Good luck.
Check if a file is in use
It runs, thank you driessen, just made some small changes: handle:=fopen(cfile,16) if handle>0 && is unlocked else && is locked endif
Check if the page called from HTTP or HTTPS
Dear Antonio, Can we check if a call is from http or https? Best regards, Otto I need TEMPLATE <script> document.write(document.location) </script> ENDTEXT but in mod harbour. So I thought to take AP_HeadersIN() Host-key and AP_FileName() and STRTAN() to change \/ and drive APACHE dir C:/www/htdocs to <!-- m --><a class="postlink" href="https://domain">https://domain</a><!-- m --> and rest from AP_filename()
Check if the page called from HTTP or HTTPS
Dear Otto, Please try checking AP_GetEnv( "HTTPS" ) best regards
Check if the page called from HTTP or HTTPS
Dear Antonio, perfect! Best regards, Otto
Check if the user is gone away
Hi, I have a lot of customers that leave my FWH app active and go away. I need a solution to understand if the user is still working otherwise I want to automatically terminate the app. I think something like a 15 min timer could runs but I need to reset the timer each time the user move the mouse or press a keyboard key. Any ideas or alternatives ? Thanks in advance
Check if the user is gone away
[code=fw:d31hpfa6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />*************<br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />*************<br />&nbsp;<br />&nbsp; &nbsp;nTempo_espera := <span style="color: #000000;">10</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//Tempo a ser esperado ate chamar a funcao</span><br />&nbsp;<br />&nbsp; &nbsp;cNome_funcao := <span style="color: #ff0000;">"LOGOFF()"</span> &nbsp;<span style="color: #B900B9;">//nome da funcao a ser chamada quando</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//chegar no tempo de espera</span><br />&nbsp;<br />&nbsp; &nbsp;lTimercontinua := .f. &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//se apos executar a funcao , continua monitorando</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//a inatividade do mouse e teclado.</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Teste de teclado e mouse"</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">init</span> tinativo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span> nTempo_espera,cNome_funcao, lTimerContinua <span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br />&nbsp;<br /><br /><span style="color: #00C800;">function</span> logoff<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;msgalert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"AQUI ENTRA SUA FUNCAO DE LOGOFF !"</span>,<span style="color: #ff0000;">"AVISO"</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;<br /><span style="color: #B900B9;">// Classe: tinativo.prg</span><br />&nbsp;<br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br />&nbsp;<br /><span style="color: #00C800;">CLASS</span> TINATIVO<br />&nbsp;<br />&nbsp; <span style="color: #00C800;">DATA</span> nTimeInpAntes<br />&nbsp; <span style="color: #00C800;">DATA</span> nTimeInpDepois<br />&nbsp; <span style="color: #00C800;">DATA</span> cTimeAtu <br />&nbsp; <span style="color: #00C800;">DATA</span> nTempo<br />&nbsp; <span style="color: #00C800;">DATA</span> oTimerTime<br />&nbsp; <span style="color: #00C800;">DATA</span> cFunc<br />&nbsp; <span style="color: #00C800;">DATA</span> lContinuar<br />&nbsp;<br />&nbsp; <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">NEW</span><span style="color: #000000;">&#40;</span> nTime, cFuncao, lContinua <span style="color: #000000;">&#41;</span> &nbsp;CONSTRUCTOR<br />&nbsp;<br />&nbsp; <span style="color: #00C800;">METHOD</span> ver_tempo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #00C800;">ENDCLASS</span><br />&nbsp;<br />**********************<br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span>ntime,cFuncao,lContinua<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TINATIVO<br />**********************<br />&nbsp;<br />&nbsp; &nbsp;::<span style="color: #000000;">cfunc</span>:=cfuncao<br />&nbsp; &nbsp;::<span style="color: #000000;">ntempo</span>:=ntime<br />&nbsp; &nbsp;::<span style="color: #000000;">lContinuar</span>:=lContinua<br />&nbsp; &nbsp;::<span style="color: #000000;">oTimerTime</span> := TTimer<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;">1000</span>, <span style="color: #000000;">&#123;</span> || ::<span style="color: #000000;">VER_TEMPO</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">oTimerTime</span>:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">cTimeAtu</span> := time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nTimeInpAntes</span> := getInputState<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #B900B9;">// 0 = erro</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">self</span><br />&nbsp;<br />*************************<br /><span style="color: #00C800;">METHOD</span> VER_TEMPO <span style="color: #00C800;">CLASS</span> TINATIVO<br />*************************<br />&nbsp;<br />&nbsp; &nbsp;::<span style="color: #000000;">nTimeInpDepois</span> := getInputState<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nTimeInpDepois</span> - ::<span style="color: #000000;">nTimeInpAntes</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nTimeInpAntes</span> := getInputState<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cTimeAtu</span> := time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> CONVTIME<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> - CONVTIME<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">cTimeAtu</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > ::<span style="color: #000000;">ntempo</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oTimerTime</span>:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; aux := ::<span style="color: #000000;">cfunc</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; * aqui executa a funcao<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &aux<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lContinuar</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oTimerTime</span>:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cTimeAtu</span> := time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span></div>[/code:d31hpfa6]
Check if the user is gone away
Wanted to test it, but there are two missing functions : ::nTimeInpAntes := [color=#FF0000:2ci9p7mi]getInputState()[/color:2ci9p7mi] IF ( [color=#FF0000:2ci9p7mi]CONVTIME(time() [/color:2ci9p7mi]) possible to include them <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> Instead of using CONVTIME, I could use my function [code=fw:2ci9p7mi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">FUNCTION</span> ELAPSED<span style="color: #000000;">&#40;</span>dStart, dEnd, cTimeStart, cTimeEnd<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> nTotalSec, nCtr, nConstant, nTemp, aRetVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br /> <br /><span style="color: #00C800;">IF</span> ! <span style="color: #000000;">&#40;</span> VALTYPE<span style="color: #000000;">&#40;</span>dStart<span style="color: #000000;">&#41;</span> $ <span style="color: #ff0000;">'DC'</span> <span style="color: #000000;">&#41;</span><br />    dStart := DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />ELSEIF VALTYPE<span style="color: #000000;">&#40;</span>dStart<span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />    cTimeStart := dStart<br />    dStart := DATE<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;">IF</span> ! <span style="color: #000000;">&#40;</span> VALTYPE<span style="color: #000000;">&#40;</span>dEnd<span style="color: #000000;">&#41;</span> $ <span style="color: #ff0000;">'DC'</span> <span style="color: #000000;">&#41;</span><br />    dEnd := DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />ELSEIF VALTYPE<span style="color: #000000;">&#40;</span>dEnd<span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />    cTimeEnd := dEnd<br />    dEnd := DATE<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;">IF</span><span style="color: #000000;">&#40;</span> VALTYPE<span style="color: #000000;">&#40;</span>cTimeStart<span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">'C'</span>, cTimeStart := <span style="color: #ff0000;">'00:00:00'</span>, <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> VALTYPE<span style="color: #000000;">&#40;</span>cTimeEnd<span style="color: #000000;">&#41;</span>   != <span style="color: #ff0000;">'C'</span>, cTimeEnd   := <span style="color: #ff0000;">'00:00:00'</span>, <span style="color: #000000;">&#41;</span><br /> <br />nTotalSec  := <span style="color: #000000;">&#40;</span>dEnd - dStart<span style="color: #000000;">&#41;</span> * <span style="color: #000000;">86400</span>                              + ;<br />                VAL<span style="color: #000000;">&#40;</span>cTimeEnd<span style="color: #000000;">&#41;</span>   *  <span style="color: #000000;">3600</span>                              + ;<br />                VAL<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTimeEnd,<span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">':'</span>, cTimeEnd<span style="color: #000000;">&#41;</span><span style="color: #000000;">+1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> * <span style="color: #000000;">60</span>     + ;<br />                <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>RAT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">':'</span>, cTimeEnd<span style="color: #000000;">&#41;</span> == <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">':'</span>, cTimeEnd<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>,         ;<br />                VAL<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTimeEnd,RAT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">':'</span>, cTimeEnd<span style="color: #000000;">&#41;</span><span style="color: #000000;">+1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>          - ;<br />                VAL<span style="color: #000000;">&#40;</span>cTimeStart<span style="color: #000000;">&#41;</span> * <span style="color: #000000;">3600</span>                               - ;<br />                VAL<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTimeStart,<span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">':'</span>, cTimeStart<span style="color: #000000;">&#41;</span><span style="color: #000000;">+1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> * <span style="color: #000000;">60</span> - ;<br />                <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>RAT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">':'</span>, cTimeStart<span style="color: #000000;">&#41;</span> == <span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">':'</span>, cTimeStart<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>,     ;<br />                VAL<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cTimeStart,RAT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">':'</span>, cTimeStart<span style="color: #000000;">&#41;</span><span style="color: #000000;">+1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /> <br />nTemp := nTotalSec<br /> <br /><span style="color: #00C800;">FOR</span> nCtr = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">4</span><br />    nConstant := <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>nCtr == <span style="color: #000000;">1</span>, <span style="color: #000000;">86400</span>, <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>nCtr == <span style="color: #000000;">2</span>, <span style="color: #000000;">3600</span>, <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nCtr == <span style="color: #000000;">3</span>, <span style="color: #000000;">60</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />    aRetVal<span style="color: #000000;">&#91;</span>nCtr,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := INT<span style="color: #000000;">&#40;</span>nTemp/nConstant<span style="color: #000000;">&#41;</span><br />    aRetval<span style="color: #000000;">&#91;</span>nCtr,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := nTotalSec / nConstant<br />    nTemp -= aRetVal<span style="color: #000000;">&#91;</span>nCtr,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> * nConstant<br /><span style="color: #00C800;">NEXT</span><br /> <br /><span style="color: #00C800;">RETURN</span> aRetVal<br /> </div>[/code:2ci9p7mi] best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Check if the user is gone away
Complete, [url:9zvl6a8z]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=27560&p=155963&hilit=CERRAR+PROGRAMA#p155963[/url:9zvl6a8z]
Check if the user is gone away
Thank You very much [b:15zqkq7v]Tested and works fine ![/b:15zqkq7v] Maybe my usage gives You a idea to include it inside Your own app ? I added this solution to my METRO-app section ALARMCLOCK / DateTime -function to define the parameters. The main-function : a sound is played at a defined date and time. 3 different date/times are possible. [color=#0000FF:15zqkq7v]NEW : a defined workingtime < 0 > means the function is disabled. You can define : closing the app or showing a new LOGIN.[/color:15zqkq7v] [img:15zqkq7v]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/logoff1&#46;jpg[/img:15zqkq7v] My MAIN-window : aVal[51] is the time defined inside my alarmclock-function SHOW_TD(oWnd) opens the alarmclock ACTIVATE WINDOW oWnd MAXIMIZED ; [color=#0000FF:15zqkq7v]ON INIT ( SHOW_TD(oWnd), IIF( aVal[51] > 0, TINATIVO():New( 3, "LOGOFF()", .F. ), NIL ) )[/color:15zqkq7v] ; ON CLICK IIF( nRow > ScreenHeight() - 100 .and. nCol > ScreenWidth() - 100, ; oWnd:End(), ( nBenutzer := USERLOGIN(oWnd), ; IIF( nBenutzer > 0, ( LOAD_SYS1(nBenutzer), BUILDMETRO(oWnd) ), oWnd:End() ) ) ) ; ON PAINT ( ABPaint( hDC, ( ScreenWidth() / 2 ) - ( oImgTouch:nWidth / 2 ), ; ( ScreenHeight() / 2 ) - ( oImgTouch:nHeight / 2 ), oImgTouch:hBitmap, 255 ),; // DrawTransparent( hDC, oImgTouch:hBitmap, 250, 500 ),; ABPaint( hDC, ScreenWidth() - 100, ScreenHeight() - 40,; oImgEnd:hBitmap, 255 ), ; oImgEnd:End() ) New LOGIN selected from alarmclock-section after a defined elapsed time : [img:15zqkq7v]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/logoff2&#46;jpg[/img:15zqkq7v] [code=fw:15zqkq7v]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> LOGOFF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span>  aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">52</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">2</span> <span style="color: #B900B9;">// Quit selected</span><br />      oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ELSE</span>                <span style="color: #B900B9;">// new login selected</span><br />   <span style="color: #00C800;">IF</span> NET_USE <span style="color: #000000;">&#40;</span> c_Pfad3 + <span style="color: #ff0000;">"SYSTEM.dbf"</span>, <span style="color: #ff0000;">"SYSTEM"</span>, <span style="color: #000000;">3</span>, .T. <span style="color: #000000;">&#41;</span> <br />         DBSELECTAREA<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SYSTEM"</span><span style="color: #000000;">&#41;</span><br />         LOAD_SYS1<span style="color: #000000;">&#40;</span>nBenutzer<span style="color: #000000;">&#41;</span><br />         nBenutzer := USERLOGIN<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// valid = nBenutzer > 0</span><br />         <span style="color: #00C800;">IF</span> nBenutzer = <span style="color: #000000;">0</span><br />              oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">ELSE</span><br />              BUILDMETRO<span style="color: #000000;">&#40;</span>oWnd<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;">ENDIF</span><br /> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:15zqkq7v] best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Check if the user is gone away
I added a third option to carry on working from the point, the program has been locked. [code=fw:17wfy1o1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> LOGOFF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> nOldselect <br /><br /><span style="color: #00C800;">IF</span> &nbsp;aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">52</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">1</span><br />&nbsp; &nbsp; CLOSE DATABASE<br />&nbsp; &nbsp; oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />ELSEIF &nbsp;aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">52</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">2</span><br />&nbsp; &nbsp; CLOSE DATABASE<br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> NET_USE <span style="color: #000000;">&#40;</span> c_Pfad3 + <span style="color: #ff0000;">"SYSTEM.dbf"</span>, <span style="color: #ff0000;">"SYSTEM"</span>, <span style="color: #000000;">3</span>, .T. <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; DBSELECTAREA<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SYSTEM"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; LOAD_SYS1<span style="color: #000000;">&#40;</span>nBenutzer<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; nBenutzer := USERLOGIN1<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> nBenutzer = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oWnd:<span style="color: #000000;">End</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; BUILDMETRO<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />ELSEIF &nbsp;aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">52</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">3</span> &nbsp; <span style="color: #B900B9;">// carry on working </span><br />&nbsp; &nbsp; nOldselect := <span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> NET_USE <span style="color: #000000;">&#40;</span> c_Pfad3 + <span style="color: #ff0000;">"SYSTEM.dbf"</span>, <span style="color: #ff0000;">"SYSTEM"</span>, <span style="color: #000000;">3</span>, .T. <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; DBSELECTAREA<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SYSTEM"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; LOAD_SYS1<span style="color: #000000;">&#40;</span>nBenutzer<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; nBenutzer := USERLOGIN2<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// small extra login</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DBSELECTAREA<span style="color: #000000;">&#40;</span> nOldselect <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">ENDIF</span><br />&nbsp;<br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:17wfy1o1] best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Check if the user is gone away
I added a third option to carry on working from the point, the program has been locked. [img:2q6b02mj]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/lock1&#46;jpg[/img:2q6b02mj] [code=fw:2q6b02mj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> LOGOFF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> nOldselect <br /><br /><span style="color: #00C800;">IF</span>  aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">52</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">1</span> <span style="color: #B900B9;">// CLOSE</span><br />    CLOSE DATABASE<br />    oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />ELSEIF  aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">52</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">2</span> <span style="color: #B900B9;">// NORMAL LOGIN</span><br />    CLOSE DATABASE<br />    <span style="color: #00C800;">IF</span> NET_USE <span style="color: #000000;">&#40;</span> c_Pfad3 + <span style="color: #ff0000;">"SYSTEM.dbf"</span>, <span style="color: #ff0000;">"SYSTEM"</span>, <span style="color: #000000;">3</span>, .T. <span style="color: #000000;">&#41;</span> <br />        DBSELECTAREA<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SYSTEM"</span><span style="color: #000000;">&#41;</span><br />        LOAD_SYS1<span style="color: #000000;">&#40;</span>nBenutzer<span style="color: #000000;">&#41;</span><br />        nBenutzer := USERLOGIN1<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span> <br />        <span style="color: #00C800;">IF</span> nBenutzer = <span style="color: #000000;">0</span><br />            oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">ELSE</span><br />            BUILDMETRO<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span> <br />        <span style="color: #00C800;">ENDIF</span><br />    <span style="color: #00C800;">ENDIF</span><br />ELSEIF  aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">52</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">3</span>   <span style="color: #B900B9;">// CARRY ON WORKING </span><br />    nOldselect := <span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">IF</span> NET_USE <span style="color: #000000;">&#40;</span> c_Pfad3 + <span style="color: #ff0000;">"SYSTEM.dbf"</span>, <span style="color: #ff0000;">"SYSTEM"</span>, <span style="color: #000000;">3</span>, .T. <span style="color: #000000;">&#41;</span> <br />        DBSELECTAREA<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SYSTEM"</span><span style="color: #000000;">&#41;</span><br />        LOAD_SYS1<span style="color: #000000;">&#40;</span>nBenutzer<span style="color: #000000;">&#41;</span><br />        nBenutzer := USERLOGIN2<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// small extra login</span><br />        DBSELECTAREA<span style="color: #000000;">&#40;</span> nOldselect <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">ENDIF</span><br /> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2q6b02mj] best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Check if the user is gone away
Solved, thank you all for the tricks.
Check if the user is gone away
Marco, there is a useful solution from Daniel. Closes the program and starts again for login. <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=20477&p=108676&hilit=relaunch#p108676">viewtopic.php?f=3&t=20477&p=108676&hilit=relaunch#p108676</a><!-- l --> best regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Check if user Locked/Unlocked Windows from my Software
Hi, as mentioned on the subject, I searched on msdn SessionSwitchReason.SessionLock, but I'm unable to understand how to implement on harbour+Fwh Here: [url:3queyo09]https&#58;//msdn&#46;microsoft&#46;com/en-us/library/microsoft&#46;win32&#46;sessionswitchreason(v=vs&#46;110)&#46;aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1[/url:3queyo09] and [url:3queyo09]https&#58;//msdn&#46;microsoft&#46;com/en-us/library/microsoft&#46;win32&#46;sessionswitcheventargs(v=vs&#46;110)&#46;aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1[/url:3queyo09] Please help!
Check if user Locked/Unlocked Windows from my Software
+Up
Check if user Locked/Unlocked Windows from my Software
Up!++
Check if user Locked/Unlocked Windows from my Software
I don't know if this will work, but try this: [code=fw:2d8z9gy7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> isWindowsLocked<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">Local</span> lLocked:=.f.<br />    <span style="color: #00C800;">if</span> getForegroundWindow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span>  <span style="color: #B900B9;">// Screen saver or login screen is foreground</span><br />      lLocked:=.t.<br />    <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> lLocked<br /><br /> </div>[/code:2d8z9gy7]James
Check if user Locked/Unlocked Windows from my Software
[quote="James Bott":1kucnxrj]I don't know if this will work, but try this: [code=fw:1kucnxrj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> isWindowsLocked<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">Local</span> lLocked:=.f.<br />    <span style="color: #00C800;">if</span> getForegroundWindow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span>  <span style="color: #B900B9;">// Screen saver or login screen is foreground</span><br />      lLocked:=.t.<br />    <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> lLocked<br /><br /> </div>[/code:1kucnxrj]James[/quote:1kucnxrj] Thank's James, It Worked Flawlessly!!!
Check if user Locked/Unlocked Windows from my Software
Hebert, Glad to hear it. I am curious why you needed this? Maybe its something some of the rest of us might use too, if we knew what kind of a problem it solves. James
Check if user Locked/Unlocked Windows from my Software
Mr James Wonderful idea <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Check if user Locked/Unlocked Windows from my Software
[quote="James Bott":c91rknph]Hebert, Glad to hear it. I am curious why you needed this? Maybe its something some of the rest of us might use too, if we knew what kind of a problem it solves. James[/quote:c91rknph] James I have an application receving messages from other users (not a chat), if the user leave the computer alone, after a while in idle mode Windows will get locked automaticaly and I need to inform other user's that this user is not in from of the desk, so request or messages can be send to other user or operator, that's the reason I need to check if Windows is Locked, and many thank's for you interest.
Check if user Locked/Unlocked Windows from my Software
Hebert, Well, that is a very good use. Congrats on thinking of how to accomplish it! I'm going to record that in my bag of tricks. Feel free to make some more contributions here when you come up with ideas like this. James
Check if user Locked/Unlocked Windows from my Software
[quote="James Bott":3cseydrr]Hebert, Well, that is a very good use. Congrats on thinking of how to accomplish it! I'm going to record that in my bag of tricks. Feel free to make some more contributions here when you come up with ideas like this. James[/quote:3cseydrr] Bag of tricks, hum! I'll take this idea as well, I'm eager to contribute and many thank's James.
Check keyboard buffer without the program being in focus
I have a program running on Tray and I am trying to check for a key combination that may be pressed. Example: Pressing CTRL + J The problem is that the program is minimized in the tray. the CTRL key I can check with GETKEYSTATE plus the letter J key only with LastKey (), but it works if the program is in focus. Is there another function that could read the keyboard buffer without the program being in focus?
Check keyboard buffer without the program being in focus
Super Difícil. Talvez, usando o agendado de tarefas. Talvez, usando um TIMER. Talvez com HB_KeyPut() do Harbour. So hard. Perhaps, using the scheduled task. Perhaps, using a TIMER. Maybe with HB_KeyPut () from Harbour. [url:166e81es]https&#58;//github&#46;com/Petewg/harbour-core/wiki/hb_J_K[/url:166e81es] Sorry, Abs. Regards.
Check lock-status of record without locking it.
Hi, How can I check of a reckord is locked by an other user without locking it (so not use rlock()) I already tested it with DbRecordInfo(2), but this return .f. even when it's locked <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Marc
Check lock-status of record without locking it.
Hi, I also tested it with DbRLockList(), but this function returns an empty array, even when someone has locked a record. Does it only return the records locked by the lockal PC , and not the records locked by someone else? Marc
Check lock-status of record without locking it.
Hello Mark, I have written my own locking system which is working very well. First of all, I have 3 fields in every DBF-file I use : PRDURE D 20 PRLINE N 5 CTRAFK C 3 To lock my records, I use this code : [code=fw:3uq3gs18]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> RecLock<span style="color: #000000;">&#40;</span>RLWijze,RLProc,RLLine,RLWaitSec,RLTaal,RLShow,RLAltijd,RLUser<span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> lForever<br />   <span style="color: #00C800;">LOCAL</span> nWait<br />   <span style="color: #00C800;">LOCAL</span> lRedo      := .T.<br />   <span style="color: #00C800;">LOCAL</span> nOrde      := INDEXORD<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">DEFAULT</span><span style="color: #000000;">&#40;</span>RLWijze,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">DEFAULT</span><span style="color: #000000;">&#40;</span>RLWaitSec,<span style="color: #000000;">0.1</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">DEFAULT</span><span style="color: #000000;">&#40;</span>RLTaal,<span style="color: #ff0000;">"N"</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">DEFAULT</span><span style="color: #000000;">&#40;</span>RLShow,.T.<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">DEFAULT</span><span style="color: #000000;">&#40;</span>RLAltijd,.F.<span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">IF</span> RLWijze = <span style="color: #000000;">2</span><br />      <span style="color: #00C800;">DEFAULT</span><span style="color: #000000;">&#40;</span>RLUser,xLockUser<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br />   SET ORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">0</span><br /><br />   lForever=<span style="color: #000000;">&#40;</span>RLWaitSec==<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> lRedo<br />      nWait=RLWaitSec*<span style="color: #000000;">2</span><br />      <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> lForever .OR. nWait><span style="color: #000000;">0</span><br />         <span style="color: #00C800;">IF</span> RLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">IF</span> !NETERR<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />               <span style="color: #00C800;">IF</span> RLWijze = <span style="color: #000000;">1</span><br />                  SET ORDER <span style="color: #0000ff;">TO</span> nOrde<br />                  <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br />               <span style="color: #00C800;">ELSE</span><br />                  <span style="color: #00C800;">IF</span> RLAltijd .OR. EMPTY<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->CTRAFK"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> .OR. UPPER<span style="color: #000000;">&#40;</span>ALLTRIM<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->CTRAFK"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> = UPPER<span style="color: #000000;">&#40;</span>ALLTRIM<span style="color: #000000;">&#40;</span>RLUser<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />                     &<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"->CTRAFK"</span><span style="color: #000000;">&#41;</span> := RLUser<br />                     &<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"->PRDURE"</span><span style="color: #000000;">&#41;</span> := RLProc<br />                     &<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"->PRLINE"</span><span style="color: #000000;">&#41;</span> := RLLine<br />                     <span style="color: #00C800;">IF</span> xCommit<br />                        COMMIT<br />                     <span style="color: #00C800;">ELSE</span><br />                        UNLOCK<br />                        RLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                     <span style="color: #00C800;">ENDIF</span><br />                     SET ORDER <span style="color: #0000ff;">TO</span> nOrde<br />                     <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<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;">ENDIF</span><br />         <span style="color: #00C800;">ENDIF</span><br />         INKEY<span style="color: #000000;">&#40;</span>.<span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span><br />         nWait--<br />      <span style="color: #00C800;">ENDDO</span><br />      <span style="color: #00C800;">IF</span> RLShow<br />         lRedo := MsgYesNo<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"De gegevens welke U wenst aan te passen,"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                           <span style="color: #ff0000;">"zijn in gebruik met de volgende parameters :"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #ff0000;">"Betreft de volgende gegevens :"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #ff0000;">"  - Bestand : "</span>+<span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #ff0000;">"  - Record nr. : "</span>+ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #ff0000;">"U wilt deze gegevens in gebruik nemen :"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>RLWijze=<span style="color: #000000;">2</span>,<span style="color: #ff0000;">"  - Gebruiker : "</span>+ALLTRIM<span style="color: #000000;">&#40;</span>RLUser<span style="color: #000000;">&#41;</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #ff0000;">"  - Procedure : "</span>+RLProc+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #ff0000;">"  - Lijn nr. : "</span>+ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>RLLine<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #ff0000;">"Deze gegevens worden gebruikt door :"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>EMPTY<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->CTRAFK"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">"- Softwarelock"</span>,<span style="color: #ff0000;">"  - Gebruiker : "</span>+ALLTRIM<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->CTRAFK"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                                                                                                <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>!EMPTY<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->PRDURE"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">"  - Procedure : "</span>+ALLTRIM<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->PRDURE"</span>     <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>+;<br />                                                                                                <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->PRLINE"</span><span style="color: #000000;">&#41;</span><><span style="color: #000000;">0</span>     ,<span style="color: #ff0000;">"  - Lijn nr. : "</span> +ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->PRLINE"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+;<br />                            CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span>+;<br />                            <span style="color: #ff0000;">"Wenst U opnieuw te proberen ?"</span>,;<br />                            <span style="color: #ff0000;">"Kies "</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"JA"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" of "</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"NEE"</span>+CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ELSE</span><br />         lRedo := .F.<br />      <span style="color: #00C800;">ENDIF</span><br />      <span style="color: #00C800;">IF</span> !lRedo .AND. RLWijze = <span style="color: #000000;">2</span> ; UNLOCK ; <span style="color: #00C800;">ENDIF</span><br />   <span style="color: #00C800;">ENDDO</span><br /><br />   SET ORDER <span style="color: #0000ff;">TO</span> nOrde<br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br /> </div>[/code:3uq3gs18] To unlock my record, I use this code : [code=fw:3uq3gs18]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROCEDURE RecUnLock<span style="color: #000000;">&#40;</span>RLWijze,RLProc,RLLine,RLUser<span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">DEFAULT</span><span style="color: #000000;">&#40;</span>RLWijze,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">IF</span> RlWijze = <span style="color: #000000;">2</span><br />      <span style="color: #00C800;">DEFAULT</span><span style="color: #000000;">&#40;</span>RLUser,xLockUser<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #00C800;">IF</span> RLWijze = <span style="color: #000000;">1</span><br />      <span style="color: #00C800;">IF</span> xCommit ; COMMIT ; <span style="color: #00C800;">ENDIF</span><br />      UNLOCK<br />   <span style="color: #00C800;">ELSE</span><br />      <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->CTRAFK"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> .AND. UPPER<span style="color: #000000;">&#40;</span>ALLTRIM<span style="color: #000000;">&#40;</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>+<span style="color: #ff0000;">"->CTRAFK"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> = UPPER<span style="color: #000000;">&#40;</span>ALLTRIM<span style="color: #000000;">&#40;</span>RLUser<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">IF</span> RecLockJuda<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>,PROCNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,PROCLINE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">2</span>,TaalCode<span style="color: #000000;">&#41;</span><br />            &<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"->CTRAFK"</span><span style="color: #000000;">&#41;</span> := SPACE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><br />            &<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"->PRDURE"</span><span style="color: #000000;">&#41;</span> := SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />            &<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"->PRLINE"</span><span style="color: #000000;">&#41;</span> := <span style="color: #000000;">0</span><br />         <span style="color: #00C800;">ENDIF</span><br />         <span style="color: #00C800;">IF</span> xCommit ; COMMIT ; <span style="color: #00C800;">ENDIF</span><br />         UNLOCK<br />      <span style="color: #00C800;">ENDIF</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><br /> </div>[/code:3uq3gs18] To lock my record, all I do is : [code=fw:3uq3gs18]<div class="fw" id="{CB}" style="font-family: monospace;">RecLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span>,PROCNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,PROCLINE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">5</span>,TaalCode<span style="color: #000000;">&#41;</span></div>[/code:3uq3gs18] And to unlock : [code=fw:3uq3gs18]<div class="fw" id="{CB}" style="font-family: monospace;">RecUnLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span>,PROCNAME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,PROCLINE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></div>[/code:3uq3gs18] I always see who has locked a record and where he has locked it. It's always a very intereting something for debugging. If any questions, don't hesitate to ask. Good luck.
Check lock-status of record without locking it.
Marc, If you are using TDatabase it has a method isLocked(). If you are not using TDatabase, then use the code in the islocked() method. I highly recommend using a database class. For more about using database classes see my website at [url:3c0e03ol]http&#58;//www&#46;gointellitech&#46;com[/url:3c0e03ol] James
Check lock-status of record without locking it.
Michel, Thanks for the example. Before, I was using something simular, but there was a problem when for some reason the program ended not normal (error or crash PC). The record was always locked for the other users. Then the program should be restarted on that PC for unlocking the record. Sometime he user didn' restard the program, with the result that nobody can access that record anymore. I was thinking for a method tho theck that the PC that has locked the record is still running the program, but I did'n find a good solution for that yet. A was thinking for using a timer a always update a record. If the record isn't updated anymore, the program is offline. How did you handel this? James, I will take a look at the TDatabase class. Regards, Marc
Check lock-status of record without locking it.
Marc, If you are using pessimistic locking this makes the problem worse. By "pessimistic" locking I mean that the record is locked whenever a user is editing a record. When doing this the record can be locked for a long time and there is more chance that a crash could happen. If you use "optimistic" locking then you only lock the record when the user saves the changes. The record is only locked for a split second and thus there is less chance of a problem. James
Check lock-status of record without locking it.
James, I agree with you in normal case, but in this program I must use that kind of locking. The program I'm writing is a truck-planning-program for a transport-company. If one user is modifying a route of a driver, other planners are not allowed to change this. The user is also not allowed to drag the route of one driver to another driver if someone else is changing the route... Regards, Marc
Check of bitmap is defined in RC-file
Hi,Is there a way to check if an bitmap defined in the RC-file[code:3h5virn3]TRUCK BITMAP _Buttons\truck&#46;bmp TRUCK2 BITMAP _Buttons\truck2&#46;bmp[/code:3h5virn3]If for example TRUCK2 is defined i want to use that BITMAP, otherwise I use TRUCK.Thanks,Marc
Check of bitmap is defined in RC-file
Is this possible?Thanks,Marc
Check of bitmap is defined in RC-file
Marc,This the way to define bitmaps at RC files:[code:13bkcdat] ANY_IMAGE_I BITMAP "&#46;&#46;\\folder\\image_1&#46;bmp" ANY_IMAGE_II BITMAP "&#46;&#46;\\folder\\image_2&#46;bmp" [/code:13bkcdat] There is a function for load these bitmaps: [code:13bkcdat]loadBitmap&#40; , "ANY_IMAGE_I" &#41;[/code:13bkcdat]I think, if this function returns nothing... this is because the resource named ANY_IMAGE_I not exists into RC file...
Check of bitmap is defined in RC-file
Thanks Júlio César,If I call [code:1l4pxcvn]loadBitmap&#40; GetResources&#40;&#41;, "TRUCK" &#41;[/code:1l4pxcvn]The function returns '0' if it doesn't exist. Regards,Marc
Check of bitmap is defined in RC-file
Marc,Thats a valid solution. Another way is to use FindResource():FindResource( GetResources(), "TRUCK", 2 ) != 02 means that it is a bitmapFiveWin uses it in source\classes\menu.prg
Check of bitmap is defined in RC-file
Very more clean!
Check of bitmap is defined in RC-file
Thanks Antonio,Regards,Marc
Check opened file by ALIAS?
Hi everybody, Is there a function to see if an ALIAS is in use? Use MyFile.DBF new alias "TEST" I would like to see if "TEST" is opened. Thanks, Jeff
Check opened file by ALIAS?
Jeff: If Select( "Test" ) > 0 // it's open (in use) Endif [quote="Jeff Barnes":290821rh]Hi everybody, Is there a function to see if an ALIAS is in use? Use MyFile.DBF new alias "TEST" I would like to see if "TEST" is opened. Thanks, Jeff[/quote:290821rh]
Check opened file by ALIAS?
Thanks Luis. Jeff
Check/Uncheck menuPOPUP item.
I have a popup menu and I want checked one item WHEN i SELECT ONE MENU THE POPUP MUST CHANGE ON THE LAST ACTION HOW i CAN MAKE IT ? THE SMALL TEST [code=fw:3nti8go4]<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;">"xBrowse.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;">"ribbon.ch"</span><br /><br /><br /><br /><span style="color: #00D7D7;">#define</span> TOPSCOPE &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> BOTTOMSCOPE &nbsp; <span style="color: #000000;">1</span><br /><br />REQUEST DBFCDX<br />REQUEST DBFFPT<br />EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO<br /><br /><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> oDlg<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nBottom &nbsp; := <span style="color: #000000;">38.9</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nRight &nbsp; &nbsp;:= <span style="color: #000000;">106.5</span><br />&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;<span style="color: #00C800;">Local</span> nHeight := nBottom * DLG_CHARPIX_H<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span><br /><br />&nbsp;<span style="color: #0000ff;">MENU</span> oPopRecord <span style="color: #0000ff;">POPUP</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Record and Print"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Record and Email"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Record and Fax"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Record and Payment"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Record only"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save as Draft"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save as Recurring"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Preview"</span><br /><span style="color: #0000ff;">ENDMENU</span><br /><br />oMenuItem<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"New Invoice"</span> &nbsp; &nbsp;;<br />&nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> nWidth, nHeight &nbsp;TRANSPARENT <span style="color: #0000ff;">PIXEL</span><br /><br /><br /><br />@ <span style="color: #000000;">270</span>, <span style="color: #000000;">65</span> RBBTN <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Record select &nbsp; &nbsp; "</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> &nbsp;<span style="color: #000000;">100</span>,<span style="color: #000000;">12</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">POPUP</span> &nbsp;<span style="color: #0000ff;">MENU</span> oPopRecord BORDER <span style="color: #0000ff;">ROUND</span><br /><br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">centered</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><br /><br /><br /><br />&nbsp;</div>[/code:3nti8go4]
CheckBox
Dear all, Can I someone tell me about method of TCheckbox for fix empty ? If use the Checkbox for open dialog, after I did close dialog, I need to fix empty in checkbox, how I do that ? Best regrad, Peter
CheckBox
Peter, <oCheckBox>:SetCheck( .f. )