topic
stringlengths
1
63
text
stringlengths
1
577k
Cargar imagen
[code=fw:xvna5sia]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> BITMAP oFiveWin <span style="color: #0000ff;">ID</span> <span style="color: #000000;">121</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"FIVEPOWER"</span> TRANSPARENT <span style="color: #0000ff;">OF</span> oDlg<br />&nbsp;</div>[/code:xvna5sia]
Cargar imagen
Gracias amigos He intentado de todas formas y no cambia la foto la idea es esta, tengo las fotos cargadas a un campo de imagen, cuando existe muestra, y si no mantiene la anterior Hago asi: [code=fw:29dkjvh5]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;@<span style="color: #000000;">55</span>,<span style="color: #000000;">315</span> <span style="color: #0000ff;">IMAGE</span> oFoto &nbsp;<span style="color: #0000ff;">OF</span> oWnd NOBORDER <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">ADJUST</span><br />*en el Browse<br />&nbsp;oBrw:<span style="color: #000000;">bChange</span>:=<span style="color: #000000;">&#123;</span>|| BuscaFoto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />*<br />*La funcion<br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> BusFoto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</span>FOTO<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Campo de imagen</span><br />&nbsp; &nbsp; BLOBExport<span style="color: #000000;">&#40;</span>FieldPos<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"FOTO"</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"FOTO.JPG"</span>, BLOB_EXPORT_OVERWRITE<span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; oFoto:<span style="color: #000000;">LoadBmp</span><span style="color: #000000;">&#40;</span> cPath+<span style="color: #ff0000;">"FOTO.JPG"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Perfecto la muestra</span><br />&nbsp;<span style="color: #00C800;">Else</span><br />&nbsp; &nbsp; oFoto:<span style="color: #000000;">LoadImage</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"SINFOTO"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//imagen de recurso no la muestra</span><br />&nbsp;<span style="color: #00C800;">Endif</span><br />&nbsp;oFoto:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:29dkjvh5] Saludos, Adhemar
Cargar imagen
esto igual sirve REDEFINE IMAGE oBmp1 FILENAME cBitmap1 ADJUST ID 114 OF oFld:aDialogs[ 4 ] SCROLL UPDATE REDEFINE BUTTON ID 115 OF oFld:aDialogs[ 4 ]; ACTION( Fot_Jug:= cGetFile32("JPEG (*.jpg) | *.jpg | BITMAP (*bmp)| *.bmp", "Seleccionar Imagen" ), ; cBitmap1 := AllTrim( Fot_jug), oBmp1:LoadBmp( cBitmap1 ), oBmp1:Refresh(),oDlg:Update() ) REDEFINE GET cBitmap1 ID 116 OF oFld:aDialogs[ 4 ] ON CHANGE( cBitmap1 := AllTrim( Fot_Jug ),; oBmp1:Load( cBitmap1 ), oBmp1:Refresh() ) UPDATE Saludos
Cargar imagen
Mr. acuellar The code can be much simpler. Please see the sample program I posted here. For this sample I have used \fwh\samples\wwonders.dbf. This file has a memo field "IMAGE" which contains image buffers of jpeg files, similar to the field "FOTO" in your example. [code=fw:zubl16jo]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oBrw, oImage, oFont<br /><br />   USE WWONDERS VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">680</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />   @  <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      COLUMNS <span style="color: #ff0000;">"Name"</span> COLSIZES <span style="color: #000000;">10</span> ;<br />      <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"WWONDERS"</span> CELL LINES NOBORDER<br /><br />   @  <span style="color: #000000;">10</span>,<span style="color: #000000;">130</span> <span style="color: #0000ff;">IMAGE</span> oImage <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ADJUST</span><br />   oImage:<span style="color: #000000;">LoadFromMemory</span><span style="color: #000000;">&#40;</span> WWONDERS->IMAGE <span style="color: #000000;">&#41;</span><br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nStretchCol</span>      := <span style="color: #000000;">1</span><br />      :<span style="color: #000000;">lHScroll</span>         := .f.<br />      :<span style="color: #000000;">bChange</span>          := <span style="color: #000000;">&#123;</span> || oImage:<span style="color: #000000;">LoadFromMemory</span><span style="color: #000000;">&#40;</span> WWONDERS->IMAGE <span style="color: #000000;">&#41;</span>, oImage:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:zubl16jo] [url=http&#58;//img829&#46;imageshack&#46;us/i/xbrimgobj&#46;jpg/:zubl16jo][img:zubl16jo]http&#58;//img829&#46;imageshack&#46;us/img829/1952/xbrimgobj&#46;jpg[/img:zubl16jo][/url:zubl16jo] Please note the usage of oImage:LoadFromMemory( <cAlias>-><cImageFieldName> ) #1. No need to use blob functions #2. No need to write the image to disk and load to image object. Instead we can load the image directly from memory using the method LoadFromMemory
Cargar imagen
Thanks Rao Now its OK Regards Adhemar
Cargar imagen
Hola Rao Como insertas una imagen JPG en un campo memo ? Gracias... Saludos
Cargar imagen
[quote="joseguillermosanchez":22va4zzj]Hola Rao Como insertas una imagen JPG en un campo memo ? Gracias... Saludos[/quote:22va4zzj] FIELD->IMAGE := MEMOREAD( "OURIMAGE.JPG" )
Cargar imagen
Mr. Rao: And how to read the image from the field and show it on a Timage control ? This is my source code [code=fw:3bvz0bu6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">LOCAL</span> cFileName := <span style="color: #ff0000;">"C:<span style="color: #000000;">\R</span>efWin<span style="color: #000000;">\I</span>magenes<span style="color: #000000;">\I</span>magen0.Jpg"</span><br />...<br />...<br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">IMAGE</span> oImagen <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg FILENAME cFileName <span style="color: #0000ff;">ADJUST</span><br />....<br />....<br /><span style="color: #B900B9;">// The user can choice a new image</span><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBuscar <span style="color: #0000ff;">ID</span> <span style="color: #000000;">900</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span>;<br />    <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>cFileName := cGetFile<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"*.Jpg"</span>,;<br />    <span style="color: #ff0000;">"Seleccione la imágen de esta parte"</span>,<span style="color: #000000;">1</span>,;<br />    <span style="color: #ff0000;">".<span style="color: #000000;">\I</span>magenes"</span><span style="color: #000000;">&#41;</span>,oImagen:<span style="color: #000000;">LoadBmp</span><span style="color: #000000;">&#40;</span>cFileName <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />    <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Busca la imágen a mostrar"</span><br />....<br />....<br /><span style="color: #B900B9;">// To save the image on a mysql table</span><br />oRsPar:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"PAR_IMG"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := MEMOREAD<span style="color: #000000;">&#40;</span>cFileName<span style="color: #000000;">&#41;</span><br />oRsPar:<span style="color: #0000ff;">UpDate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:3bvz0bu6] Best regards, thanks for your help
Cargar imagen desde URL
Estimado Manuel Que función de GDIPLUS se usa para evita freeimage.dll Hice lo siguiente [code=fw:37xp6ep0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> cargaBmp<span style="color: #000000;">&#40;</span>cUrl,oImage<span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">local</span> cResp := loadBmp<span style="color: #000000;">&#40;</span>cUrl<span style="color: #000000;">&#41;</span>,nZeroZeroClr<br />&nbsp; &nbsp;<br />&nbsp; <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cResp <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<span style="color: #B900B9;">// oImage:LoadFromMemory( cResp )</span><br />&nbsp; &nbsp; &nbsp;oBmpLoadFromStr<span style="color: #000000;">&#40;</span> oImage, cResp <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Muestra las imágenes no ALPHA con borde negro.</span><br />&nbsp; &nbsp; &nbsp;oImage:<span style="color: #000000;">HasAlpha</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;oImage:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:37xp6ep0] Gracias por su tiempo y ayuda. Saludos, Adhemar
Cargar imagen desde URL
[quote="acuellar":3avtsltt]Estimado Manuel Que función de GDIPLUS se usa para evita freeimage.dll Hice lo siguiente [code=fw:3avtsltt]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> cargaBmp<span style="color: #000000;">&#40;</span>cUrl,oImage<span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">local</span> cResp := loadBmp<span style="color: #000000;">&#40;</span>cUrl<span style="color: #000000;">&#41;</span>,nZeroZeroClr<br />&nbsp; &nbsp;<br />&nbsp; <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cResp <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<span style="color: #B900B9;">// oImage:LoadFromMemory( cResp )</span><br />&nbsp; &nbsp; &nbsp;oBmpLoadFromStr<span style="color: #000000;">&#40;</span> oImage, cResp <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Muestra las imágenes no ALPHA con borde negro.</span><br />&nbsp; &nbsp; &nbsp;oImage:<span style="color: #000000;">HasAlpha</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;oImage:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:3avtsltt] Gracias por su tiempo y ayuda. Saludos, Adhemar[/quote:3avtsltt] ¿ La imagen es un alphabmp ? . ¿ Sabes que tipo de imagen es ? png ?
Cargar imagen desde URL
Es la del pronóstico del tiempo. Del post Meteo.prg Gracias, Saludos, Adhemar
Cargar imagen desde URL
[quote="acuellar":26qvzvtq]Es la del pronóstico del tiempo. Del post Meteo.prg Gracias, Saludos, Adhemar[/quote:26qvzvtq] no tenemos aún funcionando como se debe el loadFromMemory ( que no es lo mismo que loadFromstring ) <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Cargar imagen desde URL
Gracias Manuel Esperaré para cuando exista como hacerlo. Saludos, Adhemar
Cargar imagen desde URL
cuellar , tengo un fix ... En tu archivo gdiplus.cpp vete a la function GDIPLUSIMAGELFROMSTR y cambia . Bitmap* newImage = new Bitmap( nWidth, nHeight, original->GetPixelFormat()); por Bitmap* newImage = new Bitmap( nWidth, nHeight, PixelFormat32bppPARGB ); y con todo el código anterior dime si te funciona. Gracias.
Cargar imagen desde URL
Muchas gracias Manuel Funciona perfecto. Si no es mucho pedir será que se puede mostrar el estado del tiempo por hora como muestra el celular Gracias una vez mas por su colaboración y tiempo. Saludos, Adhemar
Cargar imagen desde URL
De la forma en que esta implementado no parece que se puedan conseguir los datos . Con cuenta de desarrollador yahoo seguro que si , o investigando la api ...
Cargar imagen desde URL
Gracias Manuel. Saludos, Adhemar
Cargar parte de un BitMap?
Saludos Antonio Linares Mi unica dura al respecto del ejemplo que me expones: local oLetra := TBitmap():Define( ,,, CropImage( oBitmapCompleto:hBitmap, nTop, nLeft, nBottom, nRight ) ) ¿Como doy lectura a mi archivo BMP para "oBitmapCompleto" oBitmapCompleto:=FiLoadImg('AZ09.BMP') o oBitmapCompleto:=LoadBitmap(GetResources(),'AZ09.BMP') o oBitmapCompleto:=ReadBitmap(0,,'AZ09.BMP') o que funcion?
Cargar parte de un BitMap?
Noé, Si lo guardas como un recurso en tu EXE: oBitmapCompleto = TBitmap():Define( "AZ09" ) Si lo guardas como un archivo BMP: oBitmapCompleto = TBitmap():Define( , "AZ09.bmp" )
Cargar parte de un BitMap?
Saludos. Es posible leer una parte de un archivo bitmap (BMP)? tengo un BMP de 432x16 pxl que corresponden a 16x17 y 16, el cual cada 16 pxl tiene la imagen de una letra (ABCDEFC...) se podra segun una letra X, tomar parte de este bitmap que corresponda a esta letra: por ejempo: Si tengo la letra C (numero 3), tomaria del bitmap el segmento 16x3-16 pxl = 32, hasta el 32+16 y 16 de alto. todo esto para no tener 27 bitmaps con la letra de cada vocal. Lo asignaria a oBmp:=TomaLetra('C') que regresaria el bitmap de la letra C Gracias.
Cargar parte de un BitMap?
Noé, La función CropImage( hBitmap, nTop, nLeft, nBottom, nRight ) te devolverá un nuevo hBitmap correspondiente al área indicada
Cargar parte de un BitMap?
Basicamente lo que tendrías que hacer es: local oLetra := TBitmap():Define( ,,, CropImage( oBitmapCompleto:hBitmap, nTop, nLeft, nBottom, nRight ) )
Cargar un Browse desde GET..ACTION..
Hola foro, Necesito cargar un Browse desde un GET y seleccionar un registro para llenar el mismo Alguien tiene un ejemplo de como hacerlo? Gracias de antemano
Cargar un Browse desde GET..ACTION..
Hola amigo: Yo utilizo algo como lo que pides, pero a ver como te lo explico. Lo intento... Este es el codigo del GET que tiene un bitmap (como puedes comprobar) tambien tengo en cuenta si el usuario pulsa simplemente Enter que se lance la busqueda del codigo, tambien que pulse la tecla + , utilizo en ello dos funciones una trivial rellena() en la cual relleno automaticamente con ceros a la izquierda , la puedes desechar si quieres y luego la de la busqueda en si que es un dialogo en el que se muestra el browse y permite buscar. Se podria mejorar muchisimo con busqueda incremental, no lo he conseguido nunca desde un dialogo, tambien el codigo sera muy mejorable, pero a mi me funciona. Ah veras que utilizo listbox en vez de XBrowse , no he conseguido nunca colocar los botones arriba del Xbrowse y que se vean bien, lo tengo pendiente, puedes probar tu. Tambien veras que en la funciona hay uN DO CASE, ya que utilizo el mismo dialogo para todas las tablas que busco, ajusta tu, tus alias y las tablas que quieres buscar A ver por partes. codigo del GET [code=fw:1hnkvoui]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oObra <span style="color: #0000ff;">VAR</span> cObra <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> BITMAP <span style="color: #ff0000;">"OBRAS1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999"</span> ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cObra := Busqueda<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>, oInicio:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> Rellena<span style="color: #000000;">&#40;</span> oObra <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .AND. ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> Obr-><span style="color: #000000;">&#40;</span> dbSeek<span style="color: #000000;">&#40;</span> cObra <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cObra := Busqueda<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Obr"</span> <span style="color: #000000;">&#41;</span>, oSayObra:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oInicio:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;oObra:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">&#123;</span> || oWndMain:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Codigo de obra.Tecla <+> permite buscar"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oObra:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey | IIf<span style="color: #000000;">&#40;</span> nKey = VK_ADD, <span style="color: #000000;">&#40;</span> cObra := Busqueda<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Obr"</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oInicio:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp;</div>[/code:1hnkvoui] Codigo funciones Rellena y Busqueda [code=fw:1hnkvoui]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> Rellena<span style="color: #000000;">&#40;</span> oVar1 <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cValor<br />&nbsp; &nbsp;cValor := oVar1:<span style="color: #000000;">cText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Recupera el valor del Objeto Get</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> cValor <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cValor := PadL<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cValor <span style="color: #000000;">&#41;</span>, Len<span style="color: #000000;">&#40;</span> cValor <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oVar1:<span style="color: #000000;">cText</span><span style="color: #000000;">&#40;</span> cValor <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Asigna el valor con Ceros al objeto Get</span><br />&nbsp; &nbsp; &nbsp; oVar1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// le indico al objeto Get, que se vuelva a pintar</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> .T.<br /><br /><span style="color: #B900B9;">// ------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Busqueda<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> xVret<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oDlg, oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oRad, oBusqueda, oSayCodigo, oSayNombre<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nRad, cBusqueda<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oDbf<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> lanzaEdit, lanzaAdd<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cBloqueEdit, cBloqueAdd, bBloqueEdit, bBloqueAdd<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cIndice := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> -><span style="color: #000000;">&#40;</span> ordSetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;dbSelectArea<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;DATABASE oDbf<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"BUSCAR"</span> ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Buscar Registro"</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// El alias puede ser Prov,Art,Trab,Obr. Hay que adaptarlo a los alias a buscar</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> cAlias = <span style="color: #ff0000;">"Prov"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lanzaEdit := <span style="color: #ff0000;">"EditProve(.F.)"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lanzaAdd := <span style="color: #ff0000;">"EditProve(.T.)"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> cAlias = <span style="color: #ff0000;">"Obr"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lanzaEdit := <span style="color: #ff0000;">"EditObras(.F.)"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lanzaAdd := <span style="color: #ff0000;">"EditObras(.T.)"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> cAlias = <span style="color: #ff0000;">"Trab"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lanzaEdit := <span style="color: #ff0000;">"EditTraba(.F.)"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lanzaAdd := <span style="color: #ff0000;">"EditTraba(.T.)"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> cAlias = <span style="color: #ff0000;">"Art"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lanzaEdit := <span style="color: #ff0000;">"EditArti(.F.)"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lanzaAdd := <span style="color: #ff0000;">"EditArti(.T.)"</span><br />&nbsp; &nbsp;END <span style="color: #00C800;">CASE</span><br />&nbsp; &nbsp;cBloqueEdit := <span style="color: #ff0000;">"{ |oBrw| "</span> + lanzaEdit + <span style="color: #ff0000;">",oBrw:Refresh(),oBrw:SetFocus() }"</span><br />&nbsp; &nbsp;cBloqueAdd := <span style="color: #ff0000;">"{ |oBrw| "</span> + lanzaAdd + <span style="color: #ff0000;">",oBrw:Refresh(),oBrw:SetFocus() }"</span><br />&nbsp; &nbsp;bBloqueEdit := &<span style="color: #000000;">&#40;</span> cBloqueEdit <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;bBloqueAdd := &<span style="color: #000000;">&#40;</span> cBloqueAdd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;nRad := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nRad := <span style="color: #000000;">2</span><br /><br />&nbsp; <span style="color: #B900B9;">/* oDbf:SetOrder(2)<br />&nbsp; &nbsp;cBusqueda:=SPACE(15) */</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSayCodigo <span style="color: #0000ff;">PROMPT</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nRad == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Codigo"</span>, <span style="color: #ff0000;">"Nombre"</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">99</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_GREEN <span style="color: #0000ff;">UPDATE</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSayNombre <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Nombre <span style="color: #0000ff;">ID</span> <span style="color: #000000;">98</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_RED <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oBusqueda <span style="color: #0000ff;">VAR</span> cBusqueda <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span> &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">Assign</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, IIf<span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">SEEK</span><span style="color: #000000;">&#40;</span> cBusqueda <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">UpStable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, &nbsp;<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">RADIO</span> oRad <span style="color: #0000ff;">VAR</span> nRad <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span>, <span style="color: #000000;">103</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nRad == <span style="color: #000000;">1</span>, <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, cBusqueda := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, cBusqueda := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBusqueda:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp;;<br />&nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nRad == <span style="color: #000000;">1</span>, oSayCodigo := <span style="color: #ff0000;">"Codigo"</span>, oSayCodigo := <span style="color: #ff0000;">"Nombre"</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">109</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ADD1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> Eval<span style="color: #000000;">&#40;</span> bBloqueAdd, oBrw <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Añadir egistros"</span> NOBORDER <span style="color: #B900B9;">// Añade un registro</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">108</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EDIT1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> Eval<span style="color: #000000;">&#40;</span> bBloqueEdit, oBrw <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Modificar registros"</span> NOBORDER &nbsp;<span style="color: #B900B9;">// Modifica un regitro</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"SELECT1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Seleccionar registro"</span> NOBORDER <span style="color: #B900B9;">// Selecciona</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">105</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EXIT3"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Abandona busqueda"</span> NOBORDER<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> oBrw FIELDS oDbf:<span style="color: #000000;">Codigo</span>, oDbf:<span style="color: #000000;">Nombre</span> ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">Alias</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span> HEADERS <span style="color: #ff0000;">"CODIGO"</span>, <span style="color: #ff0000;">"NOMBRE"</span> ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> oSayNombre := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Nombre, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ON</span> DBLCLICK <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ID</span> <span style="color: #000000;">106</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">Gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bSkip</span> = <span style="color: #000000;">&#123;</span> | nRecs | oDbf:<span style="color: #000000;">Skipper</span><span style="color: #000000;">&#40;</span> nRecs <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nLineStyle</span> := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// ( Puede asumir valores 0 a 10 ) 1,3</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey | IIf<span style="color: #000000;">&#40;</span> nKey = <span style="color: #000000;">13</span>, <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, cBusqueda := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span>, oBusqueda:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> -><span style="color: #000000;">&#40;</span> ordSetFocus<span style="color: #000000;">&#40;</span> cIndice <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> <span style="color: #000000;">&#40;</span> xVret <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// -------------------------------------------------------------------------</span><br /><br />&nbsp;</div>[/code:1hnkvoui] y el codigo del del dialogo que debes incluir a tu .RC [code=fw:1hnkvoui]<div class="fw" id="{CB}" style="font-family: monospace;"><br />LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN<br />BUSCAR <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">26</span>, <span style="color: #000000;">47</span>, <span style="color: #000000;">274</span>, <span style="color: #000000;">173</span><br /><span style="color: #0000ff;">STYLE</span> DS_3DLOOK | DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU<br />CAPTION <span style="color: #ff0000;">"LOCALIZACION REGISTRO"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">10</span>, <span style="color: #ff0000;">"Arial"</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; EDITTEXT &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">100</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">32</span>, <span style="color: #000000;">204</span>, <span style="color: #000000;">12</span>, WS_GROUP, WS_EX_LEFT<br />&nbsp; &nbsp; CONTROL &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">""</span>, <span style="color: #000000;">106</span>, <span style="color: #ff0000;">"TWBrowse"</span>, 0x50A30000, <span style="color: #000000;">0</span>, <span style="color: #000000;">68</span>, <span style="color: #000000;">268</span>, <span style="color: #000000;">102</span>, 0x00000000<br />&nbsp; &nbsp; AUTORADIOBUTTON <span style="color: #ff0000;">"Código"</span>, <span style="color: #000000;">102</span>, <span style="color: #000000;">224</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">36</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span>, WS_EX_LEFT<br />&nbsp; &nbsp; AUTORADIOBUTTON <span style="color: #ff0000;">"Nombre"</span>, <span style="color: #000000;">103</span>, <span style="color: #000000;">224</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">36</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span>, WS_EX_LEFT<br />&nbsp; &nbsp; GROUPBOX &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Busqueda"</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">219</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">49</span>, <span style="color: #000000;">63</span>, <span style="color: #000000;">0</span>, WS_EX_LEFT<br />&nbsp; &nbsp; LTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"."</span>, <span style="color: #000000;">99</span>, <span style="color: #000000;">79</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">69</span>, <span style="color: #000000;">8</span>, NOT WS_GROUP | SS_LEFT, WS_EX_LEFT<br />&nbsp; &nbsp; LTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">""</span>, <span style="color: #000000;">98</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">121</span>, <span style="color: #000000;">8</span>, NOT WS_GROUP | SS_LEFT, WS_EX_LEFT<br />&nbsp; &nbsp; LTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Búsqueda por :"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">51</span>, <span style="color: #000000;">9</span>, NOT WS_GROUP | SS_LEFT, WS_EX_LEFT<br />&nbsp; &nbsp; GROUPBOX &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">""</span>, <span style="color: #000000;">4001</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">213</span>, <span style="color: #000000;">64</span>, <span style="color: #000000;">0</span>, WS_EX_LEFT<br />&nbsp; &nbsp; PUSHBUTTON &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">""</span>, <span style="color: #000000;">109</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">14</span>, BS_BITMAP, WS_EX_LEFT<br />&nbsp; &nbsp; PUSHBUTTON &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">""</span>, <span style="color: #000000;">108</span>, <span style="color: #000000;">28</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">14</span>, BS_BITMAP, WS_EX_LEFT<br />&nbsp; &nbsp; PUSHBUTTON &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">""</span>, <span style="color: #000000;">104</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">14</span>, BS_BITMAP, WS_EX_LEFT<br />&nbsp; &nbsp; PUSHBUTTON &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">""</span>, <span style="color: #000000;">105</span>, <span style="color: #000000;">68</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">14</span>, BS_BITMAP, WS_EX_LEFT<br /><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:1hnkvoui] Posdata, si quieres los bitmaps te los puedo enviar pero puedes usar los de tu eleccion eso no es problema. Ya te digo que este tema es mejorable pero a mi me funciona. Un saludo Jose
Cargar un Browse desde GET..ACTION..
[quote="jvtecheto":1rddt391]Hola amigo: Yo utilizo algo como lo que pides, pero a ver como te lo explico. Lo intento... Este es el codigo del GET que tiene un bitmap (como puedes comprobar) tambien tengo en cuenta si el usuario pulsa simplemente Enter que se lance la busqueda del codigo, tambien que pulse la tecla + , utilizo en ello dos funciones una trivial rellena() en la cual relleno automaticamente con ceros a la izquierda , la puedes desechar si quieres y luego la de la busqueda en si que es un dialogo en el que se muestra el browse y permite buscar. Se podria mejorar muchisimo con busqueda incremental, no lo he conseguido nunca desde un dialogo, tambien el codigo sera muy mejorable, pero a mi me funciona. Ah veras que utilizo listbox en vez de XBrowse , no he conseguido nunca colocar los botones arriba del Xbrowse y que se vean bien, lo tengo pendiente, puedes probar tu. Tambien veras que en la funciona hay uN DO CASE, ya que utilizo el mismo dialogo para todas las tablas que busco, ajusta tu, tus alias y las tablas que quieres buscar A ver por partes. codigo del GET [code=fw:1rddt391]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oObra <span style="color: #0000ff;">VAR</span> cObra <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> BITMAP <span style="color: #ff0000;">"OBRAS1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999"</span> ;<br />   <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cObra := Busqueda<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>, oInicio:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />   <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> Rellena<span style="color: #000000;">&#40;</span> oObra <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> .AND. ;<br />   <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> Obr-><span style="color: #000000;">&#40;</span> dbSeek<span style="color: #000000;">&#40;</span> cObra <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span>, ;<br />         <span style="color: #000000;">&#40;</span> cObra := Busqueda<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Obr"</span> <span style="color: #000000;">&#41;</span>, oSayObra:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oInicio:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">UPDATE</span><br /><br />   oObra:<span style="color: #000000;">bGotfocus</span> := <span style="color: #000000;">&#123;</span> || oWndMain:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Codigo de obra.Tecla <+> permite buscar"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oObra:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey | IIf<span style="color: #000000;">&#40;</span> nKey = VK_ADD, <span style="color: #000000;">&#40;</span> cObra := Busqueda<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Obr"</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oInicio:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /> </div>[/code:1rddt391] Codigo funciones Rellena y Busqueda [code=fw:1rddt391]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> Rellena<span style="color: #000000;">&#40;</span> oVar1 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> cValor<br />   cValor := oVar1:<span style="color: #000000;">cText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Recupera el valor del Objeto Get</span><br />   <span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> cValor <span style="color: #000000;">&#41;</span><br />      cValor := PadL<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cValor <span style="color: #000000;">&#41;</span>, Len<span style="color: #000000;">&#40;</span> cValor <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">&#41;</span><br />      oVar1:<span style="color: #000000;">cText</span><span style="color: #000000;">&#40;</span> cValor <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Asigna el valor con Ceros al objeto Get</span><br />      oVar1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// le indico al objeto Get, que se vuelva a pintar</span><br />   <span style="color: #00C800;">ENDIF</span><br />   <span style="color: #00C800;">RETURN</span> .T.<br /><br /><span style="color: #B900B9;">// ------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Busqueda<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> xVret<br />   <span style="color: #00C800;">LOCAL</span> oDlg, oBrw<br />   <span style="color: #00C800;">LOCAL</span> oRad, oBusqueda, oSayCodigo, oSayNombre<br />   <span style="color: #00C800;">LOCAL</span> nRad, cBusqueda<br />   <span style="color: #00C800;">LOCAL</span> oDbf<br />   <span style="color: #00C800;">LOCAL</span> lanzaEdit, lanzaAdd<br />   <span style="color: #00C800;">LOCAL</span> cBloqueEdit, cBloqueAdd, bBloqueEdit, bBloqueAdd<br />   <span style="color: #00C800;">LOCAL</span> cIndice := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> -><span style="color: #000000;">&#40;</span> ordSetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   dbSelectArea<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br />   DATABASE oDbf<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"BUSCAR"</span> ;<br />   <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Buscar Registro"</span><br /><br />   <span style="color: #B900B9;">// El alias puede ser Prov,Art,Trab,Obr. Hay que adaptarlo a los alias a buscar</span><br />   <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br />      <span style="color: #00C800;">CASE</span> cAlias = <span style="color: #ff0000;">"Prov"</span><br />         lanzaEdit := <span style="color: #ff0000;">"EditProve(.F.)"</span><br />         lanzaAdd := <span style="color: #ff0000;">"EditProve(.T.)"</span><br />      <span style="color: #00C800;">CASE</span> cAlias = <span style="color: #ff0000;">"Obr"</span><br />         lanzaEdit := <span style="color: #ff0000;">"EditObras(.F.)"</span><br />         lanzaAdd := <span style="color: #ff0000;">"EditObras(.T.)"</span><br />      <span style="color: #00C800;">CASE</span> cAlias = <span style="color: #ff0000;">"Trab"</span><br />         lanzaEdit := <span style="color: #ff0000;">"EditTraba(.F.)"</span><br />         lanzaAdd := <span style="color: #ff0000;">"EditTraba(.T.)"</span><br />      <span style="color: #00C800;">CASE</span> cAlias = <span style="color: #ff0000;">"Art"</span><br />         lanzaEdit := <span style="color: #ff0000;">"EditArti(.F.)"</span><br />         lanzaAdd := <span style="color: #ff0000;">"EditArti(.T.)"</span><br />   END <span style="color: #00C800;">CASE</span><br />   cBloqueEdit := <span style="color: #ff0000;">"{ |oBrw| "</span> + lanzaEdit + <span style="color: #ff0000;">",oBrw:Refresh(),oBrw:SetFocus() }"</span><br />   cBloqueAdd := <span style="color: #ff0000;">"{ |oBrw| "</span> + lanzaAdd + <span style="color: #ff0000;">",oBrw:Refresh(),oBrw:SetFocus() }"</span><br />   bBloqueEdit := &<span style="color: #000000;">&#40;</span> cBloqueEdit <span style="color: #000000;">&#41;</span><br />   bBloqueAdd := &<span style="color: #000000;">&#40;</span> cBloqueAdd <span style="color: #000000;">&#41;</span><br /><br />   nRad := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />   nRad := <span style="color: #000000;">2</span><br /><br />  <span style="color: #B900B9;">/* oDbf:SetOrder(2)<br />   cBusqueda:=SPACE(15) */</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSayCodigo <span style="color: #0000ff;">PROMPT</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nRad == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Codigo"</span>, <span style="color: #ff0000;">"Nombre"</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">99</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_GREEN <span style="color: #0000ff;">UPDATE</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSayNombre <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Nombre <span style="color: #0000ff;">ID</span> <span style="color: #000000;">98</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_RED <span style="color: #0000ff;">UPDATE</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oBusqueda <span style="color: #0000ff;">VAR</span> cBusqueda <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />   <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span>  <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">Assign</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, IIf<span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">SEEK</span><span style="color: #000000;">&#40;</span> cBusqueda <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">UpStable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,  <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">RADIO</span> oRad <span style="color: #0000ff;">VAR</span> nRad <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span>, <span style="color: #000000;">103</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />   <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nRad == <span style="color: #000000;">1</span>, <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, cBusqueda := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, cBusqueda := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBusqueda:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>  ;<br />   <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nRad == <span style="color: #000000;">1</span>, oSayCodigo := <span style="color: #ff0000;">"Codigo"</span>, oSayCodigo := <span style="color: #ff0000;">"Nombre"</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">UPDATE</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">109</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ADD1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> Eval<span style="color: #000000;">&#40;</span> bBloqueAdd, oBrw <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Añadir egistros"</span> NOBORDER <span style="color: #B900B9;">// Añade un registro</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">108</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EDIT1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> Eval<span style="color: #000000;">&#40;</span> bBloqueEdit, oBrw <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Modificar registros"</span> NOBORDER  <span style="color: #B900B9;">// Modifica un regitro</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"SELECT1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Seleccionar registro"</span> NOBORDER <span style="color: #B900B9;">// Selecciona</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">105</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EXIT3"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> TOOLTIP <span style="color: #ff0000;">"Abandona busqueda"</span> NOBORDER<br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> oBrw FIELDS oDbf:<span style="color: #000000;">Codigo</span>, oDbf:<span style="color: #000000;">Nombre</span> ;<br />   <span style="color: #0000ff;">Alias</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span> HEADERS <span style="color: #ff0000;">"CODIGO"</span>, <span style="color: #ff0000;">"NOMBRE"</span> ;<br />   <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> oSayNombre := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Nombre, oDlg:<span style="color: #0000ff;">UPDATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />   <span style="color: #0000ff;">ON</span> DBLCLICK <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />   <span style="color: #0000ff;">ID</span> <span style="color: #000000;">106</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br />   oDbf:<span style="color: #000000;">Gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">bSkip</span> = <span style="color: #000000;">&#123;</span> | nRecs | oDbf:<span style="color: #000000;">Skipper</span><span style="color: #000000;">&#40;</span> nRecs <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oBrw:<span style="color: #000000;">nLineStyle</span> := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// ( Puede asumir valores 0 a 10 ) 1,3</span><br />   oBrw:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oBrw:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey | IIf<span style="color: #000000;">&#40;</span> nKey = <span style="color: #000000;">13</span>, <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, cBusqueda := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span>, oBusqueda:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />                                           <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> xVret := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> ->Codigo, <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> -><span style="color: #000000;">&#40;</span> ordSetFocus<span style="color: #000000;">&#40;</span> cIndice <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">&#40;</span> xVret <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// -------------------------------------------------------------------------</span><br /><br /> </div>[/code:1rddt391] y el codigo del del dialogo que debes incluir a tu .RC [code=fw:1rddt391]<div class="fw" id="{CB}" style="font-family: monospace;"><br />LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN<br />BUSCAR <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">26</span>, <span style="color: #000000;">47</span>, <span style="color: #000000;">274</span>, <span style="color: #000000;">173</span><br /><span style="color: #0000ff;">STYLE</span> DS_3DLOOK | DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU<br />CAPTION <span style="color: #ff0000;">"LOCALIZACION REGISTRO"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">10</span>, <span style="color: #ff0000;">"Arial"</span><br /><span style="color: #000000;">&#123;</span><br />    EDITTEXT        <span style="color: #000000;">100</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">32</span>, <span style="color: #000000;">204</span>, <span style="color: #000000;">12</span>, WS_GROUP, WS_EX_LEFT<br />    CONTROL         <span style="color: #ff0000;">""</span>, <span style="color: #000000;">106</span>, <span style="color: #ff0000;">"TWBrowse"</span>, 0x50A30000, <span style="color: #000000;">0</span>, <span style="color: #000000;">68</span>, <span style="color: #000000;">268</span>, <span style="color: #000000;">102</span>, 0x00000000<br />    AUTORADIOBUTTON <span style="color: #ff0000;">"Código"</span>, <span style="color: #000000;">102</span>, <span style="color: #000000;">224</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">36</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span>, WS_EX_LEFT<br />    AUTORADIOBUTTON <span style="color: #ff0000;">"Nombre"</span>, <span style="color: #000000;">103</span>, <span style="color: #000000;">224</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">36</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span>, WS_EX_LEFT<br />    GROUPBOX        <span style="color: #ff0000;">"Busqueda"</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">219</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">49</span>, <span style="color: #000000;">63</span>, <span style="color: #000000;">0</span>, WS_EX_LEFT<br />    LTEXT           <span style="color: #ff0000;">"."</span>, <span style="color: #000000;">99</span>, <span style="color: #000000;">79</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">69</span>, <span style="color: #000000;">8</span>, NOT WS_GROUP | SS_LEFT, WS_EX_LEFT<br />    LTEXT           <span style="color: #ff0000;">""</span>, <span style="color: #000000;">98</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">121</span>, <span style="color: #000000;">8</span>, NOT WS_GROUP | SS_LEFT, WS_EX_LEFT<br />    LTEXT           <span style="color: #ff0000;">"Búsqueda por :"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">51</span>, <span style="color: #000000;">9</span>, NOT WS_GROUP | SS_LEFT, WS_EX_LEFT<br />    GROUPBOX        <span style="color: #ff0000;">""</span>, <span style="color: #000000;">4001</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">213</span>, <span style="color: #000000;">64</span>, <span style="color: #000000;">0</span>, WS_EX_LEFT<br />    PUSHBUTTON      <span style="color: #ff0000;">""</span>, <span style="color: #000000;">109</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">14</span>, BS_BITMAP, WS_EX_LEFT<br />    PUSHBUTTON      <span style="color: #ff0000;">""</span>, <span style="color: #000000;">108</span>, <span style="color: #000000;">28</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">14</span>, BS_BITMAP, WS_EX_LEFT<br />    PUSHBUTTON      <span style="color: #ff0000;">""</span>, <span style="color: #000000;">104</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">14</span>, BS_BITMAP, WS_EX_LEFT<br />    PUSHBUTTON      <span style="color: #ff0000;">""</span>, <span style="color: #000000;">105</span>, <span style="color: #000000;">68</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">14</span>, BS_BITMAP, WS_EX_LEFT<br /><span style="color: #000000;">&#125;</span><br /> </div>[/code:1rddt391] Posdata, si quieres los bitmaps te los puedo enviar pero puedes usar los de tu eleccion eso no es problema. Ya te digo que este tema es mejorable pero a mi me funciona. Un saludo Jose[/quote:1rddt391] Jose, Muchisimas gracias por tomarte de tu tiempo y responderme tan detalladamente Voy a probar tu codigo y te estare comentando
Cargar un Browse desde GET..ACTION..
Lo que necesito es que por medio del boton llamar a un prg que contiene otro Browse. De ese brow se seleccionar un registro y con un click o Enter llenar el campo desde donde ejecute el boton del Get Espero haberme hecho entender
Cargar un Browse desde GET..ACTION..
Si eso lo hace el código que he adjuntado, adaptarlo a tus tablas y funciona, si pulsas enter, te la + o un código que no existe se abre el diálogo con el browse, eliges el registro y te lo coloca en el get Enviado desde mi POCOPHONE F1 mediante Tapatalk
Cargar un Browse desde GET..ACTION..
You may consider using the FWH built-in function PopupBrowse(), which is created for this purpose only. Source of the function is available in TGet.prg. Usage: [code=fw:1of1tc8e]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cState &nbsp; := PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"New York"</span>, <span style="color: #000000;">25</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oFont, oGet<br /><br />&nbsp; &nbsp;SetGetColorFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;USE STATES SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span> READONLY<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-16</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">450</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Get-PopUpBrowse"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"State Name :"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">24</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">140</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cState <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> PopUpBrowse<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"STATES"</span>, oGet, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">90</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"CHECK"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> cState <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1of1tc8e] [url=https&#58;//imageshack&#46;com/i/pmIUi3tRg:1of1tc8e][img:1of1tc8e]https&#58;//imagizer&#46;imageshack&#46;com/img922/797/IUi3tR&#46;gif[/img:1of1tc8e][/url:1of1tc8e]
Cargar un Browse desde GET..ACTION..
Hello Mr Rao and thanks This is a good apporach but I need to call another Browse in case if the row I'm looking for does not exist I can Add it fron the browser itself Please advise
Cargar un Browse desde GET..ACTION..
[code=fw:2maw6spw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">56</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> CNOMENECES &nbsp; &nbsp;<span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">76</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">UPDATE</span> COLORS CLR_BLACK, CLR_WHITE <span style="color: #0000ff;">FONT</span> oFont BITMAP <span style="color: #ff0000;">"BUSCAR"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> BUSCA_NECESSIDADES<span style="color: #000000;">&#40;</span> aGet <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">56</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cToolTip</span> := OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"<F7> - Cadastro de Necessidades"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">56</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lBtnTransparent</span> := .T. &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// transparent button</span><br />&nbsp; &nbsp;aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">56</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> |nKey| <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nKey == VK_F7, Eval<span style="color: #000000;">&#40;</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">56</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bAction</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:2maw6spw] Regards, saludos.
Cargar valores de un DSN en un arreglo
Hola, Como puedo cargar los valores de un DSN en una arregle, para luego asignarlos a una variable algo asi como esto: xDSN := CARGADSN() en la funcion deberia hacerse el arreglo Atento a sus comentarios
Cargar y mostrar un archivo PDF RESUELTO
Amigos foreros: Es posible cargar una archivo .PDF y mostrarlo en una dialogo?, he buscado aquí en el foro pero los ejemplos son con .BMP, .JPG, etc., cuando trato de ajustarlo a .PDFs no lo logro. Saludos
Cargar y mostrar un archivo PDF RESUELTO
Hola espero te sea útil <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> [code=fw:37saaj9g]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> VerPDFF<span style="color: #000000;">&#40;</span>cFichero<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> oDlg,cFicheroo,oActiveX<br /><br />oQry := TDolphinQry<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT * FROM polizario order by archivo"</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"DIALOGPDF"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"POLIZA EN FORMATO PDF--->"</span>+<span style="color: #ff0000;">" "</span>+ oQry:<span style="color: #000000;">poliza</span><br />oDlg:<span style="color: #000000;">lHelpIcon</span>:=.F.<br /><span style="color: #0000ff;">REDEFINE</span> ACTIVEX oActiveX <span style="color: #0000ff;">ID</span> <span style="color: #000000;">800</span> <span style="color: #0000ff;">OF</span> oDlg PROGID <span style="color: #ff0000;">"AcroPDF.PDF.1"</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg &nbsp;<span style="color: #0000ff;">CENTERED</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oActiveX&#<span style="color: #000000;">058</span>;Do<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"LoadFile"</span>, ALLTRIM<span style="color: #000000;">&#40;</span>cFichero<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,oActiveX&#<span style="color: #000000;">058</span>;Do<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SetCurrentPage"</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//NOMODAL</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:37saaj9g]
Cargar y mostrar un archivo PDF RESUELTO
Aida: Gracias por el ejemplo, sería posible ver los recursos del mismo?, me interesa ver que control usas para el ActiveX. Uso PellesC. Necesito alguna DLL o algo más? Saludos
Cargar y mostrar un archivo PDF RESUELTO
Mira se ayuda: [code=fw:xh5kn727]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// USANDO o ADOBE READER - 25/11/2013 - DIRETO VIA FIVEWIN 13.06</span><br /><br /><span style="color: #00C800;">FUNCTION</span> ShowPDF_READER<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> <br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oWndPdf, oPdf, cTmp, NFEVisualSUM, nNumNfeSUM, nRecNo, oTaskP<br /><br />&nbsp; &nbsp;nRecNo &nbsp; &nbsp; := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//-> CCE.DBF</span><br />&nbsp; &nbsp;GoTo<span style="color: #000000;">&#40;</span> nRecNo <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;nNumNfeSUM := VAL<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->CHAVE, <span style="color: #000000;">29</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;NFEVisualSUM := <span style="color: #ff0000;">"C:<span style="color: #000000;">\N</span>FEPDF<span style="color: #000000;">\"</span>+"</span>CCE<span style="color: #ff0000;">"+ALLTRIM( STR( nNumNfeSUM ) )+"</span>.PDF<span style="color: #ff0000;">"<br /><br />&nbsp; &nbsp;MsgWait( "</span>LOCALIZANDO O ARQUIVO DA CARTA DE CORRECAO<span style="color: #ff0000;">", ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "</span>AGUARDE UM MOMENTO POR FAVOR... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">", 1.5 )<br /><br />&nbsp; &nbsp;// USANDO ADOBE READER DIRETO VIA CODIGO - ACTIVEX DO FWH13.06 - 26/11/2013<br />&nbsp; &nbsp;IF .NOT. FILE( NFEVisualSUM ) &nbsp;<br /><br />&nbsp; &nbsp; &nbsp; RETURN NIL<br /><br />&nbsp; &nbsp;ENDIF<br /><br />&nbsp; &nbsp;DEFINE WINDOW oWndPdf TITLE "</span>FiveWin ActiveX Support - Visualizar/Imprimir o *.PDF Usando o Adobe Reader<span style="color: #ff0000;">"<br /><br />&nbsp; &nbsp;oPdf := TActiveX():New( oWndPdf, "</span>AcroPDF.PDF<span style="color: #000000;">.1</span><span style="color: #ff0000;">" )<br /><br />&nbsp; &nbsp;oWndPdf:oClient := oPdf<br /><br />&nbsp; &nbsp;oPdf : src = NFEVisualSUM<br /><br />&nbsp; &nbsp;// Mostra Preview Pequeno no lado esquerdo da tela...<br />&nbsp; &nbsp;// oPdf:Do( "</span>SetPageMode<span style="color: #ff0000;">", "</span>thumbnail and pages<span style="color: #ff0000;">" )<br /><br />&nbsp; &nbsp;oPdf:SetProp( "</span>Src<span style="color: #ff0000;">", cTmp )<br /><br />&nbsp; &nbsp;oPdf:Do( "</span>LoadFile<span style="color: #ff0000;">", Lfn2Sfn(cTmp) )<br /><br />&nbsp; &nbsp;oPdf:Do( "</span>GetVersions<span style="color: #ff0000;">" )<br /><br />&nbsp; &nbsp;oPdf:Do( "</span>SetCurrentPage<span style="color: #ff0000;">", 1 )<br /><br />&nbsp; &nbsp;// oPdf:Print() // Nao funciona direto na impressora..<br /><br />&nbsp; &nbsp;// Mostra a Barra de Botoes do ADOBE READER<br />&nbsp; &nbsp;oPdf:Do( "</span>SetShowToolbar<span style="color: #ff0000;">", .T. )<br /><br />&nbsp; &nbsp;// Liga/Desliga barra de Scroll do lado direto do Adobe Reader<br />&nbsp; &nbsp;oPdf:Do( "</span>SetShowScrollbars<span style="color: #ff0000;">", .T. ) &nbsp;// Liga/Desliga Scroll<br /><br />&nbsp; &nbsp;ACTIVATE WINDOW oWndPdf MAXIMIZED &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON INIT( PDFActivex( oPdf ) ) ; &nbsp;// EM CARTA.PRG<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VALID( oWndPdf := NIL, oPdf:End(), .T. )<br /><br />RETURN NIL<br /><br />FUNCTION PDFActivex( MyProgID )<br /><br />&nbsp; &nbsp;LOCAL adretor := .T.<br />&nbsp;<br />&nbsp; &nbsp;if IsActivex( "</span>PDF.PdfCtrl<span style="color: #000000;">.1</span><span style="color: #ff0000;">" ); MyProgID := "</span>PDF.PdfCtrl<span style="color: #000000;">.1</span><span style="color: #ff0000;">"; endif<br />&nbsp; &nbsp;if IsActivex( "</span>PDF.PdfCtrl<span style="color: #000000;">.2</span><span style="color: #ff0000;">" ); MyProgID := "</span>PDF.PdfCtrl<span style="color: #000000;">.2</span><span style="color: #ff0000;">"; endif<br />&nbsp; &nbsp;if IsActivex( "</span>PDF.PdfCtrl<span style="color: #000000;">.3</span><span style="color: #ff0000;">" ); MyProgID := "</span>PDF.PdfCtrl<span style="color: #000000;">.3</span><span style="color: #ff0000;">"; endif<br />&nbsp; &nbsp;if IsActivex( "</span>PDF.PdfCtrl<span style="color: #000000;">.4</span><span style="color: #ff0000;">" ); MyProgID := "</span>PDF.PdfCtrl<span style="color: #000000;">.4</span><span style="color: #ff0000;">"; endif<br />&nbsp; &nbsp;if IsActivex( "</span>PDF.PdfCtrl<span style="color: #000000;">.5</span><span style="color: #ff0000;">" ); MyProgID := "</span>PDF.PdfCtrl<span style="color: #000000;">.5</span><span style="color: #ff0000;">"; endif<br />&nbsp; &nbsp;if IsActivex( "</span>PDF.PdfCtrl<span style="color: #000000;">.6</span><span style="color: #ff0000;">" ); MyProgID := "</span>PDF.PdfCtrl<span style="color: #000000;">.6</span><span style="color: #ff0000;">"; endif<br />&nbsp; &nbsp;if IsActivex( "</span>PDF.PdfCtrl<span style="color: #000000;">.7</span><span style="color: #ff0000;">" ); MyProgID := "</span>PDF.PdfCtrl<span style="color: #000000;">.7</span><span style="color: #ff0000;">"; endif<br />&nbsp; &nbsp;if IsActivex( "</span>acroPDF.PDF<span style="color: #000000;">.1</span><span style="color: #ff0000;">" ); MyProgID := "</span>acroPDF.PDF<span style="color: #000000;">.1</span><span style="color: #ff0000;">"; endif<br />&nbsp; &nbsp;if IsActivex( "</span>acroPDF.PDF<span style="color: #000000;">.2</span><span style="color: #ff0000;">" ); MyProgID := "</span>acroPDF.PDF<span style="color: #000000;">.2</span><span style="color: #ff0000;">"; endif<br /><br />&nbsp; &nbsp;IF Empty( MyProgID )<br /><br />&nbsp; &nbsp; &nbsp; MsgInfo( "</span>PDF Activex não instalado !!!<span style="color: #ff0000;">"+CRLF+"</span> É necessário que seja instalado o programa ADOBE READER, consulte o suporte <span style="color: #00C800;">do</span> sistema.<span style="color: #ff0000;">",.F.)<br /><br />&nbsp; &nbsp; &nbsp; adretor := .F.<br /><br />&nbsp; &nbsp;ENDIF<br /><br />RETURN(adretor)<br /></span></div>[/code:xh5kn727] 
Cargar y mostrar un archivo PDF RESUELTO
Karinha: Muchas gracias por el ejemplo, estoy ajustándolo a mis necesidades pero me tira un error Este es el código modificado: [code=fw:37w65kcp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ShowPDF_READER<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> oWndPdf, oPdf, cTmp, cFilePdf<br /><br />   cFilePdf := oApp:<span style="color: #000000;">cPathAdj</span> + ALLTRIM<span style="color: #000000;">&#40;</span>oRsAdj:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADJ_FIL"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// Tomo el nombre del archivo PDF de una tabla</span><br /><br />    <span style="color: #00C800;">IF</span> .NOT. FILE<span style="color: #000000;">&#40;</span>cFilePdf<span style="color: #000000;">&#41;</span><br />        <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No existe el archivo que desea mostrar !"</span>,oApp:<span style="color: #000000;">cAlicacion</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndPdf <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Soporte ActiveX - Visualizar un achivo  *.PDF Usando Adobe Reader"</span><br />       oPdf := TActiveX<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oWndPdf, <span style="color: #ff0000;">"AcroPDF.PDF.1"</span> <span style="color: #000000;">&#41;</span><br /><br />       oWndPdf:<span style="color: #000000;">oClient</span> := oPdf<br /><br />        oPdf:<span style="color: #000000;">Src</span> := cFilePdf<br /><br />        <span style="color: #B900B9;">// Muestra una vista previa pequeña en el lado izquierdo de la ventana</span><br />        <span style="color: #B900B9;">// oPdf:Do( "SetPageMode", "thumbnail and pages" )</span><br /><br />        oPdf:<span style="color: #000000;">SetProp</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Src"</span>, cTmp <span style="color: #000000;">&#41;</span><br />        oPdf:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"LoadFile"</span>, Lfn2Sfn<span style="color: #000000;">&#40;</span>cTmp<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        oPdf:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"GetVersions"</span> <span style="color: #000000;">&#41;</span><br />        oPdf:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SetCurrentPage"</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />        <span style="color: #B900B9;">// Muestra la barra de botones de ADOBE READER</span><br />        oPdf:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SetShowToolbar"</span>, .T. <span style="color: #000000;">&#41;</span><br /><br />        <span style="color: #B900B9;">// Liga/Desliga barra de Scroll do lado direto do Adobe Reader</span><br />        oPdf:<span style="color: #00C800;">Do</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SetShowScrollbars"</span>, .T. <span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// Liga/Desliga Scroll</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWndPdf <span style="color: #0000ff;">MAXIMIZED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">&#40;</span>PDFActivex<span style="color: #000000;">&#40;</span> oPdf <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">VALID</span><span style="color: #000000;">&#40;</span>oWndPdf := <span style="color: #00C800;">NIL</span>, oPdf:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #B900B9;">/*<br />============================================================================<br />============================================================================<br />*/</span><br /><span style="color: #00C800;">FUNCTION</span> PDFActivex<span style="color: #000000;">&#40;</span> MyProgID <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PDF.PdfCtrl.1"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"PDF.PdfCtrl.1"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PDF.PdfCtrl.2"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"PDF.PdfCtrl.2"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PDF.PdfCtrl.3"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"PDF.PdfCtrl.3"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PDF.PdfCtrl.4"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"PDF.PdfCtrl.4"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PDF.PdfCtrl.5"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"PDF.PdfCtrl.5"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PDF.PdfCtrl.6"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"PDF.PdfCtrl.6"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PDF.PdfCtrl.7"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"PDF.PdfCtrl.7"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"acroPDF.PDF.1"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"acroPDF.PDF.1"</span>; <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> IsActivex<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"acroPDF.PDF.2"</span> <span style="color: #000000;">&#41;</span>; MyProgID := <span style="color: #ff0000;">"acroPDF.PDF.2"</span>; <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> MyProgID <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PDF Activex no instalado !"</span> + CRLF + <span style="color: #ff0000;">" Es necesario que sea instalado el programa ADOBE READER, consulte a suporte de sistemas."</span>,oApp:<span style="color: #000000;">cAplicacion</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /> </div>[/code:37w65kcp] Y este es parte del error.log: [code=fw:37w65kcp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Application<br />===========<br />   Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\SarWin\SarWin.Exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">2</span>,<span style="color: #000000;">048</span>,<span style="color: #000000;">512</span> bytes<br />   Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">11</span> secs <br />   Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">26</span>/<span style="color: #000000;">02</span>/<span style="color: #000000;">2014</span>, <span style="color: #000000;">11</span>:<span style="color: #000000;">24</span>:<span style="color: #000000;">46</span><br />   Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1005</span>  <span style="color: #0000ff;">Message</span> not found: <span style="color: #000000;">TACTIVEX</span>&#<span style="color: #000000;">058</span>;_SRC<br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\rtl\tobject.prg => TACTIVEX&#<span style="color: #000000;">058</span>;ERROR<span style="color: #000000;">&#40;</span><span style="color: #000000;">172</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\rtl\tobject.prg => TACTIVEX&#<span style="color: #000000;">058</span>;MSGNOTFOUND<span style="color: #000000;">&#40;</span><span style="color: #000000;">205</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\rtl\tobject.prg => TACTIVEX&#<span style="color: #000000;">058</span>;_SRC<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\SarWin\Source\SarWin1b.Prg => SHOWPDF_READER<span style="color: #000000;">&#40;</span><span style="color: #000000;">1039</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\SarWin\Source\SarWin1b.Prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>EDITAR<span style="color: #000000;">&#40;</span><span style="color: #000000;">652</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #000000;">LDBLCLICK</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">LDBLCLICK</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">XBROWSE</span>.PRG => TXBROWSE:<span style="color: #000000;">LDBLCLICK</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOX<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\SarWin\Source\SarWin1b.Prg => EDITAR<span style="color: #000000;">&#40;</span><span style="color: #000000;">688</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\SarWin\Source\SarWin1b.Prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>LABARRA<span style="color: #000000;">&#40;</span><span style="color: #000000;">462</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #0000ff;">CLICK</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">LBUTTONUP</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => WINRUN<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TMDIFRAME:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\SarWin\Source\SarWin.Prg => MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">125</span><span style="color: #000000;">&#41;</span><br /><br />System<br />======<br />   CPU type: <span style="color: #000000;">Intel</span><span style="color: #000000;">&#40;</span>R<span style="color: #000000;">&#41;</span> Pentium<span style="color: #000000;">&#40;</span>R<span style="color: #000000;">&#41;</span> CPU G645 @ <span style="color: #000000;">2</span>.90GHz <span style="color: #000000;">2900</span> Mhz<br />   Hardware memory: <span style="color: #000000;">-311</span> megs<br /><br />   Free System resources: <span style="color: #000000;">90</span> %<br />        GDI    resources: <span style="color: #000000;">90</span> %<br />        User   resources: <span style="color: #000000;">90</span> %<br /><br />   Compiler version: <span style="color: #000000;">xHarbour</span> build <span style="color: #000000;">1.1</span><span style="color: #000000;">.0</span> Intl. <span style="color: #000000;">&#40;</span>SimpLex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>Rev. <span style="color: #000000;">6195</span><span style="color: #000000;">&#41;</span><br />   Windows version: <span style="color: #000000;">6.2</span>, Build <span style="color: #000000;">9200</span> <br /><br />   Windows total applications running: <span style="color: #000000;">60</span><br />      <span style="color: #000000;">1</span> MSCTFIME UI<br />      <span style="color: #000000;">2</span> <span style="color: #00C800;">Default</span> IME<br />      <span style="color: #000000;">3</span> GDI+ <span style="color: #0000ff;">Window</span><br />      <span style="color: #000000;">4</span> Conmutación de tareas<br />      <span style="color: #000000;">5</span> RFLed<br />      <span style="color: #000000;">6</span> HPBeatsOSD<br />      <span style="color: #000000;">7</span> Network Flyout<br />      <span style="color: #000000;">8</span> Adobe Reader<br />      <span style="color: #000000;">9</span> Soporte ActiveX - Visualizar un achivo  *.PDF Usando Adobe Reader<br />     <span style="color: #000000;">10</span> sw<br />     <span style="color: #000000;">11</span> DDE <span style="color: #00C800;">Server</span> <span style="color: #0000ff;">Window</span><br />     <span style="color: #000000;">12</span> transport <span style="color: #0000ff;">Window</span><br />     <span style="color: #000000;">13</span> _acroT_win<br />     <span style="color: #000000;">14</span> _acroS_win<br />     <span style="color: #000000;">15</span> Consulta a solicitud<br />     <span style="color: #000000;">16</span> © <span style="color: #000000;">2014</span> Sistema para Administrar Requisiciones Build <span style="color: #000000;">26</span>/Feb/<span style="color: #000000;">2014</span> localhost<br />     <span style="color: #000000;">17</span> xMate - C:\SarWin\SarWin.xhp<br />     <span style="color: #000000;">18</span> MED CX - <span style="color: #000000;">&#91;</span>C:\SarWin\Source\SarWin1b.Prg<span style="color: #000000;">&#93;</span><br />     <span style="color: #000000;">19</span> Debug <span style="color: #0000ff;">window</span> C:\SarWin\SarWin.Exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span> errors, <span style="color: #000000;">0</span> warnings<span style="color: #000000;">&#41;</span><br />     <span style="color: #000000;">20</span> Skype™ - <!-- e --><a href="mailto:aresbu@outlook.com">aresbu@outlook.com</a><!-- e --><br />     <span style="color: #000000;">21</span> <span style="color: #000000;">100</span>% completado<br />     <span style="color: #000000;">22</span> JavaUpdate SysTray <span style="color: #0000ff;">Icon</span><br />     <span style="color: #000000;">23</span> CWNPTransportImpl<br />     <span style="color: #000000;">24</span> DPHelper<br />     <span style="color: #000000;">25</span> WinAMRestoreWnd<br />     <span style="color: #000000;">26</span> HelperMsgListenerWnd<br />     <span style="color: #000000;">27</span> About<br />     <span style="color: #000000;">28</span> LED HOTKEY SETUP-HPID09<br />     <span style="color: #000000;">29</span> LED HOTKEY KEYBOARD-HPID09<br />     <span style="color: #000000;">30</span> HIDUSBKEYMSG<br />     <span style="color: #000000;">31</span> PDI_Status_Indicator_Window<br />     <span style="color: #000000;">32</span> PDI_DTPopupMgr_Wnd<br />     <span style="color: #000000;">33</span> BATTERY INDICATOR - HPID09<br />     <span style="color: #000000;">34</span> OSD Manager<br />     <span style="color: #000000;">35</span> HIDList <span style="color: #000000;">2.20</span><span style="color: #000000;">.00</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">Release</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #000000;">36</span> CLML <span style="color: #0000ff;">Window</span><br />     <span style="color: #000000;">37</span> C:\Users\Armando\AppData\Roaming\Skype<br />     <span style="color: #000000;">38</span> Microsoft Office OneNote <span style="color: #000000;">2007</span> - Barra de tareas de Windows<br />     <span style="color: #000000;">39</span> Sigmatel-IDT-SysTray<br />     <span style="color: #000000;">40</span> PersistWndName<br />     <span style="color: #000000;">41</span> HkWndName<br />     <span style="color: #000000;">42</span> MS_WebcheckMonitor<br />     <span style="color: #000000;">43</span> BluetoothNotificationAreaIconWindowClass<br />     <span style="color: #000000;">44</span> Windows Push Notifications Platform<br />     <span style="color: #000000;">45</span> Medidor de la batería<br />     <span style="color: #000000;">46</span> Microsoft-Windows-CDesktopAppSpaceElement-4BF42B71-EA88-489E-917F-495A116C3596<br />     <span style="color: #000000;">47</span> FWSesAlWndTitle<br />     <span style="color: #000000;">48</span> SYM_AVPAPP_WINDOW_NAME_<span style="color: #000000;">&#123;</span>1BE293D4-E7AD<span style="color: #000000;">-4314</span>-B8C9-C088A7CC1E69<span style="color: #000000;">&#125;</span><br />     <span style="color: #000000;">49</span> <span style="color: #000000;">&#123;</span>2E534F4D-897B-467E-92EF-604ABD3D1C5D<span style="color: #000000;">&#125;</span><br />     <span style="color: #000000;">50</span> ccSvcHst<br />     <span style="color: #000000;">51</span> Task Host <span style="color: #0000ff;">Window</span><br />     <span style="color: #000000;">52</span> EXPLORER<br />     <span style="color: #000000;">53</span> HP My <span style="color: #00C800;">Display</span><br />     <span style="color: #000000;">54</span> <span style="color: #000000;">&#123;</span>94F11419-869E-47aa<span style="color: #000000;">-9563</span>-F48591285CAD<span style="color: #000000;">&#125;</span><br />     <span style="color: #000000;">55</span> IgfxExt_Wnd_Name<br />     <span style="color: #000000;">56</span> Portrait <span style="color: #00C800;">Display</span> SDK Helper <span style="color: #00C800;">for</span> <span style="color: #000000;">64</span> bits OS<br />     <span style="color: #000000;">57</span> HookManager<br />     <span style="color: #000000;">58</span> Malwarebytes Anti-Malware<br />     <span style="color: #000000;">59</span> DWM Notification <span style="color: #0000ff;">Window</span><br />     <span style="color: #000000;">60</span> Program Manager<br /><br />Variables in use<br />================<br />   Procedure     Type   Value<br />   ==========================<br />   TACTIVEX&#<span style="color: #000000;">058</span>;ERROR<br />     Param   <span style="color: #000000;">1</span>:    C    <span style="color: #ff0000;">"Message not found"</span><br />     Param   <span style="color: #000000;">2</span>:    C    <span style="color: #ff0000;">"TACTIVEX"</span><br />     Param   <span style="color: #000000;">3</span>:    C    <span style="color: #ff0000;">"_SRC"</span><br />     Param   <span style="color: #000000;">4</span>:    N    <span style="color: #000000;">1005</span><br />     <span style="color: #00C800;">Local</span>   <span style="color: #000000;">1</span>:    U    <br />     <span style="color: #00C800;">Local</span>   <span style="color: #000000;">2</span>:    O    <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TACTIVEX</span><br />     <span style="color: #00C800;">Local</span>   <span style="color: #000000;">3</span>:    N    <span style="color: #000000;">16</span><br />   TACTIVEX&#<span style="color: #000000;">058</span>;MSGNOTFOUND<br />     Param   <span style="color: #000000;">1</span>:    C    <span style="color: #ff0000;">"_SRC"</span><br />     Param   <span style="color: #000000;">2</span>:    O    <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TACTIVEX</span><br />   TACTIVEX&#<span style="color: #000000;">058</span>;_SRC<br />     Param   <span style="color: #000000;">1</span>:    C    <span style="color: #ff0000;">".<span style="color: #000000;">\A</span>djuntos<span style="color: #000000;">\F</span>ACTURA DV91790.PDF"</span><br />   SHOWPDF_READER<br />     <span style="color: #00C800;">Local</span>   <span style="color: #000000;">1</span>:    O    <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TWINDOW</span><br />     <span style="color: #00C800;">Local</span>   <span style="color: #000000;">2</span>:    O    <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TACTIVEX</span><br />     <span style="color: #00C800;">Local</span>   <span style="color: #000000;">3</span>:    U    <br />     <span style="color: #00C800;">Local</span>   <span style="color: #000000;">4</span>:    C    <span style="color: #ff0000;">".<span style="color: #000000;">\A</span>djuntos<span style="color: #000000;">\F</span>ACTURA DV91790.PDF"</span><br />   <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>EDITAR<br />     Param   <span style="color: #000000;">1</span>:    N    <span style="color: #000000;">39</span><br />     Param   <span style="color: #000000;">2</span>:    N    <span style="color: #000000;">94</span><br />     Param   <span style="color: #000000;">3</span>:    N    <span style="color: #000000;">1</span><br />     Param   <span style="color: #000000;">4</span>:    O    <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TXBROWSE</span><br /> </div>[/code:37w65kcp] Saludos
Cargar y mostrar un archivo PDF RESUELTO
? cFilePdf := oApp:cPathAdj + ALLTRIM(oRsAdj:Fields("ADJ_FIL"):Value) // Tomo el nombre del archivo PDF de una tabla Que retorna? Cual és tú versión de FiveWin? Esta function funciona bién con mi five FWH13.06. salu2.
Cargar y mostrar un archivo PDF RESUELTO
Karinha: ? cFilePdf := oApp:cPathAdj + ALLTRIM(oRsAdj:Fields("ADJ_FIL"):Value) // Tomo el nombre del archivo PDF de una tabla Que retorna? Regresa el nombre del archivo .PDF que deseo mostrar, (.\Adjuntos\Poliza Correcta.Pdf) y el archivo sí existe Cual és tú versión de FiveWin? FWH0810 Esta function funciona bién con mi five FWH13.06. Puede ser? Saludos
Cargar y mostrar un archivo PDF RESUELTO
Armando, Creo que tú versión no tenga soporte, porque la clase és nueva. Mira una posible solución: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=26565&p=146911&hilit=TACTIVEX%26%23058#p146911">viewtopic.php?f=6&t=26565&p=146911&hilit=TACTIVEX%26%23058#p146911</a><!-- l --> <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=25129&start=0&hilit=TACTIVEX%26amp%3B%23058">viewtopic.php?f=6&t=25129&start=0&hilit=TACTIVEX%26amp%3B%23058</a><!-- l --> <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=24359&start=0&hilit=TACTIVEX%26amp%3B%23058">viewtopic.php?f=6&t=24359&start=0&hilit=TACTIVEX%26amp%3B%23058</a><!-- l --> <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=22179&start=0&hilit=TACTIVEX%26amp%3B%23058">viewtopic.php?f=6&t=22179&start=0&hilit=TACTIVEX%26amp%3B%23058</a><!-- l --> Salu2
Cargar y mostrar un archivo PDF RESUELTO
* Regresa el nombre del archivo .PDF que deseo mostrar, (.\Adjuntos\Poliza Correcta.Pdf) y el archivo sí existe Paisa en los Windows recientes tienes que decirle exactamente donde esta el archivo intenta: cFilePdf := "Poliza Correcta.Pdf" cRuta := "\"+CurDir()+'\adjuntos\' + cFilePdf saludos.
Cargar y mostrar un archivo PDF RESUELTO
elimina espacios en blancos en la variable o campo que contiene el nombre del archivo usualmente FIELD->NOMBRE // 100 espacios ?FIELD->NOMBRE //"c:\polizas\tmp\poliza_102030.pdf .............." aca los puntos son espacios en blanco ya que el foro elimina los espacios en blanco ?file( FIELD->NOMBRE ) //falso ?file( rtrim( FIELD->NOMBRE ) //ok ya me paso en una ocacion. salu2
Cargar y mostrar un archivo PDF RESUELTO
Amigos: Voy a contarles mis peripecias: Estoy siguiendo el ejemplo de Karinha, pero como ya les comenté recibo un error: César: Le puse la ruta completa como me sugieres pero no hay de piña Carlos: Revisé que no haya espacios en blanco pero tampoco se soluciona. Cambie a FWH1306 y el error desapareció pero ahora el TXBrowse no acepta los siguiente métodos [code=fw:1cf2q30w]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrx:<span style="color: #000000;">bKeyDown</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> | nKey, nFlags | IIF<span style="color: #000000;">&#40;</span>nKey == VK_DELETE,DltAdj<span style="color: #000000;">&#40;</span>oDlg,oBrx<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />oBrx:<span style="color: #000000;">blDblClick</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> | nRow, nCol, nKey | <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"YES"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:1cf2q30w] No tira error simplemente se queda congelado como si fuera a enviar el famoso GPF. Ya se hizo bolas el engrudo. Saludos
Cargar y mostrar un archivo PDF RESUELTO
[code=fw:18rz0umz]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, nKey := VK_RETURN<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">200</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ARRAY <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #0000ff;">AUTOCOLS</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bKeyDown</span> &nbsp; = <span style="color: #000000;">&#123;</span> | nKey, nFlags | IIF<span style="color: #000000;">&#40;</span> nKey == VK_DELETE, DltAdj<span style="color: #000000;">&#40;</span> oDlg, oBrw <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLDblClick</span> = <span style="color: #000000;">&#123;</span> | nRow, nCol, nFlags | <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Left Doble Click"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oClient</span> := oBrw, oDlg:<span style="color: #000000;">Resize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> DltAdj<span style="color: #000000;">&#40;</span> oDlg, oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? <span style="color: #ff0000;">"Wow... Go on..."</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />&nbsp;</div>[/code:18rz0umz] 
Cargar y mostrar un archivo PDF RESUELTO
Karinha: Tu ejemplo funciona muy bien pero mi código no va. Simplemente se queda congelado, no hay GPF solo se queda congelado. Este es el código de xBrowse [code=fw:2693jasi]<div class="fw" id="{CB}" style="font-family: monospace;"><br />            oBrx:=TxBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><br />                oBrx:<span style="color: #000000;">nMarqueeStyle</span>          := MARQSTYLE_HIGHLROW       <span style="color: #B900B9;">// Con cursor de todo el renglón</span><br />                oBrx:<span style="color: #000000;">nColDividerStyle</span>       := LINESTYLE_LIGHTGRAY<br />                oBrx:<span style="color: #000000;">nRowDividerStyle</span>       := LINESTYLE_LIGHTGRAY<br />                oBrx:<span style="color: #000000;">lColDividerComplete</span>    := <span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span>                            <span style="color: #B900B9;">// (.T.) Matiene siempre llena la pantalla</span><br />                oBrx:<span style="color: #000000;">nHeaderHeight</span>          := <span style="color: #000000;">25</span>                               <span style="color: #B900B9;">// Altura de los encabezados</span><br />                oBrx:<span style="color: #000000;">nRowHeight</span>             := <span style="color: #000000;">22</span>                               <span style="color: #B900B9;">// Altura del renglón</span><br />                oBrx:<span style="color: #000000;">nHeaderLines</span>               := <span style="color: #000000;">1</span>                                <span style="color: #B900B9;">// Número de líneas de encabezados</span><br />                oBrx:<span style="color: #000000;">nDataLines</span>             := <span style="color: #000000;">1</span>                                <span style="color: #B900B9;">// Número de líneas de detalle</span><br />                oBrx:<span style="color: #000000;">nFooterHeight</span>          := <span style="color: #000000;">20</span>                               <span style="color: #B900B9;">// Altura del footer</span><br />                oBrx:<span style="color: #000000;">nFooterLines</span>               := <span style="color: #000000;">1</span>                                <span style="color: #B900B9;">// Número de líneas en el footer</span><br />                oBrx:<span style="color: #000000;">lFooter</span>                    := <span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span>                            <span style="color: #B900B9;">// Sí queremos línea de footer</span><br />                oBrx:<span style="color: #000000;">lHScroll</span>                   := <span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span>                            <span style="color: #B900B9;">// Quitamos el scroll horizontal</span><br />                oBrx:<span style="color: #000000;">bChange</span>                    := <span style="color: #000000;">&#123;</span> || PonImagen<span style="color: #000000;">&#40;</span>oFld,oBrx,oImagen<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />            aCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>                           := oBrx:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                aCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span>              := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>oRsAdj:<span style="color: #000000;">RecordCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span>,oRsAdj:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADJ_FIL"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>,SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />                aCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>           := <span style="color: #ff0000;">"Nombre del archivo"</span><br />                aCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nHeadStrAlign</span>     := AL_LEFT<br />                aCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nDataStrAlign</span>     := AL_LEFT<br />                aCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span>                := <span style="color: #000000;">70</span><br /><br />                oBrx:<span style="color: #000000;">blDblClick</span>             := <span style="color: #000000;">&#123;</span> | nRow, nCol, nKey | <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"YES"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />               oBrx:<span style="color: #000000;">l2007</span>                       := <span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br /><br />                oBrx:<span style="color: #000000;">nStretchCol</span>                := STRETCHCOL_LAST<br /><br />                oBrx:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_WHITE,CLR_BLACK<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bClrStd</span>        := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_BLACK,CLR_WHITE<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bClrFooter</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_WHITE,CLR_BLACK<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">nRecSelColor</span>   := oApp:<span style="color: #000000;">nRowParClr</span>                  <span style="color: #B900B9;">// Triangulo de selección</span><br />                oBrx:<span style="color: #000000;">bClrSel</span>        := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_BLACK,CLR_WHITE<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bClrSel</span>        := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> oRsAdj:<span style="color: #000000;">AbsolutePosition</span> % oApp:<span style="color: #000000;">nRowsInt</span> == <span style="color: #000000;">0</span> ,<span style="color: #000000;">&#123;</span> CLR_BLACK, oApp:<span style="color: #000000;">nRowParClr</span> <span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span> CLR_BLACK, oApp:<span style="color: #000000;">nRowNonClr</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bClrSelFocus</span>   := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>oApp:<span style="color: #000000;">nFClrFocus</span>,oApp:<span style="color: #000000;">nBClrFocus</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />                oBrx:<span style="color: #000000;">bGoTop</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ! oRsAdj:<span style="color: #000000;">BOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .AND. ! oRsAdj:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRsAdj:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ! oRsAdj:<span style="color: #000000;">BOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .AND. ! oRsAdj:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRsAdj:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bBof</span>      := <span style="color: #000000;">&#123;</span> || oRsAdj:<span style="color: #000000;">BOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bEof</span>      := <span style="color: #000000;">&#123;</span> || oRsAdj:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bBookMark</span> := <span style="color: #000000;">&#123;</span> | uBm | <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> oRsAdj:<span style="color: #000000;">BOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .AND. oRsAdj:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>, <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> uBm == <span style="color: #00C800;">NIL</span>, oRsAdj:<span style="color: #000000;">BookMark</span>, oRsAdj:<span style="color: #000000;">BookMark</span> := uBm <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bKeyNo</span>    := <span style="color: #000000;">&#123;</span> | n | <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> oRsAdj:<span style="color: #000000;">BOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .AND. oRsAdj:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>, <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> n == <span style="color: #00C800;">NIL</span>, oRsAdj:<span style="color: #000000;">AbsolutePosition</span>, oRsAdj:<span style="color: #000000;">AbsolutePosition</span> := n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">bKeyCount</span>  := <span style="color: #000000;">&#123;</span>|| oRsAdj:<span style="color: #000000;">RecordCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />                oBrx:<span style="color: #000000;">SetAdo</span><span style="color: #000000;">&#40;</span>oRsAdj<span style="color: #000000;">&#41;</span><br />                oBrx:<span style="color: #000000;">bClrStd</span>    := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> oRsAdj:<span style="color: #000000;">AbsolutePosition</span> % oApp:<span style="color: #000000;">nRowsInt</span> == <span style="color: #000000;">0</span> ,<span style="color: #000000;">&#123;</span> CLR_BLACK, oApp:<span style="color: #000000;">nRowParClr</span> <span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span> CLR_BLACK, oApp:<span style="color: #000000;">nRowNonClr</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                oBrx:<span style="color: #000000;">nRecSelColor</span>   := oApp:<span style="color: #000000;">nRowParClr</span><br /><br />            oBrx:<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">201</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:2693jasi] Nunca aparece el mensaje "YES" Tal vez tengo algo mal en el script de compilación, uso xMate, si alguien tiene un script que me proporcione será bienvenido. Saludos
Cargar y mostrar un archivo PDF RESUELTO
Armando, cambia el bLdblClick por: [code=fw:3imouptg]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;aCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bLDClickData</span> := <span style="color: #000000;">&#123;</span> |  nRow, nCol, nKeyFlags, oColumn |  ..........    <span style="color: #000000;">&#125;</span><br /> </div>[/code:3imouptg] Como ves debes definir uno para cada columna o asignar el mismo a todas Prueba asi y nos cuentas que tal.
Cargar y mostrar un archivo PDF RESUELTO
Cristóbal: Gracias por la sugerencia, en realidad el browse tiene una sola columna y no uso la edición por celda, en la versión 0810 va de 100 solo que no funciona el activex para mostrar los PDFs al cambiar de versión a la 1306 es donde tengo atorado el chamaco. Saludos
Cargar y mostrar un archivo PDF RESUELTO
Armando, comenta // esto: oBrx:bKeyCount := {|| oRsAdj:RecordCount() } Que retorna ahora?
Cargar y mostrar un archivo PDF RESUELTO
Complete el codigo abajo, conforme tu modelo. Y envia por correo: <!-- e --><a href="mailto:joao@pleno.com.br">joao@pleno.com.br</a><!-- e --> en archivo.zip Gracias, [code=fw:249lqdyq]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, nKey := VK_RETURN<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">200</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ARRAY <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #0000ff;">AUTOCOLS</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= MARQSTYLE_HIGHLROW &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Con cursor de todo el renglón</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nColDividerStyle</span> &nbsp; &nbsp; &nbsp; := LINESTYLE_LIGHTGRAY<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowDividerStyle</span> &nbsp; &nbsp; &nbsp; := LINESTYLE_LIGHTGRAY &nbsp;<span style="color: #B900B9;">// ok</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lColDividerComplete</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// (.T.) Matiene siempre llena la pantalla</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nHeaderHeight</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">25</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Altura de los encabezados</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowHeight</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">22</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Altura del renglón</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nHeaderLines</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">1</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Número de líneas de encabezados</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nDataLines</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">1</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Número de líneas de detalle</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nFooterHeight</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">20</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Altura del footer</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nFooterLines</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">1</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Número de líneas en el footer</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lFooter</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Sí queremos línea de footer</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lHScroll</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Quitamos el scroll horizontal</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bChange</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || PonImagen<span style="color: #000000;">&#40;</span>oFld,oBrw,oImagen<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* // ????<br />&nbsp; &nbsp;aCols[ 1] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := oBrw:AddCol()<br /><br />&nbsp; &nbsp;aCols[ 1]:bStrData &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= { || IF(oRsAdj:RecordCount() > 0,oRsAdj:Fields("ADJ_FIL"):Value,SPACE(1))}<br /><br />&nbsp; &nbsp;aCols[ 1]:cHeader &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := "Nombre del archivo"<br />&nbsp; &nbsp;aCols[ 1]:nHeadStrAlign &nbsp; &nbsp; := AL_LEFT<br />&nbsp; &nbsp;aCols[ 1]:nDataStrAlign &nbsp; &nbsp; := AL_LEFT<br />&nbsp; &nbsp;aCols[ 1]:nWidth &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= 70<br />&nbsp; &nbsp;*/</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">l2007</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nStretchCol</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= STRETCHCOL_LAST<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ???</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_WHITE,CLR_BLACK<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_BLACK,CLR_WHITE<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrFooter</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_WHITE,CLR_BLACK<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ???</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:nRecSelColor &nbsp; := oApp:nRowParClr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Triangulo de selección</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_BLACK,CLR_WHITE<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ???</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//oBrw:bClrSel &nbsp; &nbsp; &nbsp; &nbsp;:= {|| IF( oRsAdj:AbsolutePosition % oApp:nRowsInt == 0 ,{ CLR_BLACK, oApp:nRowParClr },{ CLR_BLACK, oApp:nRowNonClr }) }</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//oBrw:bClrSelFocus &nbsp; := { || {oApp:nFClrFocus,oApp:nBClrFocus} }</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bGoTop</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ! oRsAdj:<span style="color: #000000;">BOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .AND. ! oRsAdj:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRsAdj:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bGoBottom</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> ! oRsAdj:<span style="color: #000000;">BOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .AND. ! oRsAdj:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRsAdj:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bBof</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || oRsAdj:<span style="color: #000000;">BOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bEof</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || oRsAdj:<span style="color: #000000;">EOF</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ???</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bBookMark &nbsp;:= { | uBm | IF( oRsAdj:BOF() .AND. oRsAdj:EOF(), 0, IF( uBm == NIL, oRsAdj:BookMark, oRsAdj:BookMark := uBm ) ) }</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bKeyNo &nbsp; &nbsp; := { | n | IF( oRsAdj:BOF() .AND. oRsAdj:EOF(), 0, IF( n == NIL, oRsAdj:AbsolutePosition, oRsAdj:AbsolutePosition := n ) ) }</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bKeyCount &nbsp;:= {|| oRsAdj:RecordCount() }</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ????</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:SetAdo(oRsAdj)</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bClrStd &nbsp; &nbsp;:= {|| IF( oRsAdj:AbsolutePosition % oApp:nRowsInt == 0 ,{ CLR_BLACK, oApp:nRowParClr },{ CLR_BLACK, oApp:nRowNonClr }) }</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:nRecSelColor &nbsp; := oApp:nRowParClr</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bKeyDown</span> &nbsp; = <span style="color: #000000;">&#123;</span> | nKey, nFlags | IIF<span style="color: #000000;">&#40;</span> nKey == VK_DELETE, DltAdj<span style="color: #000000;">&#40;</span> oDlg, oBrw <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLDblClick</span> = <span style="color: #000000;">&#123;</span> | nRow, nCol, nFlags | <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Left Doble Click"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oClient</span> := oBrw, oDlg:<span style="color: #000000;">Resize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> DltAdj<span style="color: #000000;">&#40;</span> oDlg, oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? <span style="color: #ff0000;">"Wow... Go on..."</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">function</span> PonImagen<span style="color: #000000;">&#40;</span>oFld,oBrw,oImagen<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:249lqdyq] Salu2. 
Cargar y mostrar un archivo PDF RESUELTO
Karinha: Ajustando tu ejemplo con array funciona bien, yo uso recordset y ahí ya no funciona. Que deseas que te envíe? Saludos y en verdad aprecio tu esfuerzo
Cargar y mostrar un archivo PDF RESUELTO
No uso xbrowse, que hace recordset? És necesario mismo? Mira en \samples\TESTXBR3.PRG si ayuda. No necesita enviar un ejemplo autocontenido. Salu2.
Cargar y mostrar un archivo PDF RESUELTO
Karinha: Usando el mismo código solo cambiando a una de estas dos líneas [code=fw:l6i5tmmf]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrx:<span style="color: #000000;">blDblClick</span>             := <span style="color: #000000;">&#123;</span> | nRow, nCol, nKey | Editar<span style="color: #000000;">&#40;</span>oBrx<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #B900B9;">//oBrx:blDblClick           := { | nRow, nCol, nKey | MuestraPDF(oBrx) }</span><br /> </div>[/code:l6i5tmmf] Con la primera línea funciona de 100 pero Con la segunda línea se queda congelado, tengo que ir al administrador de tareas. <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> Este es el código de la función MuestraPDF, no me muestra el MsgInfo("HOLA") [code=fw:l6i5tmmf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*<br />============================================================================<br />============================================================================<br />*/</span><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> MuestraPDF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> oWndPdf, oPdf, cTmp, cFilePdf<br /><br />    <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HOLA! "</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /> </div>[/code:l6i5tmmf] El recordset es para trabajar tablas con MySql. Saludos
Cargar y mostrar un archivo PDF RESUELTO
Cambie para: PRIV nKey := VK_RETURN [code=fw:3skoku6j]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> EditarPDF<span style="color: #000000;">&#40;</span> oBrx <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> oWndPdf, oPdf, cTmp, cFilePdf<br /><br />    <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HOLA! "</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /> </div>[/code:3skoku6j] salu2.
Cargar y mostrar un archivo PDF RESUELTO
Karinha: Tal parece que el problema va entre diálogos y ventanas, finalmente lo estoy resolviendo con un simple WaitRun() En verdad aprecio todo el tiempo e interés por ayudarme. Un abrazo
Cargar y mostrar un archivo PDF RESUELTO
Armando, la data [b:a2y4opmx]aCols[ 1]:bLDClickData[/b:a2y4opmx], creo que equivale al lDblClick que estabas usando Habia entendido que tenías problemas en dicha data (no mostraba el mensaje "YES") Lo que intentas hacer es que de una base de datos con los nombres de archivos .PDFs seleccionas con el raton para mostrarlo, es asi ?
Cargar y mostrar un archivo PDF RESUELTO
Cristóbal: Exacto, eso busco, que el usuario de un doble clic al renglón del browse que contiene el nombre del fichero PDF a abrir y que este se abra con Acrobat Reader. Como mencioné, con el mortal WaitRun() lo solucioné. Como dice nuestro amigo R.F. "Estaba matando pulgas a cañonazos!." Saludos y gracias por el aporte.
Cargo on a Bitmap Control
I made some bitmaps controls on a dialogs I must assign for each bmp a cargo value to assign values before I used btnbmp with this feature sample : aBtn[nbotone]:bLClicked:= {|oBtnOmb| Menu_action oBtnOmb,oFree,oPanel) } aBtn[nbotone]:cargo := { 'Free', n, "O",ny } then If I call the third value on function menu_action and it make error IF oBtnOmb:cargo[3]="O" ...... HOw I can make to save a cargo values ?
Cargo on a Bitmap Control
Please copy the error log here
Cargo on a Bitmap Control
error,log note FiveWin Version: FWHX 12.03 but you sent me 12.04 [code=fw:6ees3l22]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br />   Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\Work\Prg\BikiniL\BikiniL.Exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">3</span>,<span style="color: #000000;">592</span>,<span style="color: #000000;">704</span> bytes<br />   Compiler version: <span style="color: #000000;">xHarbour</span> build <span style="color: #000000;">1.2</span><span style="color: #000000;">.1</span> Intl. <span style="color: #000000;">&#40;</span>SimpLex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>Rev. <span style="color: #000000;">6715</span><span style="color: #000000;">&#41;</span><br />   FiveWin  Version: <span style="color: #000000;">FWHX</span> <span style="color: #000000;">12.03</span><br />   Windows version: <span style="color: #000000;">6.1</span>, Build <span style="color: #000000;">7600</span> <br /><br />   Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">3</span> secs <br />   Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">16</span><span style="color: #000000;">-07</span><span style="color: #000000;">-2012</span>, <span style="color: #000000;">21</span>:<span style="color: #000000;">50</span>:<span style="color: #000000;">35</span><br />   Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span>  <span style="color: #00C800;">Class</span>: <span style="color: #ff0000;">'NUMERIC'</span> has no exported <span style="color: #00C800;">method</span>: <span style="color: #000000;">CARGO</span><br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = N   <span style="color: #000000;">36</span><br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>:  => CARGO<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\PBeach.prg => MENU_AZIONI<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1092</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\PBeach.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>LOAD_BEACH<span style="color: #000000;">&#40;</span> <span style="color: #000000;">639</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #000000;">LBUTTONDOWN</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1900</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TBITMAP:<span style="color: #000000;">LBUTTONDOWN</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">540</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1687</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\BITMAP.PRG => TBITMAP:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">521</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3153</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => WINRUN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">980</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\main.prg => TAPPLICATION:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">358</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\main.prg => MAIN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">58</span> <span style="color: #000000;">&#41;</span></div>[/code:6ees3l22]
Cargo on a Bitmap Control
You are accessing a number, not an object
Carlos Mora - hotmail lib
Amigo Carlos Mora, existe uma LIB para enviar email via hotmail? é possível compartilhar?
Carlos Mora - hotmail lib
Hola SGS, no he probado con hotmail pero creo que CDO puede funcionar. ¿Algún colega del foro usa CDO con hotmail? Siendo ambos de Microsoft, apostaría a que sí. Nombre del servidor SMTP smtp-mail.outlook.com Puerto SMTP 587 Método de cifrado SMTP STARTTLS [code=fw:2hzcwbx9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />loCfg := CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CDO.Configuration"</span> <span style="color: #000000;">&#41;</span><br />WITH OBJECT loCfg:<span style="color: #000000;">Fields</span><br />   :<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserver"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #ff0000;">"smtp-mail.outlook.com"</span><br />   :<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserverport"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">587</span><br />   :<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusing"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">2</span><br />   :<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := .T.<br />   :<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpusessl"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := .T.<br />   :<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusername"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #ff0000;">"yourAccount@outlook.com"</span>  <span style="color: #B900B9;">// <---- change this</span><br />   :<span style="color: #000000;">Item</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendpassword"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #ff0000;">"yourPassword"</span> <span style="color: #B900B9;">// <---- change this  </span><br />   :<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END WITH<br /><br />loMsg := CREATEOBJECT <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CDO.Message"</span> <span style="color: #000000;">&#41;</span><br />WITH OBJECT loMsg<br />   :<span style="color: #000000;">Configuration</span> = loCfg<br />   :<span style="color: #0000ff;">From</span> = <span style="color: #ff0000;">"yourAccount@outlook.com"</span>  <span style="color: #B900B9;">// <---- change this</span><br />   :<span style="color: #0000ff;">To</span> = <span style="color: #ff0000;">"destination@mailserver.com"</span> <span style="color: #B900B9;">// <----- direcci¢n de correo del destinatario </span><br />   :<span style="color: #0000ff;">Subject</span> = <span style="color: #ff0000;">"Prueba con CDO"</span> <br />   :<span style="color: #000000;">TextBody</span> = <span style="color: #ff0000;">"Este es un mensaje de prueba con CDO desde Harbour."</span> <br />   :<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />ENDWITH <br /> </div>[/code:2hzcwbx9]
Carlos Mora - hotmail lib
Vou testar obrigado.
Carlos Mora y la mala leche de la string concatenation
Hola Carlos y compañía, Recordaba que escribiste algo al respecto. Finalmente lo he encontrado en <!-- m --><a class="postlink" href="https://groups.google.com/forum/?fromgroups#!searchin/harbour-users/mora%7Csort:date/harbour-users/gn6LmZpJLfY/E1qenCOHAAAJ">https://groups.google.com/forum/?fromgr ... qenCOHAAAJ</a><!-- m --> Pero veo que tu clase TBuffer publicada es un prototipo ¿ La llegaste a terminar ? Es que necesito bajar el numero de FWrite() sin fragmentar la memoria. Saludos.
Carlos Mora y la mala leche de la string concatenation
Carlos, ¿ Se podría usar Stuff() para reemplazar a una posible InsertTheString() ? ¿ Fragmentará también la memoria Stuff() ? Editado: Pues sí, parece que viendo el código de Stuff() <!-- m --><a class="postlink" href="https://github.com/vszakats/harbour-core/blob/master/src/rtl/stuff.c">https://github.com/vszakats/harbour-cor ... tl/stuff.c</a><!-- m -->, también daría problemas de fragmentación porque lo que hace Stuff() es crear una nueva cadena a partir del parámetro cadena. Por tanto, viendo el (mal) funcionamiento de Stuff(), se podría decir que Harbour necesita una funcion que _verdaderamente_ reemplace en una cadena existente, y no que cree una cadena nueva, provocando así problemas de fragmentación de memoria.
Carlos Mora y la mala leche de la string concatenation
Hola Paquito, si, justamente como stuff crea una nueva cadena es peor el remedio que la enfermedad. De todas maneras, si lo que quieres es bajar la cantidad de escrituras, la clase te sirve, haciendo concatenaciones de las cadenas y dejando de lado el buffer. [code=fw:2tctllcd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />    <span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbclass.ch"</span><br />    <span style="color: #00C800;">CLASS</span> TBuffer<br />        <span style="color: #00C800;">DATA</span> nSize <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">4096</span><br />        <span style="color: #00C800;">DATA</span> cBuffer<br />        <span style="color: #00C800;">DATA</span> nCurLen<br />        <span style="color: #00C800;">DATA</span> bProcess<br />        <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nLen <span style="color: #000000;">&#41;</span> CONSTRUCTOR<br />        <span style="color: #00C800;">METHOD</span> Out<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">METHOD</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> DESTRUCTOR<br />    <span style="color: #00C800;">ENDCLASS</span><br /><br />    <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nLen, bProcess <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TClassA<br />        <span style="color: #00C800;">IF</span> ValType<span style="color: #000000;">&#40;</span> nLen <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span><br />           ::<span style="color: #000000;">nSize</span>:= nLen<br />        <span style="color: #00C800;">ENDIF</span><br />        ::<span style="color: #000000;">cBuffer</span>:=<span style="color: #ff0000;">""</span><br />        ::<span style="color: #000000;">nCurLen</span>:= <span style="color: #000000;">0</span><br />        ::<span style="color: #000000;">bProcess</span>:= bProcess<br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br />    <span style="color: #00C800;">METHOD</span> Out<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nCurLen</span> + Len<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span> > ::<span style="color: #000000;">nSize</span><br />           ::<span style="color: #000000;">bProcess</span>:<span style="color: #000000;">Eval</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cBuffer</span>, ::<span style="color: #000000;">nCurLen</span> <span style="color: #000000;">&#41;</span><br />           ::<span style="color: #000000;">nCurLen</span>:= <span style="color: #000000;">0</span><br />           ::<span style="color: #000000;">cBuffer</span>:= <span style="color: #ff0000;">""</span><br />        <span style="color: #00C800;">ENDIF</span><br />        <br />        ::<span style="color: #000000;">cBuffer</span>+= cText<br />        ::<span style="color: #000000;">nCurLen</span>+= Len<span style="color: #000000;">&#40;</span>cText<span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br />       <br />    <span style="color: #00C800;">METHOD</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nCurLen</span> > <span style="color: #000000;">0</span><br />           ::<span style="color: #000000;">bProcess</span>:<span style="color: #000000;">Eval</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cBuffer</span>, ::<span style="color: #000000;">nCurLen</span> <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">ENDIF</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2tctllcd] Prueba con eso y me cuentas. Se podría poner que cada 'x' escrituras hiciese una llamada al garbage collector, por refinarlo un poco.
Carlos Mora y la mala leche de la string concatenation
Hola Carlos, Agradezco enormemente tu respuesta. Lo monté concatenando en una variable, que viene a ser como la TBuffer. Mi sorpresa fue cuando después de ponerle un buffer de 60.000 los tiempos de grabación con fwrite (menos) se mantienen practicamente iguales. ¿ No será muy costoso, en tiempo, casi como un fwrite() un bucle concatenario del estilo cLine+= cText ? El proceso finalizó y no hubo un gpf de memoria y no tuve que recurrir al colector de memoria. Saludos
Carlos Mora y la mala leche de la string concatenation
[quote="hmpaquito":3douozow] Mi sorpresa fue cuando después de ponerle un buffer de 60.000 los tiempos de grabación con fwrite (menos) se mantienen practicamente iguales. ¿ No será muy costoso, en tiempo, casi como un fwrite() un bucle concatenario del estilo cLine+= cText ? [/quote:3douozow] Si le pones un buffer tan grande, entonces la concatenación empieza a complicar el asunto. Piensa en esta situación: tenemos un cBuffer que tiene 59000 caracteres, y le añadimos una cadena de 10 caracteres ¿Que va a suceder cuando se ejecute ::cBuffer += cText? Harbour calcula el largo de la string resultante (59010), aloca un trozo de memoria de ese tamaño, copia los 59000 bytes de la primera cadena y a continuacion los 10 de la segunda. Luego marca como disponible el trozo de 59000 que venia usando. Es un movimiento INFERNAL con cada concatenación, por lo que no es ventajoso tener bufferes tan grandes. Prueba de hacerlo con una longitud de 4096, 8192, etc (potencias de 2, el tamaño del sector del disco para optimizar I/O) a ver que resultados obtienes. Si tuviésemos la función por la que pregunté en su momento ahí si habría ventaja, porque no se hacen copias del buffer con cada concatenación. Un saludo
Carlos Mora y la mala leche de la string concatenation
Carlos, Gracias por la explicacion. Pondré un buffer más pequeño para intentar guardar un equilibrio entre tamaño de buffer y numero de fwrites. Volveré por aquí a informar del resultado. Saludos PD 1. ¿ No seria más rapido crear el fichero en memoria y tratarlo con fwrite ? PD 2. El txt que creo, ahora mismo, tiene ~ 130 mb y tarda 4 h.
Carlos Mora y la mala leche de la string concatenation
Paquito por curiosidad, qué es lo que quieres hacer? De qué se trata? Qué quieres decir con tus dos PD: [quote:1chq3wjr] PD 1. ¿ No seria más rapido crear el fichero en memoria y tratarlo con fwrite ? PD 2. El txt que creo, ahora mismo, tiene ~ 130 mb y tarda 4 h. [/quote:1chq3wjr] Segú lo que sea te podré ayudar <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
Carlos Mora y la mala leche de la string concatenation
Hola Manuel, [quote="xmanuel":32jf2hbz] Segú lo que sea te podré ayudar <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->[/quote:32jf2hbz] Eres la persona ideal <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Necesitamos una función similar al Stuff(), pero por referencia, es decir que no me haga copias de las strings sino que altere la original. Si miras el post que puse hace ya mucho tiempo, la idea es crear una clase Buffer genérica, que permita hacer cosas como las que hace Paquito sin provocar fragmentaciones ni hacer tantas copias en la memoria. La idea es tener una función InsertTheString( @cBuffer, nPos, cText[, nLen] ), que inserta en la posición nPos la cadena cText, opcionalmente limitando la longitud a insertar. Cuando creo el buffer, prealoco una cadena de la longitud que quiero, y la voy 'llenando' hasta que ya no puedo más, entonces proceso el contenido hasta ese momento. Tal como está la clase, es muy genérica y valdría para muchas cosas. Principalmente sería la generaciónde ficheros de texto que se generan a trocitos, como los XMLs, HTML y cosas así, y que la salida puede ir escribiendose a un fichero, un socket, etc... Con eso disminuímos la cantidad de escrituras, pudiendo elegir el tamaño del buffer para afinar el comportameinto según las necesidades del caso. Saludos
Carlos Mora y la mala leche de la string concatenation
Hola Manuel, Perfectamente explicado por Carlos. Gracias por tu interés. EDITADO: Un ejemplo seria este: [code=fw:2lq5uoyq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#Define</span> nBUFFER_SIZE <span style="color: #000000;">4096</span><br /><br />nH:= FCreate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Clientes.Txt"</span><span style="color: #000000;">&#41;</span><br />cLin:= <span style="color: #ff0000;">""</span><br /><br /><span style="color: #0000ff;">SELECT</span> Clientes<br />GO TOP<br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// Aqui es donde se deteriora la memoria, especialmente con buffer de gran tamaño.</span><br />   cLin+= FIELD-> Codigo+ <span style="color: #ff0000;">";"</span>+ FIELD-> Nombre+ <span style="color: #ff0000;">";"</span>+ FIELD-> Direccion+ <span style="color: #ff0000;">";"</span>+ FIELD-> Poblacion+ <span style="color: #ff0000;">";"</span>+ FIELD-> Provincia+ <span style="color: #ff0000;">";"</span>+ FIELD-> Observaciones+ CRLF<br /><br />   <span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>cLin<span style="color: #000000;">&#41;</span> >= nBUFFER_SIZE<br />      FWrite<span style="color: #000000;">&#40;</span>nH, cLin<span style="color: #000000;">&#41;</span><br />      cLin:= <span style="color: #ff0000;">""</span><br />   <span style="color: #00C800;">ENDIF</span><br />   SKIP<br /><span style="color: #00C800;">ENDDO</span><br />FWrite<span style="color: #000000;">&#40;</span>nH, cLin<span style="color: #000000;">&#41;</span><br />FClose<span style="color: #000000;">&#40;</span>nH<span style="color: #000000;">&#41;</span></div>[/code:2lq5uoyq]
Carlos Mora y la mala leche de la string concatenation
Os doy una idea de momento... Más adelante si no podéis implementarla lo hago yo... La idea es crea un buffer de memoria fijo que escriba en el fichero de destino cuando se llene. Y de eso se tiene que encargar el propio gestor del buffer. El ancho del buffer yo lo pondría lo más grande posible (lo que permita FWrite()) [code=fw:15ycybu0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />mibuffer := creaBuffer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">SELECT</span> Clientes<br />&nbsp; &nbsp; GO TOP<br />&nbsp; &nbsp; <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp;FIELD-> Codigo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp; <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp;FIELD-> Nombre<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp; <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp;FIELD-> Direccion<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp; <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp;FIELD-> Poblacion<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp; <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp;FIELD-> Provincia<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp; <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp;FIELD-> Observaciones<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;escribeEnBuffer<span style="color: #000000;">&#40;</span> mibuffer, &nbsp; CRLF <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;SKIP<br />&nbsp; &nbsp; <span style="color: #00C800;">ENDDO</span><br />freeBuffer<span style="color: #000000;">&#40;</span> mibuffer <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:15ycybu0] No sé si captais la idea? Si me dejais hasta el fin de semana lo hago <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
Carlos Mora y la mala leche de la string concatenation
Buenos días Manuel, Me encantaría si pudieras dar una solución a este problema. Al menos yo, necesitaría que funcionara con xHarbour. Agradecido. Saludos
Carlos Mora y la mala leche de la string concatenation
Manu, [quote="xmanuel":33k0oy7l] La idea es crea un buffer de memoria fijo que escriba en el fichero de destino cuando se llene. Y de eso se tiene que encargar el propio gestor del buffer. El ancho del buffer yo lo pondría lo más grande posible (lo que permita FWrite()) [/quote:33k0oy7l] Eso ya está hecho, mira el primer post. Lo que tu has hecho con funciones lo escribí hace mucho con una clase, solo falta la función C que haga lo del Stuff por referenciay sale funcionando. Respecto de poner un buffer grande (sin la función Stuff por referencia), tiene un inconveniente que ya ha demostrado Paquito en la práctica: la concatenación sucesiva destroza literalmente la memoria, fragmentándola. Hay una explicación mía en el hilo de porque sucede. [quote="xmanuel":33k0oy7l] Si me dejais hasta el fin de semana lo hago <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->[/quote:33k0oy7l] En el foro de Harbour Users me sugieren que use MemIO, pero sería meter una dependencia donde se puede resolver con algo más sencillo. Si uso MemIO directamente lo deja en memoria y lo escribo al cerrar. Y no se bien como se comporta con el tamaño creciente. demasiado rollo que no justifico, al menos de momento con la idea que sugieren. La solución con la clase me parece más elegante porque es genérica, hace de Buffer sin importar como vas a consumir el buffer, eso lo haces pasándole el codeblock 'de consumo'. Se puede usar para más cosas (de hecho lo estoy necesitando, aunque no tan urgentemente). SOLID: Single Concern (Es un Buffer), Open/Close(Suficientemete configurable para no requerir cambios, y se puede extender si hace falta), Liskov(Es extensible y se pueden usar las subclases con la misma interfaz), Interface segregada (Una interfaz con pocos métodos, que solo hace una cosa), inyección de Dependencias (Es el codeblock el que decide que se hace con la cadena resultante). Usos de la clase Buffer: Logs de la aplicación, Volcado de SQL (por ejemplo migraciones de DBF a SQL), Salidas a la response en un servidor http, etc.
Carlos Mora y la mala leche de la string concatenation
[quote="hmpaquito":1zci48pi]Pondré un buffer más pequeño para intentar guardar un equilibrio entre tamaño de buffer y numero de fwrites. Volveré por aquí a informar del resultado. [/quote:1zci48pi] Pues nada, que no ha funcionado. Puse un buffer de 8192 y el tiempo es el mismo: ~ 4 h.
Carlos Mora y la mala leche de la string concatenation
Jajaja... Este fin de semana veremos si eso que hace Paquito en 4 horas pasa a minutos... como mucho <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Atentos a las pantallas... PD: Si no doy señales de vida es que se me ha olvidado, solo tenéis que recordármelo, ok?
Carlos Mora y la mala leche de la string concatenation
Very interesting discussion among experts about optimization of string operations, avoiding memory fragmentation, etc. Though this topic interests me too, at the moment, I am not discussing that topic. The discussion appears to have started with the requirement of Mr. Paquito to reduce the time to export dbf to a delimited text file. [quote:30tda4t1] The txt that I believe, right now, has ~ 130 mb and takes 4 h. [/quote:30tda4t1] Do you really mean 130 MB ( = 130,000,000 bytes ), not 130GB? If it is only 130 MB, it should not take more than 2 or 3 minutes without any optimizations, even with standard COPY TO .. DELIMITED WITH ... command. Instead of COPY TO command, we can even try the (x)Harbour function [code=fw:30tda4t1]<div class="fw" id="{CB}" style="font-family: monospace;"><br />DBF2TEXT<span style="color: #000000;">&#40;</span> bWhile, bFor, aFields, cDelim, hFile, cSep, nCount, cdp <span style="color: #000000;">&#41;</span><br /> </div>[/code:30tda4t1] The above example is a very simple case where all the fields are character fields. There can be cases wehre some fields can be numeric, dates, etc, requirng conversion to strings. For testing I exported \fwh\samples\customer.dbf 2200 times to customer.txt. This took 2 minutes and produced a text file of size 142.527,000 bytes, i.e., 142.527 MB. [code=fw:30tda4t1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #000000;">04</span><span style="color: #000000;">-05</span><span style="color: #000000;">-2018</span>  <span style="color: #000000;">18</span>:<span style="color: #000000;">46</span>       <span style="color: #000000;">142</span>,<span style="color: #000000;">527</span>,<span style="color: #000000;">000</span> customer.txt<br />               <span style="color: #000000;">1</span> File<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span>    <span style="color: #000000;">142</span>,<span style="color: #000000;">527</span>,<span style="color: #000000;">000</span> bytes<br /> </div>[/code:30tda4t1] My test code: [code=fw:30tda4t1]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   USE CUSTOMER<br />   hFile    := FCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"customer.txt"</span> <span style="color: #000000;">&#41;</span><br />   ? <span style="color: #ff0000;">"start"</span><br />   nSecs    := SECONDS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">2200</span><br />      CUSTOMER-><span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      CUSTOMER-><span style="color: #000000;">&#40;</span> DBF2TEXT<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, hFile, <span style="color: #ff0000;">";"</span>, <span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span><br />   FClose<span style="color: #000000;">&#40;</span> hFile <span style="color: #000000;">&#41;</span><br />   ? SECONDS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - nSecs<br /> </div>[/code:30tda4t1] Did I wrongly understand the requirement of Mr. Paquito?
Carlos Mora y la mala leche de la string concatenation
Mr. Rao, Muchas gracias por sus tests. Pues creo que tiene vd. razón. Yo mismo he hecho mis test sencillos y arrojan tiempos sorprendentemente bajos para ~ 125 mb Este es mi codigo: Thank you very much for your tests. I think you are right I myself have done my simple tests and throw surprisingly low times for ~ 125 MB This is my code: [code=fw:3w3wc5m7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Data2Csv<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> nI<br /><span style="color: #00C800;">Local</span> cLin:= <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">Local</span> cFull:= <span style="color: #ff0000;">"<span style="color: #000000;">\T</span>mp<span style="color: #000000;">\a</span>rticulos"</span><br /><span style="color: #00C800;">Local</span> cIni<br /><span style="color: #00C800;">Local</span> nRecords:= <span style="color: #000000;">0</span><br /><span style="color: #00C800;">Local</span> nFCount<br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Empezando"</span><span style="color: #000000;">&#41;</span><br /><br />cIni:= Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />nH:= FCreate<span style="color: #000000;">&#40;</span>cFull+ <span style="color: #ff0000;">".csv"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">select</span> <span style="color: #000000;">0</span><br />use <span style="color: #000000;">&#40;</span>cFull<span style="color: #000000;">&#41;</span><br />nFCount:= FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />go top<br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">FOR</span> nI:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nFCount<br />&nbsp; &nbsp; &nbsp; cLin+= Transform<span style="color: #000000;">&#40;</span>FieldGet<span style="color: #000000;">&#40;</span>nI<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">";"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> nI != nFCount<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cLin+= <span style="color: #ff0000;">";"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp;FWrite<span style="color: #000000;">&#40;</span>nH, cLin<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nRecords++<br />&nbsp; &nbsp;cLin:= <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;SKIP<br /><span style="color: #00C800;">enddo</span><br />FWrite<span style="color: #000000;">&#40;</span>nH, cLin<span style="color: #000000;">&#41;</span><br />FClose<span style="color: #000000;">&#40;</span>nH<span style="color: #000000;">&#41;</span><br />CLOSE<br />mMsgInfo<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Time End "</span>+ Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+ CRLF+ <span style="color: #ff0000;">"Time Init "</span>+ cIni+ CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Records "</span>+ Transform<span style="color: #000000;">&#40;</span>nRecords, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>+ CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Fields "</span>+ Transform<span style="color: #000000;">&#40;</span>nFCount, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:3w3wc5m7] Manuel, Voy a buscar en mi codigo que cosas estan consumiendo el tiempo. La rutina de sutff para una cadena estará bien, pero creo que para mi es más importante encontrar donde se ralentiza el proceso realmente. Gracias a todos por vuestro interés. Volveré a decir más cuando tenga mas información. Saludos.
Carlos Mora y la mala leche de la string concatenation
In my view, using (x)Harbour's COPY TO command is the fastest way to produce a CSV file. This command internally uses DBF2TEXT() function written entirely in C and is fairly optimized for the intended purpose. There is no point in re-inventing the wheel. Even if we want to write a more efficient function, we can not do it with a Harbour level function or mix of Harbour and C level functions. We too need to write the entire function in C and in that case, are very likely to end up with a function similar to DBF2TEXT(). Obviously, the effort is not worth the result.
Carlos Mora y la mala leche de la string concatenation
Bueno parece que Mr. Rao ha dado con la mejor solución para Paquito. Pero esa no es la solución para algo genérico (no solo DBF) como quiere Carlos. ¿No? <!-- s:twisted: --><img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil" /><!-- s:twisted: --> Lo hago o no? <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
Carlos Mora y la mala leche de la string concatenation
Paquito lo ralentiza la maquina virtual y el recolector de basura. Mi propuesta sería hacerlo en C con lo que se evitaría dependencias como las que indica Carlos y te garantizo que la memoria no se fragmentaría nada. Y ademas se podría usar para crear un bufer de escritura a un fichero cuya entrada podría ser cualquier cosa y no solo una DBF. Yo lo hago si hace falta, si no, no... Como dijo alguien: "Si hay que ir se va, pero ir pa ná..."
Carlos Mora y la mala leche de la string concatenation
As I said already in my posting above, my advice was limited to exporting contents of dbf to csv. (x)Harbour's code is quite optimized, keeping in view its capabilities like handling numeric, date, logical fields also, trimming, escaping of strings and also codepage issues. I did appreciate your discussions on optimizing string operations, reducing memory fragmentation, etc. I clearly stated that I was not discussing that topic. Experts like Mr Carlos and Mr Xmanuel may continue with the topic. [quote:1w7d9hou] My proposal would be to do it in C, which would avoid dependencies such as those indicated by Carlos and I guarantee that the memory would not fragment at all. And it could also be used to create a write buffer to a file whose entry could be anything and not just a DBF. [/quote:1w7d9hou] Very good idea. Such a generic function would be useful for many purposes.
Carlos Mora y la mala leche de la string concatenation
Ok, Mr. Rao. La pongo en otro hilo, para que sea el inicio de una clase que todo el mundo pueda mejorarla. El hilo se llamará: "TFBuffer, una clase para acelerar la escritura en ficheros"
Carpeta Escritorio en Windows
Hola Gente! Quisiera saber si existe alguna funcion que me devuelva la carpeta Escritorio del Usuario activo en Windows; o al menos la carpeta raiz que contiene estas carpetas Gracias!
Carpeta Escritorio en Windows
Mira se és esto: [url:1dheb68o]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=36234&p=216104&hilit=cGetFile#p216104[/url:1dheb68o] [url:1dheb68o]http&#58;//fivewin&#46;com&#46;br/index&#46;php?/topic/27966-escolher-caminho-onde-ser%C3%A1-salvo-o-arquivo-gerado-pelo-sistema-txtdec-etc/&tab=comments#comment-285157[/url:1dheb68o] Saludos.
Carpeta Escritorio en Windows
[code=fw:192t5y9u]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Desde PRG:<br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> DesktopFolder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <shlobj_core.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> DESKTOPFOLDER <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   char path<span style="color: #000000;">&#91;</span> MAX_PATH + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>; <br /><br />   SHGetSpecialFolderPath<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NULL</span>, path, CSIDL_DESKTOP, <span style="color: #00C800;">FALSE</span> <span style="color: #000000;">&#41;</span>;<br />   hb_retc<span style="color: #000000;">&#40;</span> path <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:192t5y9u]
Carpeta Escritorio en Windows
[url:6bvysu4d]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=13740&p=70553&hilit=csidl#p70553[/url:6bvysu4d]
Carpeta Escritorio en Windows
Muchas gracias por las respuestas!
Carpeta Escritorio en Windows
Hola, Yo uso esto: [code=fw:198mkzwg]<div class="fw" id="{CB}" style="font-family: monospace;"><br />*---------------------------------------------------------------*<br /><span style="color: #00C800;">Function</span> GETSPECIALFOLDER<span style="color: #000000;">&#40;</span>nCSIDL<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Contributed By Ryszard Rylko</span><br />*---------------------------------------------------------------*<br /><span style="color: #00C800;">RETURN</span> C_getspecialfolder<span style="color: #000000;">&#40;</span>nCSIDL<span style="color: #000000;">&#41;</span><br />*---------------------------------------------------------------*<br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <shlobj.h><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapiitm.h"</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> C_GETSPECIALFOLDER <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Contributed By Ryszard RyRko</span><br /><span style="color: #000000;">&#123;</span><br />    char *lpBuffer = <span style="color: #000000;">&#40;</span>char*<span style="color: #000000;">&#41;</span> hb_xgrab<span style="color: #000000;">&#40;</span> MAX_PATH<span style="color: #000000;">+1</span><span style="color: #000000;">&#41;</span>;<br />    LPITEMIDLIST pidlBrowse;    <span style="color: #B900B9;">// PIDL selected by user</span><br />    SHGetSpecialFolderLocation<span style="color: #000000;">&#40;</span>GetActiveWindow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, hb_parni<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, &pidlBrowse<span style="color: #000000;">&#41;</span><br />;<br />    SHGetPathFromIDList<span style="color: #000000;">&#40;</span>pidlBrowse, lpBuffer<span style="color: #000000;">&#41;</span>;<br />    hb_retc<span style="color: #000000;">&#40;</span>lpBuffer<span style="color: #000000;">&#41;</span>;<br />    hb_xfree<span style="color: #000000;">&#40;</span> lpBuffer<span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br />*---------------------------------------------------------------*<br /> </div>[/code:198mkzwg] Así: GETSPECIALFOLDER( CSIDL_PERSONAL ) GETSPECIALFOLDER( CSIDL_PROGRAM_FILES ) GETSPECIALFOLDER( CSIDL_FAVORITES ) GETSPECIALFOLDER( CSIDL_COMMON_FAVORITES ) GETSPECIALFOLDER( CSIDL_DESKTOPDIRECTORY ) GETSPECIALFOLDER( CSIDL_COMMON_DESKTOPDIRECTORY ) GETSPECIALFOLDER( CSIDL_PROGRAMS ) GETSPECIALFOLDER( CSIDL_COMMON_STARTMENU ) GETSPECIALFOLDER( CSIDL_PROFILE ) [code=fw:198mkzwg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/* ***************************************** */</span><br /><span style="color: #B900B9;">// Pres del foro de FiveTechSoft el 20/11/2010.</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_PROGRAMS                  0x0002        <span style="color: #B900B9;">// Start  Menu\Programs</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_DESKTOPDIRECTORY          0x0010        <span style="color: #B900B9;">// <user  name>\Desktop</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_COMMON_STARTMENU          0x0016        <span style="color: #B900B9;">// <All Users>\Start Menu</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_COMMON_DESKTOPDIRECTORY   0x0019        <span style="color: #B900B9;">// <All Users>\Desktop</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_PROFILE                   0x0028        <span style="color: #B900B9;">// C:\Documents and Settings\<user name></span><br /><span style="color: #00D7D7;">#define</span> CSIDL_PROGRAM_FILES             0x0026        <span style="color: #B900B9;">// C:\Program Files</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_FAVORITES                 0x0006        <span style="color: #B900B9;">// "C:\Documents and Settings\User\Favorites"</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_COMMON_FAVORITES          0x001F        <span style="color: #B900B9;">// "C:\Documents and Settings\All Users\Favorites"</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_MYDOCUMENTS               0x000C        <span style="color: #B900B9;">// Virtual "C:\Documents and Settings\username\My Documents"</span><br /><span style="color: #00D7D7;">#define</span> CSIDL_PERSONAL                  0x0005        <span style="color: #B900B9;">// "C:\Documents and Settings\user\My Documents"</span><br /> </div>[/code:198mkzwg] Como ves la info está todo en este foro!!!! <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->
Carpeta Escritorio en Windows
Muchas gracias! Lo probaré
Carpeta de descargas?
Saludos foro Con la finalidad de actualizar mis exes via mail, requiero saber como puedo recuperar la carpeta de descargas de IE y google, para enviar un zip a mis clientes y que mi aplicacion automaticamente los descomprima y actualice los exes en la pc. p. ej. en google e IE es: C:\USERS\ACER\DOWNLOADS por medio de fwh como puedo obtener este dato? gracias.
Carpeta de descargas?
Noé, MsgInfo( GetEnv( "USERPROFILE" ) + "\Downloads" )
Carpeta de temporales
Hola. Les transmito una inquietud mas propia de un problema de diseño que de fwh, pero... en una de esas me pueden dar alguna idea. Tengo un ERP modular, que fue creciendo a partir de una base antigua (unos 15 años), paso por DOS, clipper, evoluciono a FW, y Borland, y ahora esta trabajando con FWH perfectamente. En su momento, por facilidad de diseño, y porque no pensamos que se iba a necesitar, todos los indices temporales, bases temporales, etc, se creaban en una ruta determinada c:\tempo (siempre la misma, que debia existir para que el sistema funcione; era un requisito del sistema, que exista una carpeta TEMPO en el disco c:\, con permisos totales para el usuario). La macana es que ahora que estoy usando en un cliente MS Windows Terminal Server; cuando abro 2 sesiones simultaneas, como el c:\tempo es el mismo para ambas sesiones, el programa, si se usan los mismos modulos, falla. ¿se les ocurre algun truquito para evitar crear una variable por usuario, con un "directorio para temporales", y tener que modificar cientos y cientos de lineas de codigo fuente? Espero que puedan ayudarme. Gracias desde ya. Atte.
Carpeta de temporales
[code=fw:1i8c7owd]<div class="fw" id="{CB}" style="font-family: monospace;">cFile &nbsp; &nbsp; &nbsp;:= cTempFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">".<span style="color: #000000;">\"</span>, "</span>.dbf<span style="color: #ff0000;">" )<br />aDbf := {}<br />aadd( &nbsp;aDbf, { 'codigo', 'C', 15, 00 } &nbsp;)<br />aadd( &nbsp;aDbf, { 'nombre', 'C', 45, 00 } &nbsp;)<br /><br />dbcreate( &nbsp;cFile, aDbf )<br /><br />use cFile new<br /><br />* you codigo<br /><br />close<br /><br />FERASE( cFile )</span></div>[/code:1i8c7owd] saludos...
Carpeta de temporales
Que tal agregarle al nombre del Directorio la hora en que se crea? Si lo llamas "DirTmp", agregarle la hora en que se cree: cFile:="DirTmp"+STRTRAN(TIME(),":","") lo cual te daria algo asi como "DirTmp013524" y dificilmente 2 personas crearan el mismo directorio en el mismo segundo. Espero te sirva
Carpeta de temporales
Diego, En este escenario te vas a encontrar 2 situaciones. 1.- Varios usuarios conectados simultaneamente.Cada uno necesita su espacio temporal independientemente del otro. La solucion pasa por declarar i crear tu entorno para cada usuario. Puedes por ejemplo usar Sfn2Lfn(GetEnv( 'USERPROFILE' )) y te dara la carpeta del usuario conectado, pero entiendo que si te conectas remotamente siempre tendras el mismo usuario de la maquina. 2.- Aun asi, si te crearas tu el entorno en funcion del usuario que se conecte a tu aplicacion, en funcion del login, maquina, ..., existe otro problema: Que pasa si el usuario que se conecta lo hace mas de una vez desde la misma maquina ? Si tu aplicacion necesita su espacio temporal por cada sesion, la UNICA solucion pasa por crearte al Inicio de programa una carpeta individual temporal independiente de quien, como, cuando, desde donde, ... Yo me crearia al inicio de la app un nombre aleatorio de una carpeta y justo antes de salir de la aplicacion, se borran ficheros y carpeta.
Carpeta de temporales
El uso de TS acelera, y mucho, el problema que puede tener una gestion inapropiada de creacion de temporales y que puede producir "choques" con otros usuarios/programa en el nombre del temporal. Me explico: hay 2 formas de crear el temporal: usando un string "random" o bien basandose en una string que tenga un valor exclusivo (ejem. maquina+ handle del programa). El problema para UTILIZAR la string "random" tiempo es que todos los usuarios tienen la misma hora, por tanto la hora no es buena estrategia. A mi modo de ver, la estrategia pasa por utilizar cualquier factor de string, preferentemente random, y [b:1brayoiw]crear el temporal justo cuando se obtiene su nombre para asi "reservar" su nombre para que otro usuario no lo utilice.[/b:1brayoiw]
Carpeta de temporales
Muchas gracias por las respuestas. Voy a ver que puedo hacer, y despues les cuento. No me va a quedar mas remedio que laburar... Gracias de nuevo...!!!
Carpeta de temporales
Bueno el uso de tablas temporales es un verdadero lio, yo desde hace mucho opte por usar Arrays y todo perfecto. Saludos..
Carpeta de temporales
Amigos: Mis dos centavos, yo utilizo DBFs temporales nombradas con la hora en que se crean, ejemplo [code=fw:2n8ohx5i]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cArchivo := <span style="color: #ff0000;">"WW"</span>+<span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>TIME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>TIME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>TIME<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">7</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:2n8ohx5i] Donde WW es el nombre del programa que lo crea, el resto ?, bueno creo que no necesita explicación. Hasta ahora no he tenido problemas de choques que aunque no es imposible es muy dificil que mas de un usuario cree el archivo con el mismo programa a la misma hora, minutos y segundos. Saludos