topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
Concatenar una variable. | Jessica:
Prueba así
[code=fw:29mliu1y]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cVar := <span style="color: #ff0000;">"BIT_A"</span>+STRZERO<span style="color: #000000;">(</span>nVez,<span style="color: #000000;">2</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> </div>[/code:29mliu1y]
Saludos |
Concatenar una variable. | Asi, me funciona a mi
[code=fw:2gczvo00]<div class="fw" id="{CB}" style="font-family: monospace;"><br />MEMVAR cVar1<br />MEMVAR cVar2<br />MEMVAR nG<br /><br /><br />.../...<br /><br />cVar1 := <span style="color: #ff0000;">"CARTERA"</span><br />cVar2 := <span style="color: #ff0000;">"VENCIDA"</span><br />nG := <span style="color: #000000;">1</span><br />? &<span style="color: #000000;">(</span><span style="color: #ff0000;">"cVar"</span>+AllTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span>nG<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> </div>[/code:2gczvo00] |
Concatenar una variable. | [quote="cnavarro":n3pv2tsn]Asi, me funciona a mi
[code=fw:n3pv2tsn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />MEMVAR cVar1<br />MEMVAR cVar2<br />MEMVAR nG<br /><br /><br />.../...<br /><br />cVar1 := <span style="color: #ff0000;">"CARTERA"</span><br />cVar2 := <span style="color: #ff0000;">"VENCIDA"</span><br />nG := <span style="color: #000000;">1</span><br />? &<span style="color: #000000;">(</span><span style="color: #ff0000;">"cVar"</span>+AllTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span>nG<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> </div>[/code:n3pv2tsn][/quote:n3pv2tsn]
Muuuchas gracias al parecer esta fue la buena. Ahora a probar lo demás. Este foro es buenísimo y las personas aquí son bellas e irrepetibles, venga gracias a todos.
Compañero es usted muy amable. Aquí nos estaremos leyendo. |
Concatenar una variable. | [quote="cnavarro":3fc6mgua]Asi, me funciona a mi
[code=fw:3fc6mgua]<div class="fw" id="{CB}" style="font-family: monospace;"><br />MEMVAR cVar1<br />MEMVAR cVar2<br />MEMVAR nG<br /><br /><br />.../...<br /><br />cVar1 := <span style="color: #ff0000;">"CARTERA"</span><br />cVar2 := <span style="color: #ff0000;">"VENCIDA"</span><br />nG := <span style="color: #000000;">1</span><br />? &<span style="color: #000000;">(</span><span style="color: #ff0000;">"cVar"</span>+AllTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span>nG<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> </div>[/code:3fc6mgua][/quote:3fc6mgua]
Sera lo mismo para campos de tablas? |
Concatenar una variable. | Si, es lo mismo
Saludos |
Concatenate a varible into a method call | To All
I am trying to insert the literal value of a character string into a method call ..
Example: this is the line I am trying to create
IE:document:forms:item(0):search:Value = cPARTS
cSFD := "document:forms:item(0):search"
IE:&cSFD:Value = cPARTS
The above fails and I can not use a plus (+) or macro (&) to concatenate or insert the variable into the method command ..
Any suggestions ?
Thanks
Rick Lipkin |
Concatenate a varible into a method call | Maybe you can create a block using macro compiler.
cSFD := "document:forms:item(0):search"
bSFD := &( "{ | cValue | IE:"+cSFD+":Value = cValue }" )
eval( bSFD, cPARTS )
Or maybe
cSFD := "document:forms:item(0):search"
bSFD := &( "{ || IE:"+cSFD+":Value = cPARTS }" )
eval( bSFD ) |
Concatenate a varible into a method call | Gale
Thank you for your suggestions .. both options failed with
Variable does not exist: IE
[url=http://imageshack.us/photo/my-images/825/eval1.jpg/:21zsfz9f][img:21zsfz9f]http://img825.imageshack.us/img825/6306/eval1.jpg[/img:21zsfz9f][/url:21zsfz9f]
Application
===========
Path and name: C:\Fox\WebCrawl\WebCrawl.Exe (32 bits)
Size: 2,043,904 bytes
Time from start: 0 hours 0 mins 17 secs
Error occurred at: 05/18/2011, 08:30:51
Error description: Error BASE/1003 Variable does not exist: IE
Args:
Stack Calls
===========
Called from: Vendor1.prg => (b)_VENDOR1(85)
Called from: Vendor1.prg => _VENDOR1(86)
Called from: main.prg => SEARCH(390)
Called from: main.prg => (b)_SEARCH(347)
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK(176)
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT(1427)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => SENDMESSAGE(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND(407)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(928)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(966)
Called from: main.prg => MAIN(260)
and again in basically the same block
[url=http://imageshack.us/photo/my-images/696/eval2.jpg/:21zsfz9f][img:21zsfz9f]http://img696.imageshack.us/img696/5974/eval2.jpg[/img:21zsfz9f][/url:21zsfz9f]
Application
===========
Path and name: C:\Fox\WebCrawl\WebCrawl.Exe (32 bits)
Size: 2,043,904 bytes
Time from start: 0 hours 0 mins 14 secs
Error occurred at: 05/18/2011, 08:46:17
Error description: Error BASE/1003 Variable does not exist: IE
Args:
Stack Calls
===========
Called from: Vendor1.prg => (b)_VENDOR1(91)
Called from: Vendor1.prg => _VENDOR1(92)
Called from: main.prg => SEARCH(390)
Called from: main.prg => (b)_SEARCH(347)
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK(176)
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT(1427)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => SENDMESSAGE(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND(407)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(928)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(966)
Called from: main.prg => MAIN(260)
I agree there must be some 'fire' mechanism to EVAL a character string to launch the method .. it appears that the IE: sender must be outside the block ?
Rick Lipkin |
Concatenate a varible into a method call | Just wondering, does the variable IE exist?
If this is an existing Internet Explorer object, then try this.
cSFD := "document:forms:item(0):search"
bSFD := &( "{ | oMyIE | oMyIE:"+cSFD+":Value = cPARTS }" )
eval( bSFD, IE ) |
Concatenate a varible into a method call | Gale
Interesting result .. the error log reveals the values of two results 'Enter Keyword' and the search string '130794'
Application
===========
Path and name: C:\Fox\WebCrawl\WebCrawl.Exe (32 bits)
Size: 2,043,904 bytes
Time from start: 0 hours 0 mins 14 secs
Error occurred at: 05/18/2011, 10:21:36
Error description: Error BASE/1071 Argument error: =
Args:
[ 1] = C Enter Keyword
[ 2] = N 130794
Stack Calls
===========
Called from: Vendor1.prg => (b)_VENDOR1(85)
Called from: Vendor1.prg => _VENDOR1(86)
The first variable seems to be the eval of the DOM element I wish to stuff :
[url=http://imageshack.us/photo/my-images/706/eval3.jpg/:3rrdsak8][img:3rrdsak8]http://img706.imageshack.us/img706/6695/eval3.jpg[/img:3rrdsak8][/url:3rrdsak8]
Here is the code .. modified slightly because cPARTS was included in the string and errored ..
[url=http://imageshack.us/photo/my-images/707/eval4.jpg/:3rrdsak8][img:3rrdsak8]http://img707.imageshack.us/img707/3067/eval4.jpg[/img:3rrdsak8][/url:3rrdsak8]
the IE: send variable was defined earlier
IE := CreateObject("InternetExplorer.Application")
Curious why you chose oMyIE as your eval variable ?
bSFD := &( "{ | oMyIE | oMyIE:"+cSFD+":Value = "+cPARTS+" }" )
Just curious .. I did a msginfo( bSFD ) and it returned this interesting value ..
[url=http://imageshack.us/photo/my-images/90/eval5.jpg/:3rrdsak8][img:3rrdsak8]http://img90.imageshack.us/img90/3199/eval5.jpg[/img:3rrdsak8][/url:3rrdsak8]
I think we are close ..
Rick Lipkin |
Concatenate a varible into a method call | I chose a different name for IE variable so it clearer which variable name has the focus.
If there is already a variable IE I did not want another local/block variable with the same name.
If cParts needs to be a string passed to :value then you need to add another set of quotes.
It might be more clear if you try it this way.
bSFD := &( [ { | IE | IE:]+cSFD+[:Value = "]+cPARTS+[" } ] ) |
Concatenate a varible into a method call | Gale
Your examples do run and compile .. but the code does not execute and plug in the value into the web form <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> .. Eval() does not seem to fire <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
*IE:document:forms:item(0):search:Value = cPARTS // this runs
bSFD := &( [ { | IE | IE:]+cSFD+[:Value = "]+cPARTS+[" } ] )
eval( bSFD, IE )
I really appreciate your insite !
Rick Lipkin |
Concatenate a varible into a method call | The scope on the variable IE might be wrong. Why don't you change the variable name IE to something else inside the block. |
Concatenate a varible into a method call | Gale
Here is a self contained example that is working .. The code opens IE and navigates to a web site .. inserts the part number 130794 into the search field then clickd the 'go' submit button .. notice the IE methods that do all the work.
Thanks
Rick Lipkin
[code=fw:30fkm6oh]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Rick.prg</span><br /><span style="color: #B900B9;">//</span><br /><br /><span style="color: #B900B9;">//-------------------------------</span><br />Func Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">LOCAL</span> cURL, cLB, cLD, cPD, cSBLD<br /><span style="color: #00C800;">LOCAL</span> cSFD, cSSBD<br /><span style="color: #00C800;">LOCAL</span> cPARTS, IE<br /><br /><span style="color: #00C800;">PRIVATE</span> cSUB1,cSUB2,cSUB3,cSUB4,cSUB5<br /><br /><span style="color: #B900B9;">//-- from table</span><br /><br />cURL := <span style="color: #ff0000;">"http://tewarehouse.com"</span><br />cSFD := <span style="color: #ff0000;">"document:forms:item(0):search"</span><br />cSSBD := <span style="color: #ff0000;">"document:all:go"</span><br />cPARTS := <span style="color: #ff0000;">"130794"</span><br /><br />IE:= CreateObject<span style="color: #000000;">(</span><span style="color: #ff0000;">"InternetExplorer.Application"</span><span style="color: #000000;">)</span><br /><br />*IE:<span style="color: #000000;">Visible</span> := .F.<br />IE:<span style="color: #000000;">Visible</span> := .t.<br />IE:<span style="color: #000000;">Navigate</span><span style="color: #000000;">(</span> cURL <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> IE:<span style="color: #000000;">Readystate</span> <> <span style="color: #000000;">4</span><br /> SysWait<span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Loop<br /><span style="color: #00C800;">Enddo</span><br /><br /><span style="color: #B900B9;">// "Inserting part number "+cPARTS</span><br /><br />IE:<span style="color: #000000;">document</span>:<span style="color: #000000;">forms</span>:<span style="color: #000000;">item</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span>:<span style="color: #000000;">search</span>:<span style="color: #000000;">Value</span> = cPARTS<br /><br /><span style="color: #B900B9;">/* THIS WORKS<br />cSub1 := "document"<br />cSub2 := "forms"<br />cSub3 := "item[0]"<br />cSub4 := "search"<br />cSub5 := "Value"<br /><br />IE:&cSub1:&cSub2:item(0):&cSub4:&cSub5 = cPARTS<br /><br />*/</span><br /><br /><span style="color: #B900B9;">/*<br />bSFD := &( [ { | IE | IE:]+cSFD+[:Value = "]+cPARTS+[" } ] )<br />eval( bSFD, IE )<br />*/</span><br /><span style="color: #B900B9;">/*<br />cSFD := "document:forms:item(0):search"<br />bSFD := &( "{ || IE:"+cSFD+":Value = cPARTS }" )<br />eval( bSFD )<br />*/</span><br /><br />SysWait<span style="color: #000000;">(</span><span style="color: #000000;">4</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// "Clicking Search button"</span><br /><br />IE:<span style="color: #000000;">document</span>:<span style="color: #000000;">all</span>:<span style="color: #000000;">go</span>:<span style="color: #0000ff;">Click</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />SysWait<span style="color: #000000;">(</span><span style="color: #000000;">4</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// end</span><br /><br /> </div>[/code:30fkm6oh] |
Concatenate a varible into a method call | Rick
your code working fine... only 1 tiny mistake
[code=fw:2zrl4put]<div class="fw" id="{CB}" style="font-family: monospace;">bSFD := &<span style="color: #000000;">(</span> <span style="color: #000000;">[</span> <span style="color: #000000;">{</span> | IE | IE:<span style="color: #000000;">]</span>+cSFD+<span style="color: #000000;">[</span>:<span style="color: #000000;">Value</span> := <span style="color: #ff0000;">"]+cPARTS+["</span> <span style="color: #000000;">}</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span></div>[/code:2zrl4put]
is inline assignment, you should use[size=150:2zrl4put][color=#FF0000:2zrl4put] [b:2zrl4put]:=[/b:2zrl4put][/color:2zrl4put][/size:2zrl4put] |
Concatenate a varible into a method call | Gale, Daniel
Thank you VERY much for your timely and resourceful answers !! Indeed the final piece of the puzzle was the inline assignment :
bSFD := &( [ { | IE | IE:]+cSFD+[:Value := "]+cPARTS+[" } ] )
eval( bSFD, IE )
Thank you both !!
Rick Lipkin |
Concatenate a varible into a method call ( new problem ) | Gale or Daniel
I am having difficulty once again creating a code block .. this time inserting a parameter into a method
//Here is the method line that works 'hard coded'
//IE:Document:Forms:oc:Item(x):GetAttribute("type")
cSSBD := "Document:Forms:oc"
cNode_name := "type"
bSSBD := &( [ { | IE | IE:]+cSSBD+[:length]+[ } ] )
nCOUNT := eval( bSSBD, IE ) // 9
[code=fw:424z18rl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">For</span> x=<span style="color: #000000;">0</span> <span style="color: #0000ff;">to</span> nCount<br /><br /> <span style="color: #00C800;">try</span><br /> *cRICK := IE:<span style="color: #000000;">Document</span>:<span style="color: #000000;">Forms</span>:<span style="color: #000000;">oc</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span>x<span style="color: #000000;">)</span>:<span style="color: #000000;">GetAttribute</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"type"</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// hard coded ok</span><br /> * bRICK := &<span style="color: #000000;">(</span> <span style="color: #000000;">[</span> <span style="color: #000000;">{</span> | IE | IE:<span style="color: #000000;">]</span>+cSSBD+<span style="color: #000000;">[</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span>x<span style="color: #000000;">)</span>:<span style="color: #000000;">GetAttribute</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"TYPE"</span><span style="color: #000000;">)</span><span style="color: #000000;">]</span>+<span style="color: #000000;">[</span> <span style="color: #000000;">}</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// works </span><br /> <span style="color: #B900B9;">// both fail below</span><br /> bRICK := &<span style="color: #000000;">(</span> <span style="color: #000000;">[</span> <span style="color: #000000;">{</span> | IE | IE:<span style="color: #000000;">]</span>+cSSBD+<span style="color: #000000;">[</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span>x<span style="color: #000000;">)</span>:<span style="color: #000000;">GetAttribute</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"]+cNode_name+[)"</span><span style="color: #000000;">]</span>+<span style="color: #000000;">[</span> <span style="color: #000000;">}</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> bRICK := &<span style="color: #000000;">(</span> <span style="color: #000000;">[</span> <span style="color: #000000;">{</span> | IE | IE:<span style="color: #000000;">]</span>+cSSBD+<span style="color: #000000;">[</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span>x<span style="color: #000000;">)</span>:<span style="color: #000000;">GetAttribute</span><span style="color: #000000;">(</span><span style="color: #000000;">]</span>+cNODE_NAME+<span style="color: #000000;">[</span><span style="color: #000000;">)</span><span style="color: #000000;">]</span>+<span style="color: #000000;">[</span> <span style="color: #000000;">}</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> cRICK := eval<span style="color: #000000;">(</span> bRICK, IE <span style="color: #000000;">)</span><br /> catch<br /> x++<br /> loop<br /> end <span style="color: #00C800;">try</span><br /><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> cRICK+str<span style="color: #000000;">(</span>x<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> lower<span style="color: #000000;">(</span> cRICK <span style="color: #000000;">)</span> = lower<span style="color: #000000;">(</span> cNODE_VALUE <span style="color: #000000;">)</span><br /> IE:<span style="color: #000000;">Document</span>:<span style="color: #000000;">Forms</span>:<span style="color: #000000;">oc</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span>x<span style="color: #000000;">)</span>:<span style="color: #0000ff;">Click</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// work on this</span><br /> lFOUND := .T.<br /> EXIT<br /> <span style="color: #00C800;">Endif</span><br /><br /><span style="color: #00C800;">Next</span><br /> </div>[/code:424z18rl]
I am having difficulty inserting cNode_name ("type") as a parameter into the GetAttribute( ) .. I keep getting cNode_name as undefined ??
I am sure I am just struggling with the correct syntax .. I would appreciate your help once again ..
Regards
Rick Lipkin |
Concatenate a varible into a method call ( new problem ) | One thing it looks like this line has error in the last quote location to make the macro correct.
bRICK := &( [ { | IE | IE:]+cSSBD+[:Item(x):GetAttribute("]+cNode_name+[)"]+[ } ] )
should be
bRICK := &( [ { | IE | IE:]+cSSBD+[:Item(x):GetAttribute("]+cNode_name+[")]+[ } ] ) |
Concatenate a varible into a method call ( new problem ) | Gale
Thank you .. your solution worked !
Appreciate your help
Rick Lipkin |
Concatenate two fields in one xBrowse Column | To All
I am trying to save space and was wondering if there is a way to concatenate two fields in one xBrowse Column. I have two dates .. startdate and enddate and would like to show them both in one column, one under the other as in the photo shopped screen below .. notice the Start End column, first row.
[url=http://imageshack.us/photo/my-images/811/7ytj.jpg/:17ssljok][img:17ssljok]http://img811.imageshack.us/img811/3998/7ytj.jpg[/img:17ssljok][/url:17ssljok]
I have tried this code but it does not work ..
[code=fw:17ssljok]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">// ad run in these publications</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbxC ;<br /> RECORDSET oRsAdvtBill ;<br /> COLUMNS <span style="color: #ff0000;">"PUBLICATIONNAME"</span>, ;<br /> <span style="color: #ff0000;">"STARTDATE"</span>+CRLF+<span style="color: #ff0000;">"ENDINGDATE"</span>, ;<br /> <span style="color: #ff0000;">"WEEK1"</span>, ;<br /> <span style="color: #ff0000;">"WEEK2"</span>, ;<br /> <span style="color: #ff0000;">"WEEK3"</span>, ;<br /> <span style="color: #ff0000;">"WEEK4"</span>, ;<br /> <span style="color: #ff0000;">"WEEK5"</span>, ;<br /> <span style="color: #ff0000;">"ACCOUNTEXECUTIVE"</span>, ;<br /> <span style="color: #ff0000;">"TOTALBILLED"</span> ;<br /> COLSIZES <span style="color: #000000;">57</span>,<span style="color: #000000;">70</span>,<span style="color: #000000;">26</span>,<span style="color: #000000;">26</span>,<span style="color: #000000;">26</span>,<span style="color: #000000;">26</span>,<span style="color: #000000;">26</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">75</span> ;<br /> HEADERS <span style="color: #ff0000;">"Publication"</span>, ;<br /> <span style="color: #ff0000;">"Start End"</span>, ;<br /> <span style="color: #ff0000;">"W1"</span>, ;<br /> <span style="color: #ff0000;">"W2"</span>, ;<br /> <span style="color: #ff0000;">"W3"</span>, ;<br /> <span style="color: #ff0000;">"W4"</span>, ;<br /> <span style="color: #ff0000;">"W5"</span>, ;<br /> <span style="color: #ff0000;">"AcctEx"</span>, ;<br /> <span style="color: #ff0000;">"Total Bill"</span> ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">273</span> <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br /> oLbxC:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> oLbxC:<span style="color: #000000;">lRecordSelector</span> := .f.<br /> oLbxC:<span style="color: #000000;">lHScroll</span> := .f. <span style="color: #B900B9;">// turn off horiz scroll bar</span><br /> oLbxC:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">47</span><br /> </div>[/code:17ssljok]
Any Advice would be appreciated.
Rick Lipkin |
Concatenate two fields in one xBrowse Column | Rick
You can do it, a code block for column definition { || STARTDATE+ ENDINGDATE }
then you will need to adapt the display of the column
something like
olbxc:aCols[2]:bPaintText := { |oCol, hDC, cText, aCoord| DrawText( oCol, hDC, cText, aCoord, TRANS, olbxc ) } // trans is a variable passed by my app
....
i join a sample of a function i use for drawing on several lines, hope it helps
Richard
[code=fw:ca6fwyfc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DrawText<span style="color: #000000;">(</span> oCol, hDC, cText, aCoord, TRANS, olbxc <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nTop := aCoord<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, nLeft := aCoord<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">local</span> nBottom := aCoord<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>, nRight := aCoord<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">local</span> nRow := nTop<br /> <span style="color: #00C800;">local</span> cLine, nFontHt, nAt<br /><br /> nAt := <span style="color: #00C800;">AT</span><span style="color: #000000;">(</span> CRLF, cText <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> nAt > <span style="color: #000000;">0</span><br /> cLine := <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> cText, nAt - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> TRANS<span style="color: #000000;">[</span><span style="color: #000000;">9</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span> <span style="color: #B900B9;">// font</span><br /><br /> nFontHt := GetTextHeight<span style="color: #000000;">(</span> oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">hWnd</span>, hDC <span style="color: #000000;">)</span><br /> SetTextColor<span style="color: #000000;">(</span> hDC, CLR_HRED <span style="color: #000000;">)</span><br /> DrawTextEx<span style="color: #000000;">(</span> hDC, cLine, <span style="color: #000000;">{</span> nRow, nLeft, nRow + nFontHt + <span style="color: #000000;">4</span>, nRight <span style="color: #000000;">}</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//oCol:nDataStyle )</span><br /> SetTextColor<span style="color: #000000;">(</span> hDC, LIGHTBLUE <span style="color: #000000;">)</span><br /> TRANS<span style="color: #000000;">[</span><span style="color: #000000;">9</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br /> nRow += nFontHt + <span style="color: #000000;">4</span><br /> cLine := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cText, nAt + <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> cLine := cText<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">IF</span> TRANS<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> = <span style="color: #000000;">4</span> <span style="color: #B900B9;">// Planning Matériel</span><br /> TRANS<span style="color: #000000;">[</span><span style="color: #000000;">9</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> TRANS<span style="color: #000000;">[</span><span style="color: #000000;">9</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> DrawTextEx<span style="color: #000000;">(</span> hDC, cLine, <span style="color: #000000;">{</span> nRow, nLeft, nBottom, nRight <span style="color: #000000;">}</span>, oCol:<span style="color: #000000;">nDataStyle</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> TRANS<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> = <span style="color: #000000;">4</span> <span style="color: #B900B9;">// Planning Matériel</span><br /> TRANS<span style="color: #000000;">[</span><span style="color: #000000;">9</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> TRANS<span style="color: #000000;">[</span><span style="color: #000000;">9</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:ca6fwyfc] |
Concatenate two fields in one xBrowse Column | Richard
Thank you for your quick response .. I inserted the codeblock just to see what output I would get and I don't think this is what was intended .. Let me know if I have done something wrong .. I thought I would at least get the two fields and then use your program to clean it up.
Rick Lipkin
[url=http://imageshack.us/photo/my-images/854/2mv1.jpg/:2fa6zbec][img:2fa6zbec]http://img854.imageshack.us/img854/5307/2mv1.jpg[/img:2fa6zbec][/url:2fa6zbec]
[code=fw:2fa6zbec]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// ad run in these publications</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbxC ;<br /> RECORDSET oRsAdvtBill ;<br /> COLUMNS <span style="color: #ff0000;">"PUBLICATIONNAME"</span>, ;<br /> <span style="color: #ff0000;">"{ || STARTDATE+ENDINGDATE }"</span>,;<br /> <span style="color: #ff0000;">"WEEK1"</span>, ;<br /> <span style="color: #ff0000;">"WEEK2"</span>, ;<br /> <span style="color: #ff0000;">"WEEK3"</span>, ;<br /> <span style="color: #ff0000;">"WEEK4"</span>, ;<br /> <span style="color: #ff0000;">"WEEK5"</span>, ;<br /> <span style="color: #ff0000;">"FREQUENCYID"</span>, ;<br /> <span style="color: #ff0000;">"ACCOUNTEXECUTIVE"</span>, ;<br /> <span style="color: #ff0000;">"TOTALBILLED"</span> ;<br /> COLSIZES <span style="color: #000000;">57</span>,<span style="color: #000000;">64</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">35</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">55</span> ;<br /> HEADERS <span style="color: #ff0000;">"Publication"</span>, ;<br /> <span style="color: #ff0000;">"Start Dt"</span>, ;<br /> <span style="color: #ff0000;">"w1"</span>, ;<br /> <span style="color: #ff0000;">"w2"</span>, ;<br /> <span style="color: #ff0000;">"w3"</span>, ;<br /> <span style="color: #ff0000;">"w4"</span>, ;<br /> <span style="color: #ff0000;">"w5"</span>, ;<br /> <span style="color: #ff0000;">"Freq"</span>, ;<br /> <span style="color: #ff0000;">"AcctEx"</span>, ;<br /> <span style="color: #ff0000;">"AmtBill"</span> ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">273</span> <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br /> oLbxC:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> oLbxC:<span style="color: #000000;">lRecordSelector</span> := .f.<br /> oLbxC:<span style="color: #000000;">lHScroll</span> := .f. <span style="color: #B900B9;">// turn off horiz scroll bar</span><br /> oLbxC:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">47</span><br /> </div>[/code:2fa6zbec] |
Concatenate two fields in one xBrowse Column | Rick
remove the quotes
{ || STARTDATE+ENDINGDATE }
Richard |
Concatenate two fields in one xBrowse Column | Richard
Sorry about the quotes .. I re-compiled but I did not get any data with this code <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> .. I am using Fwh1203 .. don't know if that has any bearing on the results.
Rick Lipkin
[code=fw:f4le0lm9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// ad run in these publications</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbxC ;<br /> RECORDSET oRsAdvtBill ;<br /> COLUMNS <span style="color: #ff0000;">"PUBLICATIONNAME"</span>, ;<br /> <span style="color: #000000;">{</span> || STARTDATE+ENDINGDATE <span style="color: #000000;">}</span>,;<br /> <span style="color: #ff0000;">"WEEK1"</span>, ;<br /> <span style="color: #ff0000;">"WEEK2"</span>, ;<br /> <span style="color: #ff0000;">"WEEK3"</span>, ;<br /> <span style="color: #ff0000;">"WEEK4"</span>, ;<br /> <span style="color: #ff0000;">"WEEK5"</span>, ;<br /> <span style="color: #ff0000;">"FREQUENCYID"</span>, ;<br /> <span style="color: #ff0000;">"ACCOUNTEXECUTIVE"</span>, ;<br /> <span style="color: #ff0000;">"TOTALBILLED"</span> ;<br /> COLSIZES <span style="color: #000000;">57</span>,<span style="color: #000000;">64</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">35</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">55</span> ;<br /> HEADERS <span style="color: #ff0000;">"Publication"</span>, ;<br /> <span style="color: #ff0000;">"Start Dt"</span>, ;<br /> <span style="color: #ff0000;">"w1"</span>, ;<br /> <span style="color: #ff0000;">"w2"</span>, ;<br /> <span style="color: #ff0000;">"w3"</span>, ;<br /> <span style="color: #ff0000;">"w4"</span>, ;<br /> <span style="color: #ff0000;">"w5"</span>, ;<br /> <span style="color: #ff0000;">"Freq"</span>, ;<br /> <span style="color: #ff0000;">"AcctEx"</span>, ;<br /> <span style="color: #ff0000;">"AmtBill"</span> ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">273</span> <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br /> oLbxC:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> oLbxC:<span style="color: #000000;">lRecordSelector</span> := .f.<br /> oLbxC:<span style="color: #000000;">lHScroll</span> := .f. <span style="color: #B900B9;">// turn off horiz scroll bar</span><br /> oLbxC:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">47</span><br /> </div>[/code:f4le0lm9]
[url=http://imageshack.us/photo/my-images/138/82zq.jpg/:f4le0lm9][img:f4le0lm9]http://img138.imageshack.us/img138/724/82zq.jpg[/img:f4le0lm9][/url:f4le0lm9] |
Concatenate two fields in one xBrowse Column | Rick
Maybe the version , nevertheless you can do it in another way by calling a function in the columns definition
instead of { || STARTDATE+ENDINGDATE }
{ || FUNC1() }
....
STATIC FUNCTION FUNC1()
RETURN STARTDATE + ENDINGDATE
This will work as i use it since very long time, after you may format with a small function.
Note i would try startdate + crlf + endingdate not tested
Hth
Richard |
Concatenate two fields in one xBrowse Column | Is startdate and endingdate fields a date type or character type.
You may need to convert them to character. { || ctod(startdate)+CRLF+ctod(endingdate) } |
Concatenate two fields in one xBrowse Column | Richard and Gale
Thank you both .. been a long day and I am headed home. I will let you both know in the morning ..
Happy New Year!
Rick Lipkin |
Concatenate two fields in one xBrowse Column | Sorry, should have been dtoc() not ctod() |
Concept of REDEFINE for Dummy | hi,
i do not know Technique of using *.RC and REDEFINE
"where" can i learn more about it how to use with Fivewin <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Concept of REDEFINE for Dummy | Dear Jimmy,
Please make a search for REDEFINE in FWH\samples\*.prg |
Concept of REDEFINE for Dummy | hi Antonio,
[quote="Antonio Linares":2iz62zut]Please make a search for REDEFINE in FWH\samples\*.prg[/quote:2iz62zut]
that is exact my "Problem"
i do "see" them but not "understand" what they are for and "how" it work e.g. ID
what is the benefit use use *.RC <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Concept of REDEFINE for Dummy | You create a RC file using a visual RC designer and then use it from your FWH app
You can use the one provided in Visual Studio Community, ResEdit, PellesC, etc there are many availables
You visually "draw" your screens instead of calculating coors by try and error... |
Concept of REDEFINE for Dummy | hi Antonio,
WOW, i did not know that Technique.
i did know 2-Way "Form-Designer" but they "generate Full Source" CODE but never think of *.RC
but how is *.PRG Part
will it "generate" too <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Concept of REDEFINE for Dummy | hi,
Question :
how does REDEFINE a "say" ("Static") when ID are 0xFFFF or -1 <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
[img:3nbu5qaq]https://i.postimg.cc/3wMFNxMP/Find-Replace.jpg[/img:3nbu5qaq] |
Concept of REDEFINE for Dummy | Jimmy:
It has to have an id other than -1 to be able to assign redefines
Change RC with an ID. |
Concept of REDEFINE for Dummy | The only problem we found in the use of this technique (dialog design in .RC) is the adaptation of these designs to screens of different resolutions.
But everything can be solved, with Fivewin, everything is possible. |
Concept of REDEFINE for Dummy | hi,
[quote="cmsoft":nm377mwu]It has to have an id other than -1 to be able to assign redefines
Change RC with an ID.[/quote:nm377mwu]
i can´t change ID while it is from Windows <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->
i use that "search/replace" Dialog which e.g. Notepad.EXE have
based on c:\fwh\source\classes\dlgfind.prg i found out that i can REDEFINE "Windows standard Common Dialog"
it have to do with (undocumented) Function RegDialog()
as i want to use "Dark-Mode" those "Common Control" are still "white" which i try to change
as you can "see" i can change some Color but those "Say" (wC_STATIC) have ID 0xFFFF or -1 ... <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
---
Question :
instead of
[code=fw:nm377mwu]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span></div>[/code:nm377mwu]
i have try
[code=fw:nm377mwu]<div class="fw" id="{CB}" style="font-family: monospace;"> REDEFIBE <span style="color: #0000ff;">BTNBMP</span></div>[/code:nm377mwu]
this seems to work but "Parent Window" seem not to get "Userdef Event" ...
i have try oWnd:SendMsg() or oWnd:PostMsg() but i got no Result
Question :
can i can change BUTTON to "something" else ? ( or is there a limitation IsKinof("BUTTON) in RegDialog() ... ) |
Concept of REDEFINE for Dummy | hi,
[quote="cnavarro":1n9h2to8]The only problem we found in the use of this technique (dialog design in .RC) is the adaptation of these designs to screens of different resolutions.[/quote:1n9h2to8]
i agree that these "old" Windows "Common Control" are made for Screen like VGA but much to small for FULL-HD
but i never know that i can REDEFINE Controls of those "Common Control"
my 1th Idea was to change Color for "Dark-Mode" ...
---
when REDEFINE i got hWnd in ::aControl so i can "paint it black"
but i need ID of Control for REDEFINE and each ID must be "unique" so i get only 1st "say"
Question
how to get hWnd of each Control in Dialog <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Concept of REDEFINE for Dummy | Dear Jimmy,
Try with TPanel as it is a very simple control |
Concept of REDEFINE for Dummy | Jimmy,
Some posts that can give some more info i think
<!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=34405&hilit=+resource">viewtopic.php?f=3&t=34405&hilit=+resource</a><!-- l -->
<!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=40651&hilit=+resource">viewtopic.php?f=3&t=40651&hilit=+resource</a><!-- l -->
<!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=34922&hilit=+resource">viewtopic.php?f=3&t=34922&hilit=+resource</a><!-- l --> |
Concept of REDEFINE for Dummy | hi Antonio,
[quote="Antonio Linares":2j41z2vt]Try with TPanel as it is a very simple control[/quote:2j41z2vt]
thx for Answer
i don´t want to create "new" Control.
i want to "modify" existing Windows "Common Control"
i´m testing REDEFINE and found out that i can get hWnd of existing "Common Control" when have Resource ID
but for "Say" i got only 0xFFF or IDC_STATIC (-1) so i can´t get hWnd
that´s why i ask
how to get hWnd of each Control in Dialog <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Concept of REDEFINE for Dummy | hi,
it seem that REDEFINE does only work with FINDTEXT() as it return a Handle
[code=fw:bjqmoh7h]<div class="fw" id="{CB}" style="font-family: monospace;"> hdlg = FindText<span style="color: #000000;">(</span>&fr<span style="color: #000000;">)</span>;</div>[/code:bjqmoh7h]
[url:bjqmoh7h]https://learn.microsoft.com/de-de/windows/win32/dlgbox/using-common-dialog-boxes?redirectedfrom=MSDN[/url:bjqmoh7h]
other like
[code=fw:bjqmoh7h]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>ChooseColor<span style="color: #000000;">(</span>&cc<span style="color: #000000;">)</span>==<span style="color: #00C800;">TRUE</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>ChooseFont<span style="color: #000000;">(</span>&cf<span style="color: #000000;">)</span>==<span style="color: #00C800;">TRUE</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>GetOpenFileName<span style="color: #000000;">(</span>&ofn<span style="color: #000000;">)</span>==<span style="color: #00C800;">TRUE</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>PrintDlg<span style="color: #000000;">(</span>&pd<span style="color: #000000;">)</span>==<span style="color: #00C800;">TRUE</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>PageSetupDlg<span style="color: #000000;">(</span>&psd<span style="color: #000000;">)</span>==<span style="color: #00C800;">TRUE</span><span style="color: #000000;">)</span></div>[/code:bjqmoh7h]
seems not return Handle
so that Way is a "dead end" trying "Dark-Mode" |
Concepto del ERP y propuesta para crear un FIVE-ERP | Saludos cordiales.
Soy Juan Navas, creador de AdaptaPro, tengo 27 años desarrollando aplicaciones comerciales, hace más de 10 años decidimos crear un sistema de concepto ERP, logramos crear una solución para uso propio que nos permitía conocer todas las actividades o compromisos de la empresa en forma de semáforo, esto nos llevó a gestionar nuestra empresa bajo los fundamentos de la gerencia: Planificación, Dirección, Supervisión y evaluación.
Hemos estado conversando con Antonio Linares para crear un nuevo producto comercial ERP de código Abierto con muchas funcionalidades predefinidas donde podamos concretar en cada país a un socio representante que pueda adaptarlo a los tributos y exigencias formales en cada país. El negocio se fundamenta en cuatro pilares:
1. Tecnologías (todos lo referente al binario o kernel de la aplicación)
2. Conceptualización (Como se vende, implementa y utiliza un ERP), herramienta para empresarios y luego para usuarios que deben trabajar mediante tareas indicadas por el ERP.
3. Comercialización o Agentes de Ventas.
4. Prestación de Servicios mediante proyectos de implementación. Un ERP debe ser utilizado en modo de producción (Planificación de todas las actividades de los usuarios, certificación de resultados y capacitación de usuarios y asesorías permanentes). Contamos con un sistema de gestión de proyectos para uso nuestro y para comercialización.
Mi página Web, actualmente está en rediseño mediante gestor de contenidos y plantillas, nuestras aplicaciones están siendo adaptadas hacia las NIFF (Normas internaciones de Información Financiera) y NIC (Normas internacionales de contabilidad) que nos permitiré ser implementado con facilidad de ser implementado en cualquier país que adopte estas normas.
Estamos en la búsqueda de socios para el desarrollo y comercialización de esta herramienta en cada país. Agradezco cualquier comentario o propuesta para presentar un nuevo ERP.
Actualmente estamos creando video en youtube de presentación del concepto ERP de AdaptaPro . Nuestro ERP será la referencia de experiencia y planteo rediseñar un nuevo modelo ERP.
Porque llegamos a crear un ERP: Precedenctes.
Juan Navas “Creador de DataPro y AdaptaPro”, recopiló más de 20 años de experiencia siendo director y/o accionista de diversas firmas jurídicas dedicadas la actividad comercial “AdaptaPro”, gracias la responsabilidad legal, diseño un modelo de sistema proactivo basado en la planificación en las soluciones en diversas áreas: Tributario, Proyectos, Gestión de Clientes o (CRM) Finanzas, Laboral y demás deberes formales. La experiencia directa en AdaptaPro y experiencia obtenida en miles de implementaciones fue la materia prima para gestar un modelo de solución empresarial de alcance “ERP”, donde la gestión de la empresa se realiza mediante previa planificación y medidores de gestión para conocer las actividades: Realizadas en su debido momento, las actividades no realizadas en la fecha establecida y las actividades por realizar. Además el concepto logra evitar de manera proactiva las omisiones o incumplimientos causados por el factor humano: La memorización, discrecionalidad, desconocimiento y la disposición.
El concepto o filosofía del ERP está en la manera de realizar las transacciones o actividades del usuario, en un ERP el usuario de tesorería es informado mediante un formulario de actividades todas las actividades o tareas que debe realizar: Calcular y Pagar Impuestos, Servicios de electricidad, teléfonos, nóminas, entre otros. En cambio un sistema para la administración es discrecional, el usuario es quien decide las actividades que va a realizar y luego las registra en el sistema para luego generar listados o informes.
Aspectos tecnológicos:
Debe estar basado en el modelo de bases de datos relaciones (RDBMS), todas las aplicaciones deben utilizar la misma base de datos sin procesos de integración ni redundancia de datos.
Arquitectura Abierta: Mediante el concepto de diccionario de datos o Metadatos “todas las tablas podrán ser adaptadas según la necesidad del cliente”.
Código fuente abierta o disponible: Todos los programas que generan las transacciones financieras podrá estar disponible para que el usuario las adapte a sus necesidades o país. En nuestro caso hemos utilizado FIVESCRIPT adaptado a nuestro criterio, y programas (PRG) precompilados en modulos HRB
Programa DPXBASE
// Programa : DPCONTENIDOS
// Fecha/Hora : 14/12/2014 23:06:29
// Propósito : Incluir/Modificar DPCONTENIDOS
// Creado Por : DpXbase
// Llamado por: DPCONTENIDOS.LBX
// Aplicación : Administración del Sistema
// Tabla : DPCONTENIDOS
#INCLUDE "DPXBASE.CH"
#INCLUDE "TSBUTTON.CH"
#INCLUDE "IMAGE.CH"
FUNCTION DPCONTENIDOS(nOption,nId)
LOCAL oBtn,oTable,oGet,oFont,oFontB,oFontG
LOCAL cTitle,cSql,cFile,cExcluye:=""
LOCAL nClrText
LOCAL cTitle:="Gestión de Contenidos"
cExcluye:="CON_ID,;
CON_CODIGO,;
CON_ACTIVO"
DEFAULT nID :=SQLGET("DPCONTENIDOS","CON_ID"),;
nOption:=1
DEFINE FONT oFont NAME "Verdana" SIZE 0, -10 BOLD
DEFINE FONT oFontB NAME "Arial" SIZE 0, -12 BOLD ITALIC
DEFINE FONT oFontG NAME "Arial" SIZE 0, -11
nClrText:=10485760 // Color del texto
IF nOption=1 // Incluir
cSql :=[SELECT * FROM DPCONTENIDOS WHERE ]+BuildConcat("CON_ID")+GetWhere("=",nID)+[]
cTitle :=" Incluir {oDp:DPCONTENIDOS}"
ELSE // Modificar o Consultar
cSql :=[SELECT * FROM DPCONTENIDOS WHERE ]+BuildConcat("CON_ID")+GetWhere("=",nID)+[]
cTitle :=IIF(nOption=2,"Consultar","Modificar")+" Gestión de Contenidos "
cTitle :=IIF(nOption=2,"Consultar","Modificar")+" {oDp:DPCONTENIDOS}"
ENDIF
oTable :=OpenTable(cSql,"WHERE"$cSql) // nOption!=1)
IF nOption=1 .AND. oTable:RecCount()=0 // Genera Cursor Vacio
oTable:End()
cSql :=[SELECT * FROM DPCONTENIDOS]
oTable :=OpenTable(cSql,.F.) // nOption!=1)
ENDIF
oTable:cPrimary:="CON_ID" // Clave de Validación de Registro
oCONTENIDOS:=DPEDIT():New(cTitle,"DPCONTENIDOS.edt","oCONTENIDOS" , .F. )
oCONTENIDOS:nOption :=nOption
oCONTENIDOS:SetTable( oTable , .F. ) // Asocia la tabla <cTabla> con el formulario oCONTENIDOS
oCONTENIDOS:SetScript() // Asigna Funciones DpXbase como Metodos de oCONTENIDOS
oCONTENIDOS:SetDefault() // Asume valores standar por Defecto, CANCEL,PRESAVE,POSTSAVE,ORDERBY
oCONTENIDOS:nClrPane:=oDp:nGris
IF oCONTENIDOS:nOption=1 // Incluir en caso de ser Incremental
// oCONTENIDOS:RepeatGet(NIL,"CON_ID") // Repetir Valores
oCONTENIDOS:CON_ID :=oCONTENIDOS:Incremental("CON_ID ",.F.)
ENDIF
//Tablas Relacionadas con los Controles del Formulario
oCONTENIDOS:CreateWindow() // Presenta la Ventana
// Opciones del Formulario
//
// Campo : CON_ID
// Uso : Id del Registro
//
@ 3.0, 1.0 SAY oCONTENIDOS:oCON_ID VAR oCONTENIDOS:CON_ID ;
BORDER ;
FONT oFontG;
SIZE 16,10;
RIGHT
@ oCONTENIDOS:oCON_ID :nTop-08,oCONTENIDOS:oCON_ID :nLeft SAY "Id del Registro" PIXEL;
SIZE NIL,7 FONT oFont COLOR nClrText,15724527
//
// Campo : CON_CODIGO
// Uso : Contenido
//
@ 4.8, 1.0 GET oCONTENIDOS:oCON_CODIGO VAR oCONTENIDOS:CON_CODIGO VALID !VACIO(oCONTENIDOS:CON_CODIGO,NIL);
WHEN (AccessField("DPCONTENIDOS","CON_CODIGO",oCONTENIDOS:nOption);
.AND. oCONTENIDOS:nOption!=0);
FONT oFontG;
SIZE 320,10
oCONTENIDOS:oCON_CODIGO:cMsg :="Contenido"
oCONTENIDOS:oCON_CODIGO:cToolTip:="Contenido"
@ oCONTENIDOS:oCON_CODIGO:nTop-08,oCONTENIDOS:oCON_CODIGO:nLeft SAY "Contenido" PIXEL;
SIZE NIL,7 FONT oFont COLOR nClrText,15724527
//
// Campo : CON_ACTIVO
// Uso : Activo
//
@ 6.6, 1.0 CHECKBOX oCONTENIDOS:oCON_ACTIVO VAR oCONTENIDOS:CON_ACTIVO PROMPT ANSITOOEM("Activo");
WHEN (AccessField("DPCONTENIDOS","CON_ACTIVO",oCONTENIDOS:nOption);
.AND. oCONTENIDOS:nOption!=0);
FONT oFont COLOR nClrText,NIL SIZE 76,10;
SIZE 4,10
oCONTENIDOS:oCON_ACTIVO:cMsg :="Activo"
oCONTENIDOS:oCON_ACTIVO:cToolTip:="Activo"
oCONTENIDOS:Activate({||oCONTENIDOS:ViewDatBar()})
STORE NIL TO oTable,oGet,oFont,oGetB,oFontG
RETURN oCONTENIDOS
/*
// Barra de Botones
*/
FUNCTION ViewDatBar()
LOCAL oCursor,oBar,oBtn
LOCAL oDlg:=oCONTENIDOS:oDlg
DEFINE CURSOR oCursor HAND
DEFINE BUTTONBAR oBar SIZE 52-15,60-15 OF oDlg 3D CURSOR oCursor
IF oCONTENIDOS:nOption=2
DEFINE BUTTON oBtn;
OF oBar;
NOBORDER;
FONT oFont;
FILENAME "BITMAPS\\XSALIR.BMP";
ACTION (oCONTENIDOS:Close())
oBtn:cToolTip:="Salir"
ELSE
DEFINE BUTTON oBtn;
OF oBar;
NOBORDER;
FONT oFont;
FILENAME "BITMAPS\\XSAVE.BMP";
ACTION (oCONTENIDOS:Save())
oBtn:cToolTip:="Grabar"
DEFINE BUTTON oBtn;
OF oBar;
FONT oFont;
NOBORDER;
FILENAME "BITMAPS\\XCANCEL.BMP";
ACTION (oCONTENIDOS:Cancel()) CANCEL
oBtn:cToolTip:="Cancelar"
ENDIF
oBar:SetColor(CLR_BLACK,15724527)
AEVAL(oBar:aControls,{|o,n|o:SetColor(CLR_BLACK,15724527)})
RETURN .T.
/*
// Carga de Datos, para Incluir
*/
FUNCTION LOAD()
IF oCONTENIDOS:nOption=1 // Incluir en caso de ser Incremental
oCONTENIDOS:CON_ID :=oCONTENIDOS:Incremental("CON_ID ",.F.)
ENDIF
RETURN .T.
/*
// Ejecuta Cancelar
*/
FUNCTION CANCEL()
RETURN .T.
/*
// Ejecución PreGrabar
*/
FUNCTION PRESAVE()
LOCAL lResp:=.T.
lResp:=oCONTENIDOS:ValUnique(oCONTENIDOS:CON_ID )
IF !lResp
MsgAlert("Registro "+CTOO(oCONTENIDOS:CON_ID),"Ya Existe")
ENDIF
RETURN lResp
/*
// Ejecución despues de Grabar
*/
FUNCTION POSTSAVE()
EJECUTAR("DPCNTMNU",oCONTENIDOS:CON_ID)
RETURN .T.
/*
<LISTA:CON_ID:Y:SAY:Y:N:Y:Id del Registro,CON_CODIGO:N:GET:N:N:N:Contenido,CON_ACTIVO:N:CHECKBOX:N:N:Y:Activo>
*/ |
Concepto del ERP y propuesta para crear un FIVE-ERP | Juan,
Gracias por compatir tu experiencia y tus ideas con nosotros <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Concepto del ERP y propuesta para crear un FIVE-ERP | Antonio
Gracias, deseo publicar experiencia o practicas de un ERP
[b:2r8ynbou]Podemos citar el siguiente caso de gestión en un ERP dotado de CRP y RMA:[/b:2r8ynbou]
Una empresa o tienda que vende equipos electrónicos (TV, Portátiles, Tablas entre otros) comprados a un importador o representante de (x) marcas, realiza la venta de un TV a un cliente con garantía de 6 meses por parte del importador. El cliente a los tres meses reporta una avería o desperfecto al vendedor “Tienda”.
Si la tienda o vendedor no ha contemplado en su implementación o adquisición de licencias de software (ERP) el procedimiento protocolar para gestionar un reclamo del cliente, la actividad o gestión de los reclamos será gestionada de manera “perceptiva o discrecional por parte de la persona que recibió el reclamo”- Posiblemente gestione la solución con el cliente mediante llamadas o envió de correos entre el importador (Proveedor) y comprador (cliente) sin registros electrónicos o en bases de datos de la gestión realizada.
Cuando se utiliza una herramienta ERP, esta actividad se soluciona de la siguiente manera:
1. Se implementa un sistema de reclamos o gestión de clientes bien sea mediante (CRM) o (RMA) según sea el caso.
2. Se capacitan a los usuarios para gestionar de manera formal el reclamo del cliente y se certifican todos los procesos y resultados.
3. Todo reclamo se registra directamente en la ficha o registro de cliente mediante el registro de la factura de venta y producto vendido. El registro genera tareas mediante registros indicando el departamento y/o personas involucradas. El jefe de reclamos cuando ingresa al sistema es notificado “Automáticamente” de todos los reclamos que debe gestionar con el proveedor. Según sea el caso, registra en la tabla de expediéntenles del proveedor las gestiones que debe realizar para resolver el reclamo del cliente hasta lograr que el producto vendido sea reparado o reemplazado según sea el caso.
4. La gerencia podrá conocer de manera proactiva: La cantidad de reclamos, reclamos en desarrollo, reclamos resueltos antes de la fecha pautada, los reclamos resueltos luego de la fecha pautada, logrando así conocer los niveles de eficiencia en cada departamento o trabajador (Usuario).
5. Quedan registrados en la base de datos todos los procedimientos realizando por la empresa vendedores de las actividades o gestiones para lograr la satisfacción del cliente.
6. Si el personal que gestiona las actividades de gestión del cliente decide no trabajar más en la tienda o vendedor, los propietarios puedes asignar las tareas al personal que lo reemplaza.
7. En caso que el comprador acuda a instancias legales, el vendedor cuenta con argumentos de gestión utilizando para resolver en feliz términos el reclamo solicitado por el comprador. |
Concepto del ERP y propuesta para crear un FIVE-ERP | Buenas
Ideas.
Hablando a nivel técnico, no de negocio.
Hoy en dia, teniendo Harbour la posiblidad de compilar codigo, más que Script, se podría hacer que cada llamada haga un hbmk2 del prg, para generar un hrb,si se ha producido un cambio, y este
sea cargado en memoria. El ERP debería tener harbour en una carperta para esta tarea.
Esto nos da la misma flexibilidad que el Script, pero MUCHO más rápido en su ejecución.
Como a mi me gusta mostrar las palabras en codigo, este es un fichero de parches que he diseñado como prueba de concepto, teniendo ya el HRB compilado ;
[code=fw:14mopz7m]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><br /> <span style="color: #00C800;">STATIC</span> s_parches_off <span style="color: #B900B9;">// patches que NO queremos que se carguen</span><br /> <span style="color: #00C800;">STATIC</span> s_parches_on <span style="color: #B900B9;">// patches que se cargan desde \PATCH\</span><br /><br /> MEMVAR P__pointer_patch<br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// No se si es por Harbour o no, pero la visibilidad de la variable afecta al modulo donde se ejecuta.</span><br /> <span style="color: #B900B9;">// Por lo tanto, declarandola PUBLIC, la visibilidad del HRB es global a la aplicacion</span><br /> <span style="color: #00C800;">PUBLIC</span> P__pointer_patch := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span> <span style="color: #B900B9;">// Punteros a HRB</span><br /> HSETCASEMATCH<span style="color: #000000;">(</span> P__pointer_patch, .F. <span style="color: #000000;">)</span><br /><br /> set_parches_off<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// Informa que parches no queremos que se carguen en el sistema</span><br /> load_Patch<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// Carga todos los parches de la ruta PATCH</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /> <span style="color: #00C800;">function</span> Load_Patch<span style="color: #000000;">(</span> cRuta <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> cPath_Patch<br /> <span style="color: #00C800;">Local</span> cDirectory_patch := <span style="color: #ff0000;">"PATCH"</span><br /> <span style="color: #00C800;">Local</span> aPatchs<br /> <span style="color: #00C800;">Local</span> cCurPath, aFile<br /> <span style="color: #00C800;">Local</span> l, p<br /><br /> s_parches_on := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> hb_default<span style="color: #000000;">(</span> @cRuta, hb_CurDrive<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + hb_osDriveSeparator<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + hb_ps<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span> )<br /><br /> cPath_Patch:= cRuta + cDirectory_patch +"</span>\<span style="color: #ff0000;">"<br /> aPatchs := Directory( cPath_Patch + "</span>*.hrb<span style="color: #ff0000;">") <br /><br /> for each aFile in aPatchs<br /> lHacer := .T.<br /> aeval( s_parches_off ,{|x| if( UPPER( x ) == UPPER( aFile[1] ), lHacer := .F. , ) } )<br /> if lHacer<br /> P__pointer_patch[ aFile[1] ] := hb_hrbLoad( HB_HRB_BIND_OVERLOAD , cPath_Patch + aFile[1] )<br /> // ? "</span>Cargando...<span style="color: #ff0000;">" + aFile[1] <br /> AADD( s_parches_on, {aFile[1]} )<br /> endif <br /> next <br /><br />return nil<br /><br />// Determina que los ficheros PARCHE1.HRB y PARCHE2.HRB no se van a cargar en el sistema<br />// Esto puede ser, porque la nueva versión del EXE, ya tiene corregido esa funcionalidad, y no es necesario cargarlo.<br />function set_parches_off()<br />return s_parches_off := { "</span>PARCHE1.HRB<span style="color: #ff0000;">", "</span>PARCHE2.HRB <span style="color: #000000;">}</span><br /><br /> </div>[/code:14mopz7m]
¿ Crees que esta es una solución plausible para el sistema ERP?
Saludos |
Concepto del ERP y propuesta para crear un FIVE-ERP | Thefull
Gracias por tu respuesta.
Actualmente harbour tiene funcionalidad de compilar y ejecutar un programa PRG en un modulo HRB gracias a que el compildor forma parte del binario final. Ya no es necesario crear modulos HRB desde ejecuciones externas.
Nuestra aplicacion fue creada hace 10 años y para ese entonces no estaba el compilador incluido en el binario final. Actualmente estamos recompilando nuestras aplicaciones con todas las mejoras de FiveWin y los avances de Harbour. El uso de scripts ya no es necesario gracias a las funcionalidades incluidas en harbour. |
Concepto del ERP y propuesta para crear un FIVE-ERP | The full
de errata:
Gracias por tu respuesta
por
Gracias por pregunta, cualquier duda estamos atentos. |
Concepto del ERP y propuesta para crear un FIVE-ERP | Thefull
Interesante el codigo fuente que has publicado.
te explico nuestra experiencia sobre el ERP.
El codigo fuente para los ERP estan enfocados en aspectos financieros del negocio, las miles de implementaciones que hemos realizado se basan en adaptar procesos del negocio y para facilitar el trabajo de los desarrolladores hemos creados diversas clases :
1. Formularios con methods combinados con programas (UDF) predefinidas : LOAD, SAVE, AFTERSAVE, POSTSAVE, AFTERDELETE, POSTDELETE..No requiere el uso e recursos y el usuario puede personalizar ubicacion fuente y colores de cada control.
2. Generador de codigo fuente para formularios y reportes partiendo de una tabla con sus vinculos (Mediante diccionario de datos)
3. Documento con Grids (Mediante Xbrowse.
4. Las implementaciones con elementos tecnicos han sido con impresoras fiscales y algunas funciones (UDF) que desea implementar el integrador.
5. En nuestro ERP no utilizamos variables estaticas, contamos con una objeto unico de variable publica que contiene todas las variables unicas del sistema y se peuden agregar mas classdata de manera dinámica. Si las nuevas funcionalidades de harbour nos permiten utilizar variables estaticas en un programa HRB y la circunstancia los amerita sera implementada.
6. Desarrollar en un modelo ERP requiere seguir reglas de desarrollo. |
Concepto del ERP y propuesta para crear un FIVE-ERP | Thefull
Aprovechando tu pregunta y codigo publicado, te explico:
1. Un ERP no debe pretender ser una ambiente unico de desarrollo para un cliente. Su concepto o arquitectura debe permitir agregar nuevas opciones y/o funcionalidades. como por ejemplo: Ejecutar un programa binario externo o llamar a un enlace de un sitio Web.
2. Los procesos abiertos o (Programas fuentes del ERP) estan enfocados en los procesos financieros principalmente.
3. Si el integrador que desarrolla la implementacion requiere hacer algunos programas binarios en cualquier herramienta de desarrollo es totalmente valida, dede cumplir con la flexibilidad del diccionario de datos y utilizar la misma base de datos. Mi recomendacion es contratar con el cliente la entrega de los programas fuentes y formalizar su mantenimiento para los casos de futuras versiones o en caso se concluya la relacion comercial el cliente pueda optar por opciones de continuidad. |
Condicionar linea en Treport | Hola a todos
¿Es posible condicionar una línea en un Report de tal manera que salga o no salga dada la condición?
Me explico, he intentado poner esto en una línea,
[code=fw:1u8k0kj5]<div class="fw" id="{CB}" style="font-family: monospace;"> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"BASE IMP."</span> ;<br /> <span style="color: #00C800;">DATA</span> FIVA->BASE1 , <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>FIVA->BASE2 <> <span style="color: #000000;">0</span>,FIVA->BASE2,<span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99,999.99"</span>;<br /> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">1</span> ;<br /> GRID <span style="color: #000000;">1</span></div>[/code:1u8k0kj5]
quería que la segunda línea la escribiera o no, en función si es cero, pero la línea me la pone con un nil, si le pongo al final unas comillas, me escribe una línea en blanco.
¿Hay alguna manera de que no escriba esa línea? |
Condicionar linea en Treport | Pedro,
[code=fw:2db5h656]<div class="fw" id="{CB}" style="font-family: monospace;"> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"BASE IMP."</span> ;<br /> <span style="color: #00C800;">DATA</span> FIVA->BASE1 , <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>FIVA->BASE2 <> <span style="color: #000000;">0</span>,FIVA->BASE2, oReport:<span style="color: #000000;">BackLine</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99,999.99"</span>;<br /> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">1</span> ;<br /> GRID <span style="color: #000000;">1</span></div>[/code:2db5h656]
Ojalá y te sirva.
saludos |
Condicionar linea en Treport | Funcionó, muchas gracias william |
Condicionar linea en Treport | [quote="Pedro":2g4vkh02]Funcionó, muchas gracias william[/quote:2g4vkh02]
Lo del césar al César.
Es obra del maestro de TReport.
soidito. |
Condiciones en el listbox | Hola Fivewineros, como estan pues, necesito la ayuda de ustedes, que creo haberlo visto una vez en este foro una imagen con el listbox, con su respectiba condicion de colores no recuerdo de quien fue el que proporciono la rutina o funcion, el caso es que quiero implementarlo en mi programa como muestra en este ejemplo con el listbox, con diferentes colores que cumplan la condicion x Tasa para cada x articulo y asi sucesibamente y se que si se puede, yo no logro dar con mis resultados, alguien me podra echar la mano , por favor se los agradecere mucho
Clave Descripcion Tasa
25 x articulo 10 amarillo
25 x articulo 10 amarillo
25 x articulo 10 amarillo
32 x articulo 15 verde
32 x articulo 15 verde
32 x articulo 15 verde
24 x articulo 0 rojo
24 x articulo 0 rojo
24 x articulo 0 rojo
mas......
Espero su ayuda y la colaboracion de ustedes amigos fivewineros y un millon de gracias con el codigo o ejemplo para implementarlo en mi programa.
Su amiga Susy
<!-- e --><a href="mailto:susan_mx@hotmail.com">susan_mx@hotmail.com</a><!-- e --> |
Condiciones en el listbox | Susy:
Yo utilizo TWbrowse del master HDC y lo hago así
.....
.....
oLbx:bBkColor := {|nRow,nCol,nStyle| BackColor(nCol,nStyle)}
oLbx:bTextColor := {|nRow,nCol,nStyle| ForeColor(nCol,nStyle)}
.....
.....
STATIC FUNCTION BackColor(nCol,nStyle)
DO CASE
CASE nCol == 7
IF nStyle == 0 .AND. (cMaterial)->MAT_SEU < (cMaterial)->MAT_MDK
RETURN(CLR_GREEN)
ELSE
RETURN(NIL)
ENDIF
.....
.....
.....
En esta función te pongo solo una parte pues mi código es extenso pero con este pequeño ejemplo podras colorear cada una de las columnas, por cierto; la función ForeColor() es exactamente igual.
Saludos |
Condiciones en el listbox | [quote="Armando":1qgf0p43]Susy:
Yo utilizo TWbrowse del master HDC y lo hago así
.....
.....
oLbx:bBkColor := {|nRow,nCol,nStyle| BackColor(nCol,nStyle)}
oLbx:bTextColor := {|nRow,nCol,nStyle| ForeColor(nCol,nStyle)}
.....
.....
STATIC FUNCTION BackColor(nCol,nStyle)
DO CASE
CASE nCol == 7
IF nStyle == 0 .AND. (cMaterial)->MAT_SEU < (cMaterial)->MAT_MDK
RETURN(CLR_GREEN)
ELSE
RETURN(NIL)
ENDIF
.....
.....
.....
En esta función te pongo solo una parte pues mi código es extenso pero con este pequeño ejemplo podras colorear cada una de las columnas, por cierto; la función ForeColor() es exactamente igual.
Gracias corazon pues es lo mas simple que pude haverlo echo antes?, y si fuera algo mas complejo alguna rutina o mas sugerencias de los fivewineros, gracias corazon se agradece si alguien mas tiene mas complejidad en los colores de listbox aplicando condiciones de criterio para colorear celdas
Su amiga Susy
<!-- e --><a href="mailto:susan_mx@hotmail.com">susan_mx@hotmail.com</a><!-- e -->
Saludos[/quote:1qgf0p43] |
Condiciones en el listbox | [quote="Armando":y3cbaeky]Susy:
Yo utilizo TWbrowse del master HDC y lo hago así
.....
.....
oLbx:bBkColor := {|nRow,nCol,nStyle| BackColor(nCol,nStyle)}
oLbx:bTextColor := {|nRow,nCol,nStyle| ForeColor(nCol,nStyle)}
.....
.....
STATIC FUNCTION BackColor(nCol,nStyle)
DO CASE
CASE nCol == 7
IF nStyle == 0 .AND. (cMaterial)->MAT_SEU < (cMaterial)->MAT_MDK
RETURN(CLR_GREEN)
ELSE
RETURN(NIL)
ENDIF
.....
.....
.....
En esta función te pongo solo una parte pues mi código es extenso pero con este pequeño ejemplo podras colorear cada una de las columnas, por cierto; la función ForeColor() es exactamente igual.
Gracias corazon pues es lo mas simple que pude haverlo echo antes?, y si fuera algo mas complejo alguna rutina o mas sugerencias de los fivewineros, gracias corazon se agradece si alguien mas tiene mas complejidad en los colores de listbox aplicando condiciones de criterio para colorear celdas
Su amiga Susy
<!-- e --><a href="mailto:susan_mx@hotmail.com">susan_mx@hotmail.com</a><!-- e -->
Saludos[/quote:y3cbaeky] |
Condición de Get | Amigos, tengo un get que de acuerdo a una condición el valid puede ser verdadero o falso. También en ese mismo dialogo tengo un botón ( La clase BtnBmp ) que cierra dicho dialogo, esto no funciona cuando la validación del Get es falsa. Sé que existe un método para que este botón funcione a pesar de la validación del Get. Alguien sabe? desde ya muchas gracias |
Condición de Get | Para BTNBMP:
[code=fw:27tefhix]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oBtn:<span style="color: #000000;">lCancel</span> := .T.<br /> </div>[/code:27tefhix]
valid puede ser verdadero o falso. No comprendo. Muestre VIA CÓDIGO, porfa.
Regards, saludos. |
Condición de Get | Hola, gracias por responder pero tu solución no funciona.
Saludos |
Condición de Get | Con la clase tbutton si funciona |
Condición de Get | Estuve mirando la clase btnbmp y lCancel no existe como data |
Condición de Get | [quote="horacio":3d4i3o0d]Estuve mirando la clase btnbmp y lCancel no existe como data[/quote:3d4i3o0d]
Horácio, prueba esto, por favor.
[code=fw:3d4i3o0d]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\FWH..\SAMPLES\HORACIO.PRG</span><br /><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg , oMenuPop, oBtn1, oBtn2, <span style="color: #0000ff;">MENU</span>, oFont, aGrad, cTitle<br /> <span style="color: #00C800;">LOCAL</span> nColor1 := CLR_BLACK<br /> <span style="color: #00C800;">LOCAL</span> nColor2 := CLR_WHITE<br /><br /> SET _3DLOOK <span style="color: #0000ff;">ON</span><br /><br /> SetBalloon<span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /><br /> SkinButtons<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MENU</span> oMenuPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br /><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"First "</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"first"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">SEPARATOR</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Second "</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"second"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">SEPARATOR</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Colores"</span> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> PicKColors<span style="color: #000000;">(</span> oBtn1, oDlg,, <span style="color: #ff0000;">"gray"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> aGrad := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.30</span>, CLR_WHITE, CLR_HCYAN <span style="color: #000000;">}</span>,<span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>, CLR_WHITE, CLR_HCYAN <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> cTiTle := <span style="color: #ff0000;">"Números de la paleta de colores: Horacio."</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Ms Sans Serif"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">00</span>, <span style="color: #000000;">-16</span> BOLD<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL RESIZABLE ;<br /> <span style="color: #0000ff;">TITLE</span> cTitle GRADIENT aGrad <span style="color: #0000ff;">FONT</span> oFont<br /><br /> oDlg:<span style="color: #000000;">lhelpIcon</span> := .F.<br /><br /> @ <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">BTNBMP</span> oBtn1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT NOBORDER ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Color"</span> FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>loppy.bmp"</span> BOTTOM ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_HBLUE, CLR_BLACK <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> PicKColors<span style="color: #000000;">(</span> oBtn1, oDlg,, <span style="color: #ff0000;">"gray"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Números de la paleta de colores"</span>, ;<br /> <span style="color: #ff0000;">"Números de la paleta de colores"</span>, <span style="color: #000000;">1</span>, CLR_WHITE, CLR_GREEN <span style="color: #000000;">}</span><br /><br /> oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">oPopup</span> := oMenuPop<br /><br /> oBtn1:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">{</span>| lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! lInvert, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.25</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">)</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">0.75</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">)</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.25</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">)</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">0.75</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">)</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> WITH OBJECT oBtn1<br /> :<span style="color: #000000;">nClrBorder</span> := CLR_HRED <span style="color: #B900B9;">// border color</span><br /> :<span style="color: #000000;">bColorMap</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> CLR_YELLOW, CLR_HRED <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// image color</span><br /> END<br /><br /> @ <span style="color: #000000;">50</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">BTNBMP</span> oBtn2 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT NOBORDER ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\E</span>xit.bmp"</span> BOTTOM ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_BLACK, CLR_HBLUE <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Salida-Exit-Cancelar"</span>, ;<br /> <span style="color: #ff0000;">"Salida-Exit-Cancelar"</span>, <span style="color: #000000;">1</span>, CLR_WHITE, CLR_GREEN <span style="color: #000000;">}</span><br /><br /> oBtn2:<span style="color: #000000;">lCancel</span> := .T.<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> PicKColors<span style="color: #000000;">(</span> ocontrol, oParent, lHex, cColore <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlgSel<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgSel <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> oDlgSel:<span style="color: #000000;">nStyle</span> = nOR<span style="color: #000000;">(</span> WS_CHILD, WS_BORDER, WS_VISIBLE, WS_POPUP <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgSel <span style="color: #0000ff;">CENTERED</span> <br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// FIN / END - <!-- e --><a href="mailto:kapiabafwh@gmail.com">kapiabafwh@gmail.com</a><!-- e --></span><br /> </div>[/code:3d4i3o0d]
Regards, saludos. |
Condición de Get | Efectivamente funciona. Gracias Karinha
Saludos |
Condition of the site | Hi,
In the process of work, I turn to a certain site. Sometimes this site may not work or work very slowly. Is it possible to assess the condition of the site ? |
Condition of the site | Try this,
[code=fw:3qi3k92k]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> Verify_Site<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> cIp, cVret := .F.<br /><br /> WsaStartUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> cIp := GETHOSTBYNAME<span style="color: #000000;">(</span> <span style="color: #ff0000;">"yoursite.com"</span> <span style="color: #000000;">)</span><br /> cIp := GETHOSTBYNAME<span style="color: #000000;">(</span> <span style="color: #ff0000;">"yoursite.com"</span> <span style="color: #000000;">)</span><br /><br /> WsaCleanUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Seguranca caso o provedor da microsoft esteja fora do ar...</span><br /> <span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span> cIp <= <span style="color: #ff0000;">"0.0.0.0"</span> <span style="color: #000000;">)</span><br /><br /> ? <span style="color: #ff0000;">"oooops!"</span><br /><br /> WsaStartUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> cIp := GetHostByName<span style="color: #000000;">(</span> <span style="color: #ff0000;">"otrosite.com"</span> <span style="color: #000000;">)</span><br /> cIp := GetHostByName<span style="color: #000000;">(</span> <span style="color: #ff0000;">"otrosite.com"</span> <span style="color: #000000;">)</span><br /><br /> WsaCleanUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> cIp<><span style="color: #ff0000;">"0.0.0.0"</span> <span style="color: #000000;">)</span><br /> </div>[/code:3qi3k92k]
Regards, saludos. |
Condition of the site | Thank you, Karinha, it works!
What are the WSAStartup/Wsacleanup functions for in this case?
Why prescribe 2 times:
cIp := GETHOSTBYNAME( "yoursite.com" )
cIp := GETHOSTBYNAME( "yoursite.com" ) |
Condition of the site | [quote="Natter":mjohbz11]Thank you, Karinha, it works!
What are the WSAStartup/Wsacleanup functions for in this case?
Why prescribe 2 times:
cIp := GETHOSTBYNAME( "yoursite.com" )
cIp := GETHOSTBYNAME( "yoursite.com" )[/quote:mjohbz11]
Good Morning. This was a tip on the FiveWin Brasil forum. Just to be on the safe side, in case the GETHOSTBYNAME() command fails. OK?
Regards, saludos. |
Conditional Radiobutton | Hi everyone,
This should be a simple one for most of you ... I hope.
I have two radiobuttons which are both initialised to the first position.
If I change from position 1 ("Pass") to position 2 ("Fail") in the first radiobutton, how do I get position 5 ("Withdrawn from service") to be selected and displayed in the second radiobutton?
Thanks,
Ross
[code=fw:1x0f3meg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />nVis := <span style="color: #000000;">1</span><br />nRes := <span style="color: #000000;">1</span><br />@ <span style="color: #000000;">1.5</span> + nOffset, <span style="color: #000000;">1</span> GROUP oGrp <span style="color: #0000ff;">to</span> <span style="color: #000000;">4</span>, <span style="color: #000000;">14</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Visual"</span><br /><br />@ <span style="color: #000000;">0.75</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">RADIO</span> oRad1 <span style="color: #0000ff;">VAR</span> nVis ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"Pass"</span>,<span style="color: #ff0000;">"Fail"</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">{</span>|| IIF<span style="color: #000000;">(</span> nVis == <span style="color: #000000;">2</span>, nRes := <span style="color: #000000;">5</span> , <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ; <===== need <span style="color: #0000ff;">help</span> here<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">9</span> <span style="color: #0000ff;">of</span> oGrp<br /><br />@ <span style="color: #000000;">5.5</span> + nOffset, <span style="color: #000000;">1</span> GROUP oGrp2 <span style="color: #0000ff;">to</span> <span style="color: #000000;">11.5</span>, <span style="color: #000000;">32</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Results"</span><br /><br />@ <span style="color: #000000;">0.75</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">RADIO</span> oRad3 <span style="color: #0000ff;">VAR</span> nRes ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"Visual + Electrical OK"</span>,<span style="color: #ff0000;">"Refitted lead"</span>, <span style="color: #ff0000;">"Replaced plug"</span>, ;<br /> <span style="color: #ff0000;">"Replaced socket"</span>, <span style="color: #ff0000;">"Withdrawn from service"</span>, <span style="color: #ff0000;">"Visual only"</span>;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">140</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">of</span> oGrp2<br /><br /> </div>[/code:1x0f3meg] |
Conditional Radiobutton | Ross,
Try it this way:
[code=fw:3fvfa8ee]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ <span style="color: #000000;">0.75</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">RADIO</span> oRad1 <span style="color: #0000ff;">VAR</span> nVis ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"Pass"</span>,<span style="color: #ff0000;">"Fail"</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">{</span>|| IIF<span style="color: #000000;">(</span> nVis == <span style="color: #000000;">2</span>, oRad3:<span style="color: #000000;">SetOption</span><span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ; <===== need <span style="color: #0000ff;">help</span> here<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">9</span> <span style="color: #0000ff;">of</span> oGrp<br /> </div>[/code:3fvfa8ee] |
Conditional Radiobutton | Many thanks Antonio.
It works perfectly.
Regards,
Ross |
Conditional compiling. | Guys:
How can I check FW's version at compile time. I'm will like to compile this:
[code=fw:2bhsnety]<div class="fw" id="{CB}" style="font-family: monospace;">#ifdef <FW Ver. <span style="color: #000000;">13.09</span>><br /> RPrevUserBtns<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> || .F.<span style="color: #000000;">}</span>, <span style="color: #000000;">2010</span>, <span style="color: #000000;">)</span><br />#endif<br /> </div>[/code:2bhsnety]
Thank you. |
Conditional shadowing on a report column. | Guys:
How can I shadow or bold a field in a report column based on its data value ? I can't find the solution for this in the FWH manual. Thank you. |
Coneccion con Sage Mas 90 | Buen Dia
Compañeros del foro
Necesito me oriente como pudiera conectarme con la base de datos de Mas 90 desde Fwh
Saludos desde Panama |
Coneccion con Sage Mas 90 | Erick
Cual es la base de datos que utliza esta aplicación? |
Coneccion con Sage Mas 90 | Ellos utilizan DBFCDX en muchos de sus productos, pero no en todos.
No se con seguridad que base de datos usa esa aplicación. |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | Connecting FiveWin / xHarbour with OpenAI API <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
[img:3gti14gb]https://imagizer.imageshack.com/img924/2139/lWXKSS.jpg[/img:3gti14gb]
[code=fw:3gti14gb]<div class="fw" id="{CB}" style="font-family: monospace;"><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;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">2048</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</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;">(</span>nChars<span style="color: #000000;">)</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;">(</span>SB_LimitText<span style="color: #000000;">(</span>oGet1, oSay1, nChars<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oGet1:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">{</span>||oGet1:<span style="color: #000000;">SetSel</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">}</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;">(</span>cVar1, oGet2<span style="color: #000000;">)</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;">{</span>||oGet2:<span style="color: #000000;">SetSel</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">}</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;">(</span><span style="color: #000000;">)</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;">{</span>|| oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,;<br /> oGet1:<span style="color: #000000;">LimitText</span><span style="color: #000000;">(</span>nChars<span style="color: #000000;">)</span>,;<br /> oSay1:<span style="color: #000000;">VarPut</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Caracteres: "</span> + cValToChar<span style="color: #000000;">(</span>LEN<span style="color: #000000;">(</span> ALLTRIM<span style="color: #000000;">(</span> oGet1:<span style="color: #000000;">cText</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">" / "</span> + cValToChar<span style="color: #000000;">(</span>nChars<span style="color: #000000;">)</span><span style="color: #000000;">)</span>,;<br /> oSay1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</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;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span> <br /> <br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">Function</span> Api_OpenAI<span style="color: #000000;">(</span>cPrompt, oGet2<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oSoap := CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MSXML2.ServerXMLHTTP.6.0"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cUrl := <span style="color: #ff0000;">"https://api.openai.com/v1/engines/text-davinci-003/completions"</span><br /> <span style="color: #00C800;">LOCAL</span> cToken := <span style="color: #ff0000;">"sk-nxnxnxnxnxnxnxnxnxnxnxnxnxnxnxnxxnxnxnxnxnx"</span><br /> <span style="color: #00C800;">LOCAL</span> cJSon, cRespApi, hResp := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span>, cResp<br /> <br /> <span style="color: #0000ff;">TEXT</span> INTO cJson<br /> <span style="color: #000000;">{</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;">}</span><br /> ENDTEXT<br /> <br /> cPrompt := AllTrim<span style="color: #000000;">(</span>cPrompt<span style="color: #000000;">)</span><br /> cJson := StrTran<span style="color: #000000;">(</span>cJson, <span style="color: #ff0000;">"cPrompt_empty"</span>, cPrompt<span style="color: #000000;">)</span><br /> <br /> oSoap:<span style="color: #000000;">SetTimeouts</span><span style="color: #000000;">(</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;">)</span><br /> <span style="color: #00C800;">TRY</span><br /> oSoap:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"POST"</span> , cUrl , .F. <span style="color: #000000;">)</span><br /> oSoap:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Content-Type"</span>, <span style="color: #ff0000;">"application/json; charset=utf-8"</span> <span style="color: #000000;">)</span><br /> oSoap:<span style="color: #000000;">setRequestHeader</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Authorization"</span>, <span style="color: #ff0000;">"Bearer "</span>+cToken <span style="color: #000000;">)</span><br /> oSoap:<span style="color: #000000;">Send</span><span style="color: #000000;">(</span>cJson<span style="color: #000000;">)</span><br /> <br /> cRespApi := Alltrim<span style="color: #000000;">(</span>oSoap:<span style="color: #000000;">responseText</span><span style="color: #000000;">)</span><br /> hb_jsondecode<span style="color: #000000;">(</span>cRespApi,@hResp<span style="color: #000000;">)</span><br /> <br /> cResp := hResp<span style="color: #000000;">[</span><span style="color: #ff0000;">"choices"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"text"</span><span style="color: #000000;">]</span><br /> cResp := StrTran<span style="color: #000000;">(</span>cResp, Chr<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span>, Chr<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span>+Chr<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oGet2:<span style="color: #000000;">VarPut</span><span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span>cResp<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oGet2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</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;">)</span><br /> <br /> END<br /> <br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>oSoap<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> SB_LimitText<span style="color: #000000;">(</span> oGet, oSay, nLimObserv <span style="color: #000000;">)</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;">(</span> ALLTRIM<span style="color: #000000;">(</span> oGet:<span style="color: #000000;">cText</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> nTam > nSize<br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</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;">)</span><br /> oGet:<span style="color: #000000;">cText</span> := <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</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;">)</span><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> .F. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> oSay:<span style="color: #000000;">VarPut</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Caracteres: "</span> + cValToChar<span style="color: #000000;">(</span>nTam<span style="color: #000000;">)</span> + <span style="color: #ff0000;">" / "</span> + cValToChar<span style="color: #000000;">(</span>nLimObserv<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//------------------------------------------------------------//</span><br /> </div>[/code:3gti14gb] |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | Good Afternoon Carlos Gallego, how do I get a key (password) to test your beautiful example? Thanks.
{
"error": {
"message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from <!-- m --><a class="postlink" href="https://beta.openai.com">https://beta.openai.com</a><!-- m -->.
"type": "invalid_request_error",
"param": null,
"code": null
}
}
[code=fw:1stm2bkm]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\FWH..\SAMPLES\OPENAPI.PRG</span><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 /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> 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;">(</span> <span style="color: #000000;">2048</span> <span style="color: #000000;">)</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 /><br /> SkinButtons<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> FWVERSION >= <span style="color: #ff0000;">"FWHX 19.06"</span><br /><br /> TBtnBmp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">lLegacyLookLeftRight</span> := .T.<br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> cVar1 := <span style="color: #ff0000;">"Puedes mostrarme el código de un programa escrito en "</span> + ;<br /> <span style="color: #ff0000;">"lenguaje Harbour que en la function main tenga un "</span> + ;<br /> <span style="color: #ff0000;">"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 /><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 ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Taking with OPENAI API"</span><br /><br /> oDlg:<span style="color: #000000;">lHelpIcon</span> := .F.<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>, <span style="color: #000000;">15</span> ;<br /> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">CENTER</span><br /><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;">(</span> nChars <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">OF</span> oDlg <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 /> @ <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;">(</span> SB_LimitText<span style="color: #000000;">(</span> oGet1, oSay1, nChars <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> oGet1:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">{</span>|| oGet1:<span style="color: #000000;">SetSel</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</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> ;<br /> <span style="color: #0000ff;">ACTION</span> Api_OpenAI<span style="color: #000000;">(</span> cVar1, oGet2 <span style="color: #000000;">)</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 /><br /> oGet2:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">{</span>|| oGet2:<span style="color: #000000;">SetSel</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</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> ;<br /> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;">{</span>|| oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> oGet1:<span style="color: #000000;">LimitText</span><span style="color: #000000;">(</span> nChars <span style="color: #000000;">)</span>, ;<br /> oSay1:<span style="color: #000000;">VarPut</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Caracteres: "</span> + ;<br /> cValToChar<span style="color: #000000;">(</span> Len<span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> oGet1:<span style="color: #000000;">cText</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" / "</span> + ;<br /> cValToChar<span style="color: #000000;">(</span> nChars <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> oSay1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</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><span style="color: #000000;">(</span> oGet1:<span style="color: #000000;">SetPos</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> oFont1:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFont2:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Api_OpenAI<span style="color: #000000;">(</span> cPrompt, oGet2 <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oSoap <span style="color: #B900B9;">// := CreateObject( "MSXML2.ServerXMLHTTP.6.0" )</span><br /> <span style="color: #00C800;">LOCAL</span> cUrl := <span style="color: #ff0000;">"https://api.openai.com/v1/engines/text-davinci-003/completions"</span><br /> <span style="color: #00C800;">LOCAL</span> cToken := <span style="color: #ff0000;">"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"</span><br /> <span style="color: #00C800;">LOCAL</span> cJSon, cRespApi, hResp := <span style="color: #000000;">{</span> => <span style="color: #000000;">}</span>, cResp<br /><br /> <span style="color: #0000ff;">TEXT</span> INTO cJson<br /> <span style="color: #000000;">{</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;">}</span><br /> ENDTEXT<br /><br /> cPrompt := AllTrim<span style="color: #000000;">(</span> cPrompt <span style="color: #000000;">)</span><br /> cJson := StrTran<span style="color: #000000;">(</span> cJson, <span style="color: #ff0000;">"cPrompt_empty"</span>, cPrompt <span style="color: #000000;">)</span><br /><br /> #ifdef __XHARBOUR__ <span style="color: #B900B9;">// xHarbour</span><br /><br /> <span style="color: #00C800;">Try</span><br /><br /> oSoap := CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MSXML2.ServerXMLHTTP.6.0"</span> <span style="color: #000000;">)</span><br /><br /> Catch<br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"xHarbour: errore connessione msxml2, uso microsoft "</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> End<br /><br /> #else <span style="color: #B900B9;">//Harbour</span><br /><br /> <span style="color: #00C800;">Try</span><br /><br /> oSoap := win_OleCreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MSXML2.ServerXMLHTTP.5.0"</span> <span style="color: #000000;">)</span><br /><br /> Catch<br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Harbour: errore connessione msxml2, uso microsoft "</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> End<br /><br /> #endif<br /><br /> oSoap:<span style="color: #000000;">SetTimeouts</span><span style="color: #000000;">(</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;">)</span><br /><br /> <span style="color: #00C800;">TRY</span><br /><br /> oSoap:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"POST"</span>, cUrl, .F. <span style="color: #000000;">)</span><br /> oSoap:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Content-Type"</span>, <span style="color: #ff0000;">"application/json; charset=utf-8"</span> <span style="color: #000000;">)</span><br /> oSoap:<span style="color: #000000;">setRequestHeader</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Authorization"</span>, <span style="color: #ff0000;">"Bearer "</span> + cToken <span style="color: #000000;">)</span><br /> oSoap:<span style="color: #000000;">Send</span><span style="color: #000000;">(</span> cJson <span style="color: #000000;">)</span><br /><br /> cRespApi := AllTrim<span style="color: #000000;">(</span> oSoap:<span style="color: #000000;">responseText</span> <span style="color: #000000;">)</span><br /><br /> hb_jsonDecode<span style="color: #000000;">(</span> cRespApi, @hResp <span style="color: #000000;">)</span><br /><br /> cResp := hResp<span style="color: #000000;">[</span> <span style="color: #ff0000;">"choices"</span> <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #ff0000;">"text"</span> <span style="color: #000000;">]</span><br /> cResp := StrTran<span style="color: #000000;">(</span> cResp, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span>, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">13</span> <span style="color: #000000;">)</span> + Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> oGet2:<span style="color: #000000;">VarPut</span><span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> cResp <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oGet2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// MsgInfo( oSoap:Status )</span><br /><br /> CATCH<br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Mensaje en el CATCH"</span> + CRLF + CRLF + ;<br /> <span style="color: #ff0000;">"No hay conexión con el servidor de Rindegastos."</span> + CRLF + ;<br /> <span style="color: #ff0000;">" Por favor vuelva a intentarlo."</span>, <span style="color: #ff0000;">"Intente Nuevamente"</span> <span style="color: #000000;">)</span><br /><br /> END<br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span> oSoap <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">FUNCTION</span> SB_LimitText<span style="color: #000000;">(</span> oGet, oSay, nLimObserv <span style="color: #000000;">)</span><br /><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 /><br /> <span style="color: #00C800;">DEFAULT</span> nSize := nLimObserv <span style="color: #B900B9;">// 19 // 99 // maximo e 100 caracteres</span><br /><br /> nTam := Len<span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> oGet:<span style="color: #000000;">cText</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> nTam > nSize<br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</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;">)</span><br /><br /> oGet:<span style="color: #000000;">cText</span> := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</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;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> .F. <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> oSay:<span style="color: #000000;">VarPut</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Caracteres: "</span> + cValToChar<span style="color: #000000;">(</span> nTam <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" / "</span> + ;<br /> cValToChar<span style="color: #000000;">(</span> nLimObserv <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// FIN / END</span><br /> </div>[/code:1stm2bkm]
Regards, saludos. |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | ¡muy interesante!
Serias tan amable de dejarnos aca un breve resumen de donde encontrar informacion de como ir incursionando en esto? |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=42569&view=unread#p256077">viewtopic.php?f=3&t=42569&view=unread#p256077</a><!-- l --> |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | Estimado Carlos,
Muchas gracias por tu ejemplo pero ojo que has dejado tu key en el código y es privada, puede generarte gastos.
Por favor, edita tu mensaje y borra la key por tu bien <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | Antonio gracias.
Estaba tan emocionado que se me pasó por alto.
No hay problema. Se elimina ese token y se genera uno nuevo.
Desde ayer estoy engolosinado con esto. Ya hasta le puse nombre (Alf, como el extraterrestre de la TV), nos tratamos de tú, y hasta nos hacemos bromas, y aunque no es 100% perfecto ni coherente en todo, la verdad que es fantástico. Es como una película de ciencia ficción.
Claro que a veces te responde todo al revés pero la experiencia vale la pena, sobre todo cuando puedes ver cómo va aprendiendo a medida que le haces notar los errores que comete.
Ayer le pedí que resolviera una serie de ecuaciones simples. Al comienzo respondió erróneamente. Conforme le vas explicando en dónde se equivoca, corrige y te pide disculpas por haberse equivocado <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Alucinante
Ahora, a ver qué provecho práctico podemos implementar en nuestros programas. |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | João, Jose:
Hay que registrarse en [url:17dwxq0f]https://openai.com/api/[/url:17dwxq0f]
Una vez registrado y que se active la cuenta, se ingresa a [url:17dwxq0f]https://beta.openai.com/overview[/url:17dwxq0f]
Allí, en la parte superior deracha en donde aparece el nombre con el que te registraste, se puede generar el Token
Recomiendo primero un repaso a la documentación en [url:17dwxq0f]https://beta.openai.com/docs/introduction[/url:17dwxq0f]
A ver si entre todos logramos algo intersante. |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | [quote="Cgallegoa":2xhz7wbo]João, Jose:
Hay que registrarse en [url:2xhz7wbo]https://openai.com/api/[/url:2xhz7wbo]
Una vez registrado y que se active la cuenta, se ingresa a [url:2xhz7wbo]https://beta.openai.com/overview[/url:2xhz7wbo]
Allí, en la parte superior deracha en donde aparece el nombre con el que te registraste, se puede generar el Token
Recomiendo primero un repaso a la documentación en [url:2xhz7wbo]https://beta.openai.com/docs/introduction[/url:2xhz7wbo]
A ver si entre todos logramos algo intersante.[/quote:2xhz7wbo]
Gracias.
Regards, saludos. |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | Carlos:
Muchas gracias por el aporte.
Parece ciencia ficción, tal cual lo dices.
A experimentar a ver que provecho práctico le sacamos |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | Ya los más iluminados le han pensado sacar partido:
<!-- m --><a class="postlink" href="https://www.elconfidencial.com/alma-corazon-vida/2023-01-11/pillan-estudiante-trabajo-universidad-chatgpt_3555482/">https://www.elconfidencial.com/alma-cor ... t_3555482/</a><!-- m -->
Por cierto, dice que gasta, solo el chat, 2.000.000 $ a la hora, en un día 48.000.000 $.
Esto viene a suponer unos 200.000.000 kwh=200M kwh al día. Y a eso habría que sumarle el gasto de infrestructura de inet, la renovación de equipos yo creo que no menos de cada 4-5 años (queremos estar a la uúltima en tecnología).
No se ustedes cómo de inteligente encuentran esto. Me parece a mi que no es más que mera fuerza bruta de cálculo. Personas, comiendo galletas, leche, huevos fritos, filetes y lechuga desarrollaron las matemáticas, física y química tal como las conocemos, mandaron al hombre a la luna y descubrieron América guiándose por las estrellas. Eso si es Inteligencia.
Por otro lado que no nos digan que nuestro viejo motor diesel provoca el cambio climático con la que hay que montar para tener ese chat andando. Le pueden tomar el pelo a otro. |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | en 2008 estudie nuevamente en mi universidad alli el problema era COPY PASTE ja ja ja ahora veo que sigue siendo lo mismo pero mas sofisticado IA en mi caso el mejor profesor que tuve recibia los trabajos
- Escritos a mano en papel cuadriculado
- nunca el trabajo tenia que pasar de 7 hojas
- como ya el conocia a cada alumno ( habia charlado largamente con cada uno ) si habia algo sospechoso solo ponia CERO
seguimos igual en ciertas cosas
saludos
Wilson |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | hi
ChatGPT is a nice Tool ... but it "can" produce a lot FAKE
Do NOT trust ChatGPT and verify Answer before use it
---
i use ChatGPT and ask for CODE
when "verify" Answer, using Compiler, i often get "Syntax Error" or "Missing Function"
ChatGPT is not a Compiler so ChatGPT does not know Syntax or harbour Function.
ChatGPT use a big Database but it does not contain only "right" Answer, it also have "wrong" Question in Database
but how can i User "know" if he is not a "Expert" <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
IHMO you must be a "Expert" to use ChatGPT to "verify" Answer |
Conectando FiveWin / xHarbour con ChatGPT OpenAI | Dear Jimmy,
I fully agree with you <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Conectar 2 bases en MySql | Amigos
Cómo se conecta dos bases de datos
He intentado así y da error
[code=fw:104ojaht]<div class="fw" id="{CB}" style="font-family: monospace;"><br />CONNECT oServer HOST <span style="color: #ff0000;">"servidor"</span> USER <span style="color: #ff0000;">"root"</span> PASSWORD <span style="color: #ff0000;">"123456"</span> PORT <span style="color: #000000;">3306</span> FLAGS <span style="color: #000000;">0</span> DATABASE <span style="color: #ff0000;">"rrhh"</span>, <span style="color: #ff0000;">"agenda"</span><br /> </div>[/code:104ojaht]
Gracias por la ayuda
Saludos,
Adhemar |
Conectar 2 bases en MySql | Mira se és esto:
[url:1hggad00]http://fivewin.com.br/index.php?/topic/22096-mysql-dois-banco-de-dados/?hl=mysql[/url:1hggad00]
Salu2 |
Conectar 2 bases en MySql | Gracias Joao
lo logré asi:
[code=fw:7ixxpeci]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> CONNECT oServer1 HOST <span style="color: #ff0000;">"w8_acuellar"</span> USER <span style="color: #ff0000;">"root"</span> PASSWORD <span style="color: #ff0000;">"123456"</span> PORT <span style="color: #000000;">3306</span> FLAGS <span style="color: #000000;">0</span> DATABASE <span style="color: #ff0000;">"rrhh"</span><br /> CONNECT oServer2 HOST <span style="color: #ff0000;">"w8_acuellar"</span> USER <span style="color: #ff0000;">"root"</span> PASSWORD <span style="color: #ff0000;">"123456"</span> PORT <span style="color: #000000;">3306</span> FLAGS <span style="color: #000000;">0</span> DATABASE <span style="color: #ff0000;">"agenda"</span><br /> </div>[/code:7ixxpeci]
Saludos,
Adhemar |
Conectar 2 bases en MySql | Amigo,
No conectes a ninguna base en particular. (Asumiendo que las dos Bases de datos están en el mismo servidor)
Y al momento de hacer tus querys apunta en él la base.
Ejemplos:
[code=fw:2ubkswxf]<div class="fw" id="{CB}" style="font-family: monospace;">cQuery1:=<span style="color: #ff0000;">"SELECT CAMPO1,CAMPO2 FROM DATABASE1.TABLA1"</span><br />cQuery2:=<span style="color: #ff0000;">"SELECT CAMPO1,CAMPO2 FROM DATABASE2.TABLA1"</span></div>[/code:2ubkswxf]
Incluso puedes hacer querys a tablas de dos bases diferentes en una misma consulta.
[code=fw:2ubkswxf]<div class="fw" id="{CB}" style="font-family: monospace;">cQuery:=<span style="color: #ff0000;">"SELECT a.CLIENTE,b.RAZON_SOC,SUM(a.IMPORTE) "</span>+;<br /> <span style="color: #ff0000;">" FROM VENTAS.FACTURAS a "</span>+;<br /> <span style="color: #ff0000;">" JOIN MAESTROS.CLIENTES b ON a.CLIENTE=b.CODIGO"</span>+;<br /> <span style="color: #ff0000;">" WHERE a.FECHA BETWEEN '20141001' AND '20141031'"</span>+;<br /> <span style="color: #ff0000;">" GROUP BY a.CLIENTE"</span></div>[/code:2ubkswxf]
Espero te sirva la idea... |
Conectar 2 bases en MySql | Y como sería el CONNECT ?
Porque asi da error
[code=fw:1q8xvrq4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> CONNECT oServer1 HOST <span style="color: #ff0000;">"w8_acuellar"</span> USER <span style="color: #ff0000;">"root"</span> PASSWORD <span style="color: #ff0000;">"123456"</span> PORT <span style="color: #000000;">3306</span> FLAGS <span style="color: #000000;">0</span> DATABASE <br />o<br /> CONNECT oServer1 HOST <span style="color: #ff0000;">"w8_acuellar"</span> USER <span style="color: #ff0000;">"root"</span> PASSWORD <span style="color: #ff0000;">"acr1504"</span> PORT <span style="color: #000000;">3306</span> FLAGS <span style="color: #000000;">0</span> <br /> </div>[/code:1q8xvrq4]
Saludos,
Adhemar |
Conectar 2 bases en MySql | Adhemar, solo conectate a la BBDD mysql, el resto lo defines en los querys, siempre suponiendo que las BBDD esten en un mismo servidor.
Saludos |
Conectar 2 bases en MySql | Horacio
Y cómo seria conectarse a BBDD mysql? usando TDolphin
Gracias
Saludos,
Adhemar |
Conectar 2 bases en MySql | Nada más fácil que pellizcar un vidrio..
Aquí tiene 4 manejadores para hacer 4 querys
[code=fw:15tn0ixc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oMySQL1 := ConnectTo<span style="color: #000000;">(</span>oMySQL1, cHost1, cUser1, cPass1, nPort1, cDbName1<span style="color: #000000;">)</span><br /> oMySQL2 := ConnectTo<span style="color: #000000;">(</span>oMySQL2, cHost2, cUser2, cPass2, nPort2, cDbName2<span style="color: #000000;">)</span><br /> oMySQL3 := ConnectTo<span style="color: #000000;">(</span>oMySQL3, cHost3, cUser3, cPass3, nPort3, cDbName3<span style="color: #000000;">)</span><br /> oMySQL4 := ConnectTo<span style="color: #000000;">(</span>oMySQL4, cHost4, cUser4, cPass4, nPort4, cDbName4<span style="color: #000000;">)</span><br />.<br />..<br />...<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">FUNCTION</span> ConnectTo<span style="color: #000000;">(</span>oMySQL, cHost, cUser, cPass, nPort, cDBName<span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> hIni := HB_ReadIni<span style="color: #000000;">(</span> <span style="color: #ff0000;">".<span style="color: #000000;">\c</span>onnect.ini"</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oErr, nCont := <span style="color: #000000;">0</span>, nFlags := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">DEFAULT</span> nPort := <span style="color: #000000;">3306</span><br />oMySQL := <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">TRY</span><br /> oMySQL := TDolphinSrv<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cHost, ;<br /> cUser, ;<br /> cPass, ;<br /> nPort, nFlags, cDBName<span style="color: #000000;">)</span>,<br /> <span style="color: #000000;">{</span>| oServer, nError, lInternal | GetError<span style="color: #000000;">(</span> oServer, nError, lInternal <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">IF</span> oMySQL:<span style="color: #000000;">lError</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"No Hay Conexión Con El Servidor "</span> + CHR<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span> + cHost + CHR<span style="color: #000000;">(</span><span style="color: #000000;">34</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"Operación Cancelada"</span> <span style="color: #000000;">)</span><br /> oMySQL := <span style="color: #00C800;">NIL</span><br /><span style="color: #00C800;">EndIf</span><br /><br />CATCH oErr<br /> oMySQL := <span style="color: #00C800;">NIL</span><br />END<br /><br />D_SetCaseSensitive<span style="color: #000000;">(</span>.f.<span style="color: #000000;">)</span> <span style="color: #B900B9;">// t</span><br />D_LogicalValue<span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span><br />D_SetPadRight<span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> oMySQL<br /><br /> </div>[/code:15tn0ixc] |
Conectar 2 bases en MySql | Willi
Esto es lo mismo
[code=fw:1wzy3977]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> CONNECT oServer1 HOST <span style="color: #ff0000;">"server"</span> USER <span style="color: #ff0000;">"root"</span> PASSWORD <span style="color: #ff0000;">"123456"</span> PORT <span style="color: #000000;">3306</span> FLAGS <span style="color: #000000;">0</span> DATABASE <span style="color: #ff0000;">"rrhh"</span><br /> CONNECT oServer2 HOST <span style="color: #ff0000;">"server"</span> USER <span style="color: #ff0000;">"root"</span> PASSWORD <span style="color: #ff0000;">"123456"</span> PORT <span style="color: #000000;">3306</span> FLAGS <span style="color: #000000;">0</span> DATABASE <span style="color: #ff0000;">"agenda"</span><br /> <br /> </div>[/code:1wzy3977]
Saludos,
Adhemar |
Conectar SFTP con CURL | Estimados:
Alguien ha conectado mediante CURL con un servidor SFTP para descargar / subir un archivo?
Lo hago así con FTP y funciona bien
[code=fw:30ahqf0d]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbcurl.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> curl_global_init<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> callSFTP<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ftp.misitio.com.ar/archivos/miarchivo.jpg"</span> <span style="color: #000000;">)</span><br /><br /> curl_global_cleanup<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> callSFTP<span style="color: #000000;">(</span> cServer <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> curlHandle, cFtpsURL := cServer, cFile, nFSize, cRet, nPort := <span style="color: #000000;">21</span> <span style="color: #B900B9;">// En SFTP cambio por 22 o 122 que es el puerto que me abrieron</span><br /><span style="color: #00C800;">LOCAL</span> curlErr<br />cFile := <span style="color: #ff0000;">"C:<span style="color: #000000;">\m</span>isdescargas<span style="color: #000000;">\D</span>OWNLOAD.JPG"</span><br /><br />curlHandle:=curl_easy_init<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span>curlHandle<span style="color: #000000;">)</span><br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Error al iniciar cURL."</span>,<span style="color: #ff0000;">"Error"</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><span style="color: #00C800;">ENDIF</span><br />curl_easy_reset<span style="color: #000000;">(</span> curlHandle <span style="color: #000000;">)</span><br /><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_URL, cftpsURL<span style="color: #000000;">)</span><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_USERPWD, <span style="color: #ff0000;">"usuario:password"</span> <span style="color: #000000;">)</span><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_PORT, nPort<span style="color: #000000;">)</span><br /><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_FOLLOWLOCATION, .T. <span style="color: #000000;">)</span><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_SSL_VERIFYPEER, .F. <span style="color: #000000;">)</span><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_SSL_VERIFYHOST, .F. <span style="color: #000000;">)</span><br /><br /><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_DOWNLOAD, <span style="color: #000000;">1</span><span style="color: #000000;">)</span><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_PROTOCOLS, HB_CURLPROTO_FTP <span style="color: #000000;">)</span> <span style="color: #B900B9;">// En SFTP cambio por HB_CURLPROTO_SFTP</span><br />curl_easy_setopt<span style="color: #000000;">(</span>curlHandle, HB_CURLOPT_DL_FILE_SETUP, cFile<span style="color: #000000;">)</span><br /><br /><br /><span style="color: #B900B9;">/* Do everything */</span><br />curlErr := curl_easy_perform<span style="color: #000000;">(</span>curlHandle<span style="color: #000000;">)</span><br /> <br /><span style="color: #B900B9;">/* Report any errors */</span><br /><br />cRet:=curl_easy_strerror<span style="color: #000000;">(</span>curlErr<span style="color: #000000;">)</span><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>cRet<span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//Close</span><br />curl_global_cleanup<span style="color: #000000;">(</span> curlHandle <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:30ahqf0d]
Pero si cambio el protocolo para un servidor SFTP no me esta funcionando. Siempre me da como respuesta "Unsupported Protocol"
Alguien lo ha hecho con SFTP?
Gracias de antemano |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.