topic
stringlengths
1
63
text
stringlengths
1
577k
pertenecia a fichero dbf
Me temo que eso no es posible y lo que comentas es un poco complicado ya que un indice puede estar formado por una expresión incluso del campo de otra DBF... Yo te recomiendo que tenga una "hoja de estilos" por ejemplo una cosa que yo hago es llamar a los índices así: i01Bancos.ntx i02Bancos.ntx i03Bancos.ntx Ves que comienza con la "i" de índice, un numero que sería el orden que ocupan para, por ejemplo, el SET ORDER y por último la DBF. Y la DBF se llamaría: Bancos.dbf Lógicamente con esto lo tienes fácil usando la función de (x)Harbour "SubStr()" sacar el nombre de la DBF. Y si usas el SET AUTOOPEN creo que ya lo tienes todo. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Espero haberte ayudado. Un saludo Manu Expósito
pestañas hacia abajo ?
SE ha conseguido el hacer que aparezcan las pestañas hacia abajo ? . me es importante , pues mis clientes usan los pdas cudrados y el espacio de pantalla es vital . Saludso.
pestañas hacia abajo ?
no se sabe nada ?
pestañas hacia abajo ?
Jose Luis, Aún no hemos tenido ocasión de mirarlo. Lo hacemos cuanto antes.
peticion de funcion : nRandom()
Esta funcion aparece en el codigo , pero no funciona al no tener implementada totalmente seconds() . Existe algun codigo alternativo de momento ? Gracias
peticion de funcion : nRandom()
Me respondo yo mismo , de momento hice esto : [code:fv6d0mqt] Function segundos&#40;&#41; local ctime&#58;= Time&#40;&#41; Return &#40; &#40;3600* val&#40; SUBSTR&#40;cTIME, 1, 2&#41; &#41; &#41;+ &#40;60* val&#40; SUBSTR&#40;cTIME, 4, 2&#41;&#41; &#41; + val&#40;SUBSTR&#40;cTIME, 7, 2&#41;&#41; &#41; [/code:fv6d0mqt] parece que puede servir mientras disponemos de seconds().
phantom dbf files with Vista
I've noticed what seems to be weird behavior in Win Vista with regards to how it handles dbf tables data. It seems that within my app folder, Vista is maintaining two separate copies of any dbf file - one that stores data from an ordinary user (even a non-top "Adminstrator"), and another that stores data entered by the top administrator. If I uninstall the app (I use Inno Setup as my installer/uninstaller), and then use the command prompt to look at the hard drive and check if everything has been removed, I see that everything is gone that should be gone. This is true whether I use the command prompt as the ordinary user, or as the top Administrator - I see the same absence of the files. Then I reinstall the app (again with Inno), and when the app is launched, the old dbf data is still there!If I then use the cmd prompt and dbu (modified for dbfcdx) to look at the dbf file - as an ordinary user - then I see the old data. If I use dbu as the top administrator, the file is there but empty.When I do an uninstall followed by a reinstall, I want the data files to be fresh and empty, and that's not happening. (Incidentally, in my Inno Setup script, each file is specified as "Permission: everyone-modify" which should allow them to be erased by the uninstaller.)Obviously, Vista and its permissions regime is doing something here with DBF files much different than XP, that I don't understand. Can anyone offer an insight into what is happening here?- Roger
phantom dbf files with Vista
Roger,I don't have Vista here to test but I did find this:<!-- m --><a class="postlink" href="http://www.lockergnome.com/it/2006/12/12/vista-special-permissions/">http://www.lockergnome.com/it/2006/12/1 ... rmissions/</a><!-- m -->It may be that you need to provide Modify privledges to the folder so the files can be deleted. It seems you can also check the folder and file permissions by right clicking on them and then the security tab.James
phantom dbf files with Vista
Thanks, James, for the tips. I'll check them out and then post the results of further testing.It seems that working with Vista is like having a very beautiful but very high maintenance girlfriend. Did I hear "all looks and no brains"? No! It couldn't be that.- Roger
phantom dbf files with Vista
I found a very informative video about Vista UAC (User Access Control) that can be viewed for free at:<!-- m --><a class="postlink" href="http://www.trainsignal.com/index.asp?PageAction=VIEWPROD&ProdID=73">http://www.trainsignal.com/index.asp?Pa ... &ProdID=73</a><!-- m -->On that webpage, it is in a section titled: "Windows Vista Training Demo." Both the audio and visuals give a clear explanation of UAC concept of Vista that guys like me have had trouble grasping.But I'm still searching on the Inet for an explanation of how phantom dbf files get created in Vista. I plan to post a simple test that demonstrates the issue.- Roger
phantom dbf files with Vista
I created a simple FWH app to test this problem, but have been unable to duplicate the Vista phantom dbf behavior with it so far. So no point in posting it here. Yet I still get the problem with the original app on Vista where it was noticed - whenever I uninstall and then reinstall. Will keep trying to get to the bottom of this problem, because obviously, we can't have shadow dbf's retaining old data in parallel with an app's regular dbf's.At this point I don't know if the problem is with Vista or with Inno Setup. But until I know what it is, it could cause problems for any FWH app in Vista.Will report back when I have something.By the way, the link that James posted to an article on Vista permissions leads to a set of 7 detailed articles that are well worth reading - better than what I've seen in books.- Roger
photo make
How I can make a photo with WebCam from an application and select area od the image to save ? Any sample ?
photo make
Silvio, why Webcam and not a normal Screenshot ? As well I'm looking for a Solution, to save a selected Area of the Screen to a Image. A solution from Antonio ( maybe a Example needed ) : <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=17504&p=95677#p95677">viewtopic.php?f=3&t=17504&p=95677#p95677</a><!-- l --> Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
photo make
Try this. It is for a scanner, but I think it works with a webcam if it is twain. <!-- m --><a class="postlink" href="http://www.box.net/shared/sov0hjb6t2">http://www.box.net/shared/sov0hjb6t2</a><!-- m --> Alvaro
php desde fwh
Olá, és possivel chamar un codigo php desde fivewin? Salu2
php wordfile for FIVEDIT
Dear Cristobal, is there a php wordfile for FIVEDIT? Thanks in advance Otto
php wordfile for FIVEDIT
Dear Otto Please look <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=29991&p=205830#p205830">viewtopic.php?f=3&t=29991&p=205830#p205830</a><!-- l -->
phpBB
  [color=#0000FF:aqdabcpe][b:aqdabcpe][size=120:aqdabcpe]A veces nada mas falta animarse:[/size:aqdabcpe] [/b:aqdabcpe][/color:aqdabcpe] Ya que mis conocimientos no son tan avanzados como para ayudar a la mayoria en lo que se refiere a programacion, por lo menos quiero compartir esto con el foro: Yo me gradue de Perito Contador en Octubre del '93, ese año tuve contacto con la primera computadora que habia visto en mi vida, una XT de 8 mghz con disco flexible de 5 1/4", no se lo que pasó, pero aunque nadie nos había introducido, yo me enamoré de ella a primera vista (las cosas que me pasan solo a mí). Lo que me hizo recordar que mi hermano quien se habia graduado el año anterior, habia recibido cursos de computacion, y de sus libros y notas de la escuela, me di a la tarea de aprender de que se trataba. Para mediados de Noviembre, ya habia conseguido una computadora de la escuela donde mi hermano estudió alquilada, fue ahí donde me topé con lo que en ese tiempo fué lo máximo para mí, FoxBase. Para principios de Enero, entregué la Compu, con los primeros programas para control escolar con los que contó la escuela, eso fué el pago por la renta, y me dió la oportunidad de trabajar como maestro de computacion, aunque aprendiendo por la mañana para enseñar por la tarde. Para El dia del Amor y la Amistad del '97 ya habia migrado a los USA, lo que me obligó a olvidarme de la compu, y no fué hasta el 2003 cuando regresé a la computadora y compré FiveWin 2.4, nada mas para probar. Pues lo probé, y me encantó. Estube por ahí leyendo las news por un tiempito, se me quemó la compu y me volví a perder, hasta finales del año pasado en que volví para encontrarme con los nuevos foros de FiveWin. Inmediatamente me desagradó el cambio, pero al paso de un par de horas, me empezó a gustar, y de ahí vengo. El asunto es, que hace poco me animé y creé mi sitio web, aunque me daba pavor por no saber ni de que se trataba. Pero después de varios dias, ya habia publicado mi sitio, y va de maravilla. [color=#FF0000:aqdabcpe]Ahí es donde entra el phpBB[/color:aqdabcpe] ya que ayer, me animé y bajé el software, y nada más me tomó como 2 horas para instalarlo y configurarlo en mi sitio web [url]forums.MayaPOS.com[/url]. Estoy seguro, de que por ahí debe de haber algunos compañeros que se encuentran igual que yo, y no se animan a explorar nuevas cosas por pavor a lo desconocido. Espero que esto le sirva a alguien, y se de cuenta de que si yo, que no tengo mucho conocimiento informático, me animé y le atiné, la mayoria de nosotros vamos a poder migrar y aceptar las nuevas y diversas opciones con las que contamos, como SQL, Activex, etc. Asi que, nada mas falta animarnos, ya que si nos topamos con algún problemita, con la ayuda de los muchos compañeros del foro, aunque sea de a montón nos vamos para adelante...
phpBB
Bayron, Enhorabuena! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
phpBB
Hola, Byron: Me ha resultado muy gratificante leer la historia de tus conocimientos informáticos con la que coincido en gran parte aunque no he alcanzado tu nivel. La palabra "pavor" expresa con exactidud lo que siento en cada paso nuevo que doy. Gracias por el ánimo que produce leer tu declaración. Saludos, - Juan - ( San Fernando, Cádiz, de España ).
phpBB
Juan, Tambien me gustaría compartir lo que he aprendido, y es que: Yo siempre intenté aplicar lo que sabía a lo nuevo; [color=#0000BF:22zzrdnr]No siempre es bueno hacer esto, algunas veces con algunas tecnologías es mejor empezar desde cero[/color:22zzrdnr] Todos debemos recordar que a veces nos confundimos con pensar que le tememos a la oscuridad; [color=#0000BF:22zzrdnr]A lo que se le teme no es a la oscuridad, sino a lo que no se puede ver y a lo desconocido[/color:22zzrdnr] Por eso es que insto a que empezemos a probar las cosas nuevas, y quien sabe de repente le atinamos y nos gusta mas que lo que ya dabamos por heho y terminado
phpBB
Byron, Esa es una de las suertes de estar en éste foro, con tanta buena gente y buenos profesionales. Saludos, - Juan -
phpBB Forum using REST API ?
hi is it possible to request this Forum via REST API <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> there is a Project for phpBB at Github [url:8u8sydio]https&#58;//github&#46;com/eparsons/RESTApiForPhpBB[/url:8u8sydio]
phpBB Login Script using ""MSXML2.ServerXMLHTTP"" ?
hi, my phpBB Forum "Reader" use "MSXML2.ServerXMLHTTP" to download Message of phpBB Forum now there are some Forum where i need to login ( to get a Session-ID ? ) but how <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> can somebody help me please
phpBB Version 3.0 launched
[url=http&#58;//www&#46;phpbb&#46;com/about/press/:1ixv6ska]Press Release[/url:1ixv6ska] [url=http&#58;//www&#46;phpbb&#46;com/about/features/?sid=5d04d864ce301df790fd4bb459fb4b6a/:1ixv6ska]phpBB2 - phpBB3 Feature Comparison[/url:1ixv6ska]
phpBB Version 3.0 launched
Hua, Thanks for the info! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Do you know any PHP applications similar to osCommerce ?
phpBB Version 3.0 launched
I'm afraid not Antonio <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> The only 2 commerce related scripts that I've heard of are OSCommerce and [url=http&#58;//www&#46;agoracart&#46;com/:2d5fx2ei]AgoraCart[/url:2d5fx2ei]. AgoraCart is a Perl/MySql based solution.
phpBB to LLM
1. Create a SQL dump file from your phpBB forums: mysqldump --user=username --password=YourPassword database_phpbb > dumpfile.sql 2. We "clean" the dump file using this code: [code=fw:1irx3v1w]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">local</span> cSQL := hb_memoRead<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"dumpfile.sql"</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> hHTMLCodes := <span style="color: #000000;">&#123;</span> ;<br />        <span style="color: #ff0000;">"&quot;"</span> => <span style="color: #ff0000;">'"'</span>,;<br />        <span style="color: #ff0000;">"&num;"</span> => <span style="color: #ff0000;">'#'</span>,;<br />        <span style="color: #ff0000;">"&dollar;"</span> => <span style="color: #ff0000;">'$'</span>,;<br />        <span style="color: #ff0000;">"&percnt;"</span> => <span style="color: #ff0000;">'%'</span>,;<br />        <span style="color: #ff0000;">"&amp;"</span> => <span style="color: #ff0000;">'&'</span>,;<br />        <span style="color: #ff0000;">"&apos;"</span> => <span style="color: #ff0000;">"'"</span>,;<br />        <span style="color: #ff0000;">"&lpar;"</span> => <span style="color: #ff0000;">'('</span>,;<br />        <span style="color: #ff0000;">"&rpar;"</span> => <span style="color: #ff0000;">')'</span>,;<br />        <span style="color: #ff0000;">"&ast;"</span> => <span style="color: #ff0000;">'*'</span>,;<br />        <span style="color: #ff0000;">"&plus;"</span> => <span style="color: #ff0000;">'+'</span>,;<br />        <span style="color: #ff0000;">"&comma;"</span> => <span style="color: #ff0000;">','</span>,;<br />        <span style="color: #ff0000;">"&hyphen-minus;"</span> => <span style="color: #ff0000;">'-'</span>,;<br />        <span style="color: #ff0000;">"&period;"</span> => <span style="color: #ff0000;">'.'</span>,;<br />        <span style="color: #ff0000;">"&sol;"</span> => <span style="color: #ff0000;">'/'</span>,;<br />        <span style="color: #ff0000;">"&colon;"</span> => <span style="color: #ff0000;">':'</span>,;<br />        <span style="color: #ff0000;">"&semi;"</span> => <span style="color: #ff0000;">';'</span>,;<br />        <span style="color: #ff0000;">"&lt;"</span> => <span style="color: #ff0000;">'<'</span>,;<br />        <span style="color: #ff0000;">"&equals;"</span> => <span style="color: #ff0000;">'='</span>,;<br />        <span style="color: #ff0000;">"&gt;"</span> => <span style="color: #ff0000;">'>'</span>,;<br />        <span style="color: #ff0000;">"&quest;"</span> => <span style="color: #ff0000;">'?'</span>,;<br />        <span style="color: #ff0000;">"&commat;"</span> => <span style="color: #ff0000;">'@'</span>,;<br />        <span style="color: #ff0000;">"&lsqb;"</span> => <span style="color: #ff0000;">'['</span>,;<br />        <span style="color: #ff0000;">"&bsol;"</span> => <span style="color: #ff0000;">'<span style="color: #000000;">\\</span>'</span>,;<br />        <span style="color: #ff0000;">"&rsqb;"</span> => <span style="color: #ff0000;">']'</span>,;<br />        <span style="color: #ff0000;">"&Hat;"</span> => <span style="color: #ff0000;">'^'</span>,;<br />        <span style="color: #ff0000;">"&lowbar;"</span> => <span style="color: #ff0000;">'_'</span>,;<br />        <span style="color: #ff0000;">"&grave;"</span> => <span style="color: #ff0000;">'`'</span>,;<br />        <span style="color: #ff0000;">"&lcub;"</span> => <span style="color: #ff0000;">'{'</span>,;<br />        <span style="color: #ff0000;">"&verbar;"</span> => <span style="color: #ff0000;">'|'</span>,;<br />        <span style="color: #ff0000;">"&rcub;"</span> => <span style="color: #ff0000;">'}'</span>,;<br />        <span style="color: #ff0000;">"~"</span> => <span style="color: #ff0000;">'~'</span> <span style="color: #000000;">&#125;</span><br /><br />    hb_memoWrit<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"forums.sql"</span>, hb_strReplace<span style="color: #000000;">&#40;</span> cSQL, hHTMLCodes <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>    </div>[/code:1irx3v1w] 3. Create a local mysql "forums" database and using Heidi restore the dumpfile.sql into it 4. Create a DBF from it using this code: [code=fw:1irx3v1w]<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 />    <span style="color: #00C800;">local</span> dummy := FW_SetUnicode<span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> oCn := Maria_Connect<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"localhost"</span>, <span style="color: #ff0000;">"forums"</span>, <span style="color: #ff0000;">"username"</span>, <span style="color: #ff0000;">"YourPassword"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> cSQL <br /><br />    <span style="color: #0000ff;">TEXT</span> INTO cSQL <br />    <span style="color: #0000ff;">SELECT</span><br />        DATE_FORMAT<span style="color: #000000;">&#40;</span>FROM_UNIXTIME<span style="color: #000000;">&#40;</span>phpbb_posts.post_time<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'%Y-%m-%d'</span><span style="color: #000000;">&#41;</span> AS date,<br />        DATE_FORMAT<span style="color: #000000;">&#40;</span>FROM_UNIXTIME<span style="color: #000000;">&#40;</span>phpbb_posts.post_time<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'%H:%i'</span><span style="color: #000000;">&#41;</span> AS time,<br />        phpbb_forums.forum_name AS forum,<br />        phpbb_topics.topic_title AS topic,<br />        phpbb_users.username AS username,<br />        phpbb_posts.post_text AS <span style="color: #0000ff;">text</span><br />    <span style="color: #0000ff;">FROM</span><br />        phpbb_posts<br />    <span style="color: #0000ff;">JOIN</span><br />        phpbb_users <span style="color: #0000ff;">ON</span> phpbb_posts.poster_id = phpbb_users.user_id<br />    <span style="color: #0000ff;">JOIN</span><br />        phpbb_topics <span style="color: #0000ff;">ON</span> phpbb_posts.topic_id = phpbb_topics.topic_id<br />    <span style="color: #0000ff;">JOIN</span><br />        phpbb_forums <span style="color: #0000ff;">ON</span> phpbb_posts.forum_id = phpbb_forums.forum_id;<br />    ENDTEXT<br /><br />    oCn:<span style="color: #000000;">SaveToDbf</span><span style="color: #000000;">&#40;</span> cSQL, <span style="color: #ff0000;">"posts.dbf"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span>    </div>[/code:1irx3v1w] 5. Now we create a small dataset in json to make tests: [code=fw:1irx3v1w]<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 />    <span style="color: #00C800;">local</span> aPosts := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, n<br /><br />    USE posts VIA <span style="color: #ff0000;">"dbfcdx"</span><br /><br />    <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> posts->topic + posts->date + posts->time + posts->forum <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">subject</span><br />    GO TOP<br /><br />    <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">20</span><br />       AAdd<span style="color: #000000;">&#40;</span> aPosts, GetTopic<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">next</span><br />    hb_memoWrit<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"forums.json"</span>, hb_jsonEncode<span style="color: #000000;">&#40;</span> aPosts <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    XBrowser<span style="color: #000000;">&#40;</span> aPosts <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> GetTopic<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">local</span> hTopic := <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span>, cTopic := StrToUtf8<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> posts->topic <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />    hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"topic"</span> <span style="color: #000000;">&#93;</span>    = StrToUtf8<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> posts->topic <span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span><br />    hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />    AAdd<span style="color: #000000;">&#40;</span> hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span>, GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    SKIP <br />    <span style="color: #00C800;">while</span> posts->topic == cTopic<br />       AAdd<span style="color: #000000;">&#40;</span> hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span>, GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />       SKIP <br />    end<br /><br /><span style="color: #00C800;">return</span> hTopic    <br /><br /><span style="color: #00C800;">function</span> GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />    <span style="color: #00C800;">local</span> hPost := <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span><br /><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"topic"</span> <span style="color: #000000;">&#93;</span>    = StrToUtf8<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> posts->topic <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"forum"</span> <span style="color: #000000;">&#93;</span>    = StrToUtf8<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> posts->forum <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"username"</span> <span style="color: #000000;">&#93;</span> = StrToUtf8<span style="color: #000000;">&#40;</span> RTrim<span style="color: #000000;">&#40;</span> posts->username <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"date"</span> <span style="color: #000000;">&#93;</span>     = posts->date <br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"time"</span> <span style="color: #000000;">&#93;</span>     = RTrim<span style="color: #000000;">&#40;</span> posts->time <span style="color: #000000;">&#41;</span><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"text"</span> <span style="color: #000000;">&#93;</span>     = StrToUtf8<span style="color: #000000;">&#40;</span> posts->text <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> hPost    <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> <hbapi.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> STRTOUTF8 <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   int iLength1;<br />   int iLength2;<br />   LPWSTR szWideText;<br />   char * szDest;<br /><br />   iLength1 = MultiByteToWideChar<span style="color: #000000;">&#40;</span> CP_ACP, <span style="color: #000000;">0</span>, hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, hb_parclen<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />   szWideText = <span style="color: #000000;">&#40;</span> LPWSTR <span style="color: #000000;">&#41;</span> hb_xgrab<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> iLength1 + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> * <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br />   MultiByteToWideChar<span style="color: #000000;">&#40;</span> CP_ACP, <span style="color: #000000;">0</span>, hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, hb_parclen<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, szWideText, iLength1 <span style="color: #000000;">&#41;</span>;<br />   szWideText<span style="color: #000000;">&#91;</span> iLength1 <span style="color: #000000;">&#93;</span> = <span style="color: #00C800;">NULL</span>;<br />   iLength2 = WideCharToMultiByte<span style="color: #000000;">&#40;</span> CP_UTF8, <span style="color: #000000;">0</span>, szWideText, iLength1, <span style="color: #00C800;">NULL</span>, <span style="color: #000000;">0</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">&#41;</span>;<br />   szDest = <span style="color: #000000;">&#40;</span> char * <span style="color: #000000;">&#41;</span> hb_xgrab<span style="color: #000000;">&#40;</span> iLength2 + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />   WideCharToMultiByte<span style="color: #000000;">&#40;</span> CP_UTF8, <span style="color: #000000;">0</span>, szWideText, iLength1, szDest, iLength2, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">&#41;</span>;<br />   hb_xfree<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> szWideText <span style="color: #000000;">&#41;</span>;<br />   szDest<span style="color: #000000;">&#91;</span> iLength2 <span style="color: #000000;">&#93;</span> = <span style="color: #00C800;">NULL</span>;<br />   hb_retc<span style="color: #000000;">&#40;</span> szDest <span style="color: #000000;">&#41;</span>;<br />   hb_xfree<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> szDest <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:1irx3v1w] 6. next we load this forums.json as a dataset to HuggingFace to verify that it is correct. Open a free account at HuggingFace, create a dataset and upload forums.json. If you can properly inspect the forums.json from HuggingFace then it means that forums.json is ok. The structure of the generated json file is as follows: [code=fw:1irx3v1w]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">&#91;</span><br />   <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"topic"</span>: <span style="color: #000000;">the</span> <span style="color: #0000ff;">title</span> <span style="color: #0000ff;">of</span> the topic,<br />      <span style="color: #ff0000;">"messages"</span>:<br />      <span style="color: #000000;">&#91;</span> <br />         <span style="color: #000000;">&#123;</span><br />            <span style="color: #ff0000;">"topic"</span>: <span style="color: #000000;">the</span> <span style="color: #0000ff;">title</span> <span style="color: #0000ff;">of</span> the topic,<br />            <span style="color: #ff0000;">"forum"</span>: <span style="color: #000000;">the</span> forum <span style="color: #0000ff;">name</span>,<br />            <span style="color: #ff0000;">"username"</span>: <span style="color: #0000ff;">name</span> <span style="color: #0000ff;">of</span> the author,<br />            <span style="color: #ff0000;">"date"</span>: <span style="color: #000000;">date</span> <span style="color: #0000ff;">of</span> the post,<br />            <span style="color: #ff0000;">"time"</span>: <span style="color: #000000;">time</span> <span style="color: #0000ff;">of</span> the post,<br />            <span style="color: #ff0000;">"text"</span>: <span style="color: #0000ff;">text</span> <span style="color: #0000ff;">of</span> the post<br />         <span style="color: #000000;">&#125;</span>,<br />        <span style="color: #00C800;">next</span> posts <span style="color: #00C800;">for</span> the same topic<br />      <span style="color: #000000;">&#93;</span><br />   <span style="color: #000000;">&#125;</span>,<br />   <span style="color: #00C800;">next</span> topic,<br />   ...<br /><span style="color: #000000;">&#93;</span></div>[/code:1irx3v1w] so basically it is a list of the topics, with the name of the topic and the list of messages for such topic. Here you have the Google Colab file to run the fine tunning training from Microsoft Phi2: [url:1irx3v1w]https&#58;//github&#46;com/FiveTechSoft/FWH_tools/blob/master/fivetech_forums&#46;ipynb[/url:1irx3v1w] ======== original post Some days ago our friend Bruno Cantero suggested me a great idea: to generate an AI LLM from these forums, as these forums have been running for 18 years, so it may be a great dataset to train an AI LLM <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> So first thing we need is to build a dataset from it. Here I am posting some initial tests that I expect that we may be able to complete with the help of Uwe and Rao: topics.prg [code=fw:1irx3v1w]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">local</span> cURL  := <span style="color: #ff0000;">"http://forums.fivetechsupport.com/viewtopic.php?f3&t=8"</span><br />    <span style="color: #00C800;">local</span> cHTML := WebPageContents<span style="color: #000000;">&#40;</span> cUrl <span style="color: #000000;">&#41;</span><br /> <br />    <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> GetTopics<span style="color: #000000;">&#40;</span> cHtml <span style="color: #000000;">&#41;</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;">function</span> GetTopics<span style="color: #000000;">&#40;</span> cHtml <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nAt, cTopic<br />   <span style="color: #00C800;">local</span> aTopics := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #00C800;">while</span> <span style="color: #000000;">&#40;</span> nAt := <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'class="post bg'</span>, cHtml <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />      cTopic = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cHtml, nAt + Len<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'class="post bg'</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      cTopic = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cTopic, <span style="color: #000000;">1</span>, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'<hr class="divider"'</span>, cTopic <span style="color: #000000;">&#41;</span> + Len<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'<hr class="divider"'</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      AAdd<span style="color: #000000;">&#40;</span> aTopics, GetTopic<span style="color: #000000;">&#40;</span> cTopic <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      cHtml = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cHtml, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'<hr class="divider"'</span>, cHtml <span style="color: #000000;">&#41;</span> +  + Len<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'<hr class="divider"'</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   end <br />   <br /><span style="color: #00C800;">return</span> aTopics   <br /><br /><span style="color: #00C800;">function</span> GetTopic<span style="color: #000000;">&#40;</span> cTopic <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> hTopic := <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> cContent := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cTopic, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'<div class="content">'</span>, cTopic <span style="color: #000000;">&#41;</span> + Len<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'<div class="content">'</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> cAuthor := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cTopic, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'<p class="author">'</span>, cTopic <span style="color: #000000;">&#41;</span> + Len<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'<p class="author">'</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   cContent = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cContent, <span style="color: #000000;">1</span>, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"</div>"</span>, cContent <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />   cAuthor  = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cAuthor, <span style="color: #000000;">1</span>, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"</strong>"</span>, cAuthor <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br />   cAuthor  = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cAuthor, RAt<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">">"</span>, cAuthor <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> cContent, cAuthor <span style="color: #000000;">&#41;</span><br /><br />   hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"contents"</span> <span style="color: #000000;">&#93;</span> = cContent<br />   hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"author"</span> <span style="color: #000000;">&#93;</span> = cAuthor<br /><br /><span style="color: #00C800;">return</span> hTopic   <br /> </div>[/code:1irx3v1w]
phpBB to LLM
Another ideal use would be a DBF to LLM <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> We already have llama64.dll to run it !
phpBB to LLM
Antonio, Pues me parece una buenisima idea. Se podria interrogar a la IA sobre cual es el mejor vendedor, cuando vendio mas, que vendedor ha decrecido, etc slds
phpBB to LLM
hi Antonio, [quote="Antonio Linares":1gvibrky]Another ideal use would be a DBF to LLM <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> We already have llama64.dll to run it ![/quote:1gvibrky] i do have a DBF of Fivewin Forum i use my phpBB "Codebox" Reader based on Idea of Uwe [url:1gvibrky]https&#58;//www&#46;hmgforum&#46;com/viewtopic&#46;php?t=7281[/url:1gvibrky] extract "Codebox" Tag is not my Problem, it are HTML "Sign" which i try to STRTRAN() it work so far with CODE but in "Body" i still have a lot HTML "Sign" Question : is there a Function HTML2TEXT() to get plain TEXT from HTML Message <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
phpBB to LLM
[quote="paquitohm":fighqh3a]Antonio, Pues me parece una buenisima idea. Se podria interrogar a la IA sobre cual es el mejor vendedor, cuando vendio mas, que vendedor ha decrecido, etc slds[/quote:fighqh3a] totalmente de acuerdo. Tenemos que conseguirlo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
phpBB to LLM
I also generate a DBF based on Rao and Uwe code. I only extract the source samples from all the posts. Offline I then search the dbf for keywords of any kind. It helped me many many times in finding solutions because It is showing sample code.
phpBB to LLM
This is the type of csv file that we have to generate from a DBF: customer.csv [quote:2cjk9n52]ID,FIRST,LAST,STREET,CITY,STATE,ZIP,HIREDATE,MARRIED,AGE,SALARY,NOTES 1,Homer,Simpson,32179 Maiden Lane,Springfield,IL,20503-8202,1992-09-18,True,50,5900.0,This is a test for record 1 2,Ceci,Gibbard,9540 Raynes Park Road,Miami,MA,55774-2304,1984-10-17,False,28,123700.0,This is a test for record 2 3,Reg,Kaczocha,30522 Park Ten Place,Scottsdale,WY,09226-1483,1989-05-23,True,43,82900.0,This is a test for record 3 4,David,Jochum,8211 Carnegie Center,Hingham,IL,71947-5114,1900-10-10,True,34,120000.0,This is a test for record 4 5,Simpson,Cafee,32736 Meadowbrook Drive,Nedlands,ID,38179-3789,1990-12-11,True,88,51800.0,This is a test for record 5 6,Tom,Logan,6180 Roselle Street,West Covina,CT,82378-0904,1992-02-24,True,90,20400.0,This is a test for record 6 7,Gary,Brock,3893 Canandaigua Road,Senford,WV,94177-5329,1987-09-12,True,58,145300.0,This is a test for record 7 8,Frank,Fonseca,18712 Sherman Way,Ashby,RI,08218-8409,1988-02-16,False,46,118900.0,This is a test for record 8 9,Rick,Sencovici,13802 South University,Arcadia,HI,82063-8091,1987-01-17,True,55,23700.0,This is a test for record 9 10,Hugh,Lupton,16472 S. LaSalle Street,Tarzana,AK,79021-0643,1989-08-28,False,89,96700.0,This is a test for record 10 11,Oskar,Farley,19123 Washington Street,Boston,IN,25885-0851,1985-08-31,True,46,77300.0,This is a test for record 11 12,Johnny,Fischer,30621 Inridge Drive,McLean,WA,86275-8035,1988-11-12,False,37,2300.0,This is a test for record 12 13,Corkey,Young,9069 Avon Place,Lund,NC,36199-1793,1988-12-24,True,54,30000.0,This is a test for record 13 14,Phyllis,Lechuga,1457 Indianapolis Ave,Council Bluffs,AR,73036-5749,1987-01-29,False,94,84600.0,This is a test for record 14 15,Chester,Padilla,32385 Federal Street,Ashby,MS,82882-2447,1985-12-22,True,90,144000.0,This is a test for record 15 [/quote:2cjk9n52]
phpBB to LLM
Dear Antonio, Can we download the DBF (phpBB) file from somewhere? Best regards, Otto
phpBB to LLM
Hola Antonio, tienes acceso a la base de datos del foro? en este caso sería más sencillo extraer la información.
phpBB to LLM
Estimado Victor, Si, claro, tenemos acceso a la base de datos. De todas formas la cuestión ahora es como organizar esos datos para que puedan ser entrenados en un modelo de IA pre entrenado. Por el momento hemos encontrado este modelo que nos da una primera idea: [quote:hvm4jajh]data = { 'text': ['Initial post for programming question.', 'Reply 1: I think the issue is with your code.', 'Reply 2: Can you provide more details?', 'Initial post for hardware issue.', 'Reply 1: Have you checked the connections?', 'Reply 2: Try updating your drivers.'], 'label': ['programming', 'programming', 'programming', 'hardware', 'hardware', 'hardware'] } [/quote:hvm4jajh] poco a poco <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
phpBB to LLM
[quote="Otto":na5zkavq]Dear Antonio, Can we download the DBF (phpBB) file from somewhere? Best regards, Otto[/quote:na5zkavq] Dear Otto, We have not generated a DBF from these forums yet, but surely we will do it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
phpBB to LLM
Dear Otto, Victor, We already have a posts.dbf with all the forums posts <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> We are reviewing if it has some private info that must not be shared...
phpBB to LLM
This seems to be fine: [code=fw:25sfmxmu]<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> oCn := Maria_Connect<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"localhost"</span>, <span style="color: #ff0000;">"forums"</span>, <span style="color: #ff0000;">"root"</span>, <span style="color: #ff0000;">"password"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> cSQL <br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">TEXT</span> INTO cSQL <br />&nbsp; &nbsp; <span style="color: #0000ff;">SELECT</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DATE_FORMAT<span style="color: #000000;">&#40;</span>FROM_UNIXTIME<span style="color: #000000;">&#40;</span>phpbb_posts.post_time<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'%Y-%m-%d'</span><span style="color: #000000;">&#41;</span> AS date,<br />&nbsp; &nbsp; &nbsp; &nbsp; DATE_FORMAT<span style="color: #000000;">&#40;</span>FROM_UNIXTIME<span style="color: #000000;">&#40;</span>phpbb_posts.post_time<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'%H:%i'</span><span style="color: #000000;">&#41;</span> AS time,<br />&nbsp; &nbsp; &nbsp; &nbsp; phpbb_forums.forum_name AS forum,<br />&nbsp; &nbsp; &nbsp; &nbsp; phpbb_topics.topic_title AS topic,<br />&nbsp; &nbsp; &nbsp; &nbsp; phpbb_users.username AS username,<br />&nbsp; &nbsp; &nbsp; &nbsp; phpbb_posts.post_text AS <span style="color: #0000ff;">text</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">FROM</span><br />&nbsp; &nbsp; &nbsp; &nbsp; phpbb_posts<br />&nbsp; &nbsp; <span style="color: #0000ff;">JOIN</span><br />&nbsp; &nbsp; &nbsp; &nbsp; phpbb_users <span style="color: #0000ff;">ON</span> phpbb_posts.poster_id = phpbb_users.user_id<br />&nbsp; &nbsp; <span style="color: #0000ff;">JOIN</span><br />&nbsp; &nbsp; &nbsp; &nbsp; phpbb_topics <span style="color: #0000ff;">ON</span> phpbb_posts.topic_id = phpbb_topics.topic_id<br />&nbsp; &nbsp; <span style="color: #0000ff;">JOIN</span><br />&nbsp; &nbsp; &nbsp; &nbsp; phpbb_forums <span style="color: #0000ff;">ON</span> phpbb_posts.forum_id = phpbb_forums.forum_id;<br />&nbsp; &nbsp; ENDTEXT<br /><br />&nbsp; &nbsp; oCn:<span style="color: #000000;">SaveToDbf</span><span style="color: #000000;">&#40;</span> cSQL, <span style="color: #ff0000;">"c:<span style="color: #000000;">\t</span>emp<span style="color: #000000;">\p</span>osts.dbf"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; &nbsp;</div>[/code:25sfmxmu]
phpBB to LLM
Here you have a posts.dbf and posts.fpt with all the contents of these forums <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> We appreciate if you can review it and check if they are fine for you: [url:1fpvhxto]https&#58;//github&#46;com/FiveTechSoft/forums/blob/master/posts_dbf&#46;zip[/url:1fpvhxto] join these parts using Total Commander so you get a posts_fpt.zip [url:1fpvhxto]https&#58;//github&#46;com/FiveTechSoft/forums/blob/master/posts_fpt&#46;001[/url:1fpvhxto] [url:1fpvhxto]https&#58;//github&#46;com/FiveTechSoft/forums/blob/master/posts_fpt&#46;002[/url:1fpvhxto] [url:1fpvhxto]https&#58;//github&#46;com/FiveTechSoft/forums/blob/master/posts_fpt&#46;003[/url:1fpvhxto]
phpBB to LLM
First try building the dataset. hb_jsonEncode() GPFs... [code=fw:1kyy909y]<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> aPosts := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; USE posts VIA <span style="color: #ff0000;">"dbfcdx"</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> posts->topic + posts->date + posts->time + posts->forum <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">subject</span><br />&nbsp; &nbsp; GO TOP<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">while</span> ! EoF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aPosts, GetTopic<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; end &nbsp; &nbsp; &nbsp; <br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">// hb_jsonEncode( aPosts )</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> aPosts <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;">function</span> GetTopic<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> hTopic := <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span>, cTopic := posts->topic<br /><br />&nbsp; &nbsp; hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"topic"</span> <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;= posts->topic <br />&nbsp; &nbsp; hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span>, GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; SKIP <br />&nbsp; &nbsp; <span style="color: #00C800;">while</span> posts->topic == cTopic<br />&nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span>, GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp;SKIP <br />&nbsp; &nbsp; end<br /><br /><span style="color: #00C800;">return</span> hTopic &nbsp; &nbsp;<br /><br /><span style="color: #00C800;">function</span> GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> hPost := <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"topic"</span> <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;= posts->topic <br />&nbsp; &nbsp; hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"username"</span> <span style="color: #000000;">&#93;</span> = posts->username <br />&nbsp; &nbsp; hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"text"</span> <span style="color: #000000;">&#93;</span> &nbsp; &nbsp; = posts->text<br /><br /><span style="color: #00C800;">return</span> hPost &nbsp; &nbsp;</div>[/code:1kyy909y]
phpBB to LLM
This code seems to work, though we still don't know how long it will take the training: I appreciate, if you have a pc with nvidia GPUs, to test it and report how long it takes. Just replace "fivetech_forums_20231222.sql" with a large text file you may have, thanks train.py [code=fw:1owl6exg]<div class="fw" id="{CB}" style="font-family: monospace;">import torch<br /><span style="color: #0000ff;">from</span> transformers import GPT2LMHeadModel, GPT2Tokenizer, GPT2Config<br /><span style="color: #0000ff;">from</span> transformers import TextDataset, DataCollatorForLanguageModeling<br /><span style="color: #0000ff;">from</span> transformers import Trainer, TrainingArguments<br /><br /># Load pre-trained GPT<span style="color: #000000;">-2</span> model and tokenizer<br />model_name = <span style="color: #ff0000;">"gpt2"</span><br />model = GPT2LMHeadModel.from_pretrained<span style="color: #000000;">&#40;</span>model_name<span style="color: #000000;">&#41;</span><br />tokenizer = GPT2Tokenizer.from_pretrained<span style="color: #000000;">&#40;</span>model_name<span style="color: #000000;">&#41;</span><br /><br />tokenizer.add_special_tokens<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">'pad_token'</span>: <span style="color: #ff0000;">'[PAD]'</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br /># Load your additional training <span style="color: #00C800;">data</span> <span style="color: #0000ff;">from</span> a file<br />file_path = <span style="color: #ff0000;">"fivetech_forums_20231222.sql"</span><br />with open<span style="color: #000000;">&#40;</span>file_path, <span style="color: #ff0000;">"r"</span>, encoding=<span style="color: #ff0000;">"utf-8"</span><span style="color: #000000;">&#41;</span> as file:<br />    train_text = file.read<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /># Tokenize the training <span style="color: #00C800;">data</span><br />train_tokens = tokenizer<span style="color: #000000;">&#40;</span>train_text, return_tensors=<span style="color: #ff0000;">"pt"</span>, truncation=<span style="color: #00C800;">True</span>, padding=<span style="color: #00C800;">True</span><span style="color: #000000;">&#41;</span><br /><br /># Create a PyTorch Dataset<br />train_dataset = TextDataset<span style="color: #000000;">&#40;</span><br />    tokenizer=tokenizer,<br />    file_path=file_path,<br />    block_size=<span style="color: #000000;">128</span>  # <span style="color: #0000ff;">Adjust</span> the block <span style="color: #0000ff;">size</span> based <span style="color: #0000ff;">on</span> your dataset<br /><span style="color: #000000;">&#41;</span><br /><br /># Create a <span style="color: #00C800;">data</span> collator<br />data_collator = DataCollatorForLanguageModeling<span style="color: #000000;">&#40;</span><br />    tokenizer=tokenizer,<br />    mlm=<span style="color: #00C800;">False</span>  # Set <span style="color: #0000ff;">to</span> <span style="color: #00C800;">True</span> <span style="color: #00C800;">if</span> your training <span style="color: #00C800;">data</span> includes masked language modeling objective<br /><span style="color: #000000;">&#41;</span><br /><br /># Configure training arguments<br />training_args = TrainingArguments<span style="color: #000000;">&#40;</span><br />    output_dir=<span style="color: #ff0000;">"./fine-tuned-model"</span>,<br />    overwrite_output_dir=<span style="color: #00C800;">True</span>,<br />    num_train_epochs=<span style="color: #000000;">3</span>,  # <span style="color: #0000ff;">Adjust</span> the number <span style="color: #0000ff;">of</span> epochs based <span style="color: #0000ff;">on</span> your dataset<br />    per_device_train_batch_size=<span style="color: #000000;">4</span>,<br />    save_steps=10_000,<br />    save_total_limit=<span style="color: #000000;">2</span>,<br />    logging_dir=<span style="color: #ff0000;">"./logs"</span>,<br /><span style="color: #000000;">&#41;</span><br /><br /># Initialize Trainer<br />trainer = Trainer<span style="color: #000000;">&#40;</span><br />    model=model,<br />    args=training_args,<br />    data_collator=data_collator,<br />    train_dataset=train_dataset,<br /><span style="color: #000000;">&#41;</span><br /><br /># Fine-tune the model<br />trainer.train<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /># Save the fine-tuned model<br />model.save_pretrained<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"./fine-tuned-model"</span><span style="color: #000000;">&#41;</span><br />tokenizer.save_pretrained<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"./fine-tuned-model"</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:1owl6exg]
phpBB to LLM
Do you have a pc with a powerfull nvidia card ? If so, are you willing to help doing some tests training AI ? Please let me know it many thanks
phpBB to LLM
If an NVIDIA RTX 2080 TI is enough, then I want to support the testing? ?
phpBB to LLM
Dear Anton, That one would be great! Could you please try to run the previous python code and see how long time does it report ? python train.py I am emailing you the file many thanks!
phpBB to LLM
========================== RESTART: C:\fwh\AI\train.py ========================= Traceback (most recent call last): File "C:\fwh\AI\train.py", line 1, in <module> import torch ModuleNotFoundError: No module named 'torch'
phpBB to LLM
run this: pip install torch and then please try it again
phpBB to LLM
C:\fwh\AI>pip install torch ERROR: Could not find a version that satisfies the requirement torch (from versions: none) ERROR: No matching distribution found for torch C:\fwh\AI>
phpBB to LLM
[quote:1javoj60]If you're encountering issues with installing PyTorch using pip install torch, it could be due to several reasons. Here are a few steps you can take to resolve the issue: Check Python Version: Ensure that you are using a compatible version of Python. PyTorch may have specific requirements for the Python version. As of my last knowledge update in January 2022, PyTorch 1.10.0 supports Python 3.6, 3.7, 3.8, and 3.9. You can check the PyTorch website for the latest compatibility information. Use the Correct Pip Command: Ensure you are using the correct pip command based on your system and whether you want to install the CPU or GPU version of PyTorch. Use one of the commands mentioned in the previous response that corresponds to your system and requirements. Upgrade Pip: Ensure that your pip version is up-to-date. You can upgrade pip using the following command: bash Copy code pip install --upgrade pip Check Internet Connection: Ensure that your internet connection is stable and not blocking the connection to the PyTorch servers. If you are behind a proxy, you may need to configure your proxy settings. Firewall/Antivirus: Check if your firewall or antivirus software is blocking the connection. Temporarily disabling them for the installation process might help. Conda (Optional): If you're still having trouble, consider using conda, which is another package manager. You can create a new conda environment and install PyTorch with the following commands: bash Copy code conda create -n myenv python=3.8 conda activate myenv conda install pytorch==1.10.0 torchvision==0.11.2 torchaudio==0.10.0 -c pytorch Remember to replace myenv with your desired environment name. If you are still facing issues after trying these steps, please provide more details about your operating system, Python version, and any error messages you receive so that I can offer more specific assistance.[/quote:1javoj60]
phpBB to LLM
python is 3.12 pip is uptodate antivirus is stopped ? C:\fwh\AI>pip install pytorch Collecting pytorch Using cached pytorch-1.0.2.tar.gz (689 bytes) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: pytorch Building wheel for pytorch (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for pytorch (pyproject.toml) did not run successfully. ? exit code: 1 ??> [20 lines of output] Traceback (most recent call last): File "C:\Users\alerc\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\Users\alerc\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\alerc\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel return _build_backend().build_wheel(wheel_directory, config_settings, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\alerc\AppData\Local\Temp\pip-build-env-k67z_tif\overlay\Lib\site-packages\setuptools\build_meta.py", line 404, in build_wheel return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\alerc\AppData\Local\Temp\pip-build-env-k67z_tif\overlay\Lib\site-packages\setuptools\build_meta.py", line 389, in _build_with_temp_dir self.run_setup() File "C:\Users\alerc\AppData\Local\Temp\pip-build-env-k67z_tif\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "C:\Users\alerc\AppData\Local\Temp\pip-build-env-k67z_tif\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "<string>", line 15, in <module> Exception: You tried to install "pytorch". The package named for PyTorch is "torch" [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pytorch Failed to build pytorch ERROR: Could not build wheels for pytorch, which is required to install pyproject.toml-based projects C:\fwh\AI>
phpBB to LLM
I think i should downgrade python to 3.11 [url:31yqstij]https&#58;//stackoverflow&#46;com/questions/77225812/is-there-a-way-to-install-pytorch-on-python-3-12-0[/url:31yqstij] here is the output with conda ... C:\fwh\AI>conda install pytorch==1.10.0 torchvision==0.11.2 torchaudio==0.10.0 -c pytorch Channels: - pytorch - defaults Platform: win-64 Collecting package metadata (repodata.json): done Solving environment: | warning libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE failed LibMambaUnsatisfiableError: Encountered problems while solving: - package torchvision-0.11.2-py36_cpu requires python >=3.6,<3.7.0a0, but none of the providers can be installed Could not solve for environment specs The following packages are incompatible ?? __cuda is requested and can be installed; ?? pin-1 is installable and it requires ? ?? python 3.12.* , which can be installed; ?? torchvision 0.11.2 is not installable because there are no viable options ?? torchvision 0.11.2 would require ? ?? python >=3.6,<3.7.0a0 , which conflicts with any installable versions previously reported; ?? torchvision 0.11.2 would require ? ?? cudatoolkit >=11.3,<11.4 , which requires ? ?? __cuda >=11.3 , which conflicts with any installable versions previously reported; ?? torchvision 0.11.2 would require ? ?? python >=3.7,<3.8.0a0 , which conflicts with any installable versions previously reported; ?? torchvision 0.11.2 would require ? ?? python >=3.8,<3.9.0a0 , which conflicts with any installable versions previously reported; ?? torchvision 0.11.2 would require ?? python >=3.9,<3.10.0a0 , which conflicts with any installable versions previously reported. Pins seem to be involved in the conflict. Currently pinned specs: - python 3.12.* (labeled as 'pin-1')
phpBB to LLM
installed python 3.11.7 pip install torch pip install transformers python train.py result: ready in 16min maybe with some errors - error messages can't be saved there! if i run train.py again then comes terrible | 213/1628301 [05:57<1293:44:33, 2.86s/it] can't wait so long <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
phpBB to LLM
Dear Anton, > result: ready in 16min maybe with some errors - error messages can't be saved there! Can you please send me te generated "fine-tuned-model" files using wormhole app ? [url:i0g3379r]https&#58;//wormhole&#46;app/[/url:i0g3379r] many thanks!
phpBB to LLM
Hello Antonio, From the looks of it, the training doesn't just happen in one round: First round generated a 715MB file "cached_lm_GPT2Tokenizer_128_fivetech_forums_20231222.sql" in 16min. The second round is actually the training and I'm now at 0% after 47 minutes and the open duration is given as 3900 hours - the value is constantly growing. The fine-tuned-model directory is still empty.
phpBB to LLM
Dear Anton, many thanks for your so valuable feedback!
phpBB to LLM
It's been two days since I've had anything to do with Python! DESKTOP PC with Windows 11 pro: Processor: Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz, 3504 MHz, 12 core(s), 24 logical processor(s) Data carrier: Samsung SSD 970 EVO Plus 1TB 64GB RAM NVIDIA RTX 2080TI First attempt, without GPU support (because I didn't know any better): Python installed, first 3.12 (does not support torch, then downgraded to 3.11.7) Torch installed Transformers installed train.py executed CPU utilization > 10% and 14.4GB RAM After 16min cached_lm_GPT2Tokenizer_128_fivetech_forums_20231222.sql prepared - only then does the training begin - we always have this effort and it currently only runs on the CPU. Training after 8 hours and 3,400 runs, no output in fine-tuned model and remaining term > 1 year Process canceled manually. Second attempt, with GPU support: CUDA Toolkit 12.3 installed Torch uninstalled pip uninstall torch pip cache purge pip install torch -f <!-- m --><a class="postlink" href="https://download.pytorch.org/whl/torch_stable.html">https://download.pytorch.org/whl/torch_stable.html</a><!-- m --> torch.cuda.is_available() True train.py executed CPU utilization 5% and 12.3GB RAM Training after 7.5 hours and 3,860 runs, no output in fine-tuned model and remaining term < 1 year Process canceled manually. Third attempt, with GPU support: Transformers uninstalled pip uninstall transformers pip cache purge pip install transformers None of this should make any difference or bring about any improvement. in train.py save_steps reduced to 500 so that there should be an output in fine-tuned model. train.py executed It is striking that after around 300 runs the performance drops extremely, with < 200 runs < 2.4 seconds and with the 300th run it is already 5 seconds. CPU utilization 10% and 12.3GB RAM Training after 40 minutes with 500 runs - first output. Process canceled manually. Checkpoint 500 is transferred to wormhole.app. Fourth attempt to further reduce save_steps to 200 Training after 1.05 minutes, checkpoint 200 generated Training after 12.05 minutes, checkpoint 1200 generated Training after 18.21 minutes, Checkpoint 2000 generated Checkpoint 1600 and 1800 will be transferred to wormhole.app. But we need 1.6 million runs. So the save_steps need to be optimized and perhaps more.
phpBB to LLM
Dear Anton, many thanks for your help! I am reviewing the results <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
phpBB to LLM
Here you have run.py to test the model: run.py [code=fw:x5fgzs76]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">from</span> transformers import GPT2LMHeadModel, GPT2Tokenizer<br />import torch<br /><br /># Load the fine-tuned GPT<span style="color: #000000;">-2</span> model and tokenizer<br />fine_tuned_model_path = <span style="color: #ff0000;">"./fine-tuned-model"</span><br />model = GPT2LMHeadModel.from_pretrained<span style="color: #000000;">&#40;</span>fine_tuned_model_path<span style="color: #000000;">&#41;</span><br />tokenizer = GPT2Tokenizer.from_pretrained<span style="color: #000000;">&#40;</span>fine_tuned_model_path<span style="color: #000000;">&#41;</span><br /><br /># Input <span style="color: #0000ff;">prompt</span> <span style="color: #00C800;">for</span> <span style="color: #0000ff;">text</span> generation<br /><span style="color: #0000ff;">prompt</span> = <span style="color: #ff0000;">"what is a star ?"</span><br /><br /># Tokenize the input <span style="color: #0000ff;">prompt</span><br />input_ids = tokenizer.encode<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">prompt</span>, return_tensors=<span style="color: #ff0000;">"pt"</span><span style="color: #000000;">&#41;</span><br />attention_mask = torch.ones_like<span style="color: #000000;">&#40;</span>input_ids<span style="color: #000000;">&#41;</span><br />pad_token_id = tokenizer.eos_token_id<br />max_new_tokens = <span style="color: #000000;">50</span><br /><br /># Generate <span style="color: #0000ff;">text</span> using the fine-tuned model<br />output = model.generate<span style="color: #000000;">&#40;</span>input_ids, attention_mask=attention_mask, pad_token_id=pad_token_id, max_length=len<span style="color: #000000;">&#40;</span>input_ids<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> + max_new_tokens, num_beams=<span style="color: #000000;">5</span>, no_repeat_ngram_size=<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br /><br /># Decode the generated tokens back <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">text</span><br />generated_text = tokenizer.decode<span style="color: #000000;">&#40;</span>output<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span>, skip_special_tokens=<span style="color: #00C800;">True</span><span style="color: #000000;">&#41;</span><br /><br /># <span style="color: #00C800;">Print</span> the generated <span style="color: #0000ff;">text</span><br /><span style="color: #00C800;">print</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Generated Text:"</span>, generated_text<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:x5fgzs76]
phpBB to LLM
From posts.dbf and posts.fpt now we generate the dataset.json to be trained. We are using just 20 different topics, so the dataset is not too large and we can do quicker tests with it: dataset.prg [code=fw:36o1xfks]<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 />    <span style="color: #00C800;">local</span> aPosts := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, n<br /><br />    USE posts VIA <span style="color: #ff0000;">"dbfcdx"</span><br /><br />    <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> posts->topic + posts->date + posts->time + posts->forum <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">subject</span><br />    GO TOP<br /><br />    <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">20</span><br />       AAdd<span style="color: #000000;">&#40;</span> aPosts, GetTopic<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">next</span><br />    hb_memoWrit<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"dataset.json"</span>, hb_jsonEncode<span style="color: #000000;">&#40;</span> aPosts <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    XBrowser<span style="color: #000000;">&#40;</span> aPosts <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> GetTopic<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">local</span> hTopic := <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span>, cTopic := RTrim<span style="color: #000000;">&#40;</span> posts->topic <span style="color: #000000;">&#41;</span><br /><br />    hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"topic"</span> <span style="color: #000000;">&#93;</span>    = RTrim<span style="color: #000000;">&#40;</span> posts->topic <span style="color: #000000;">&#41;</span> <br />    hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />    AAdd<span style="color: #000000;">&#40;</span> hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span>, GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    SKIP <br />    <span style="color: #00C800;">while</span> posts->topic == cTopic<br />       AAdd<span style="color: #000000;">&#40;</span> hTopic<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"messages"</span> <span style="color: #000000;">&#93;</span>, GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />       SKIP <br />    end<br /><br /><span style="color: #00C800;">return</span> hTopic    <br /><br /><span style="color: #00C800;">function</span> GetPost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />    <span style="color: #00C800;">local</span> hPost := <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span><br /><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"topic"</span> <span style="color: #000000;">&#93;</span>    = RTrim<span style="color: #000000;">&#40;</span> posts->topic <span style="color: #000000;">&#41;</span><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"forum"</span> <span style="color: #000000;">&#93;</span>    = RTrim<span style="color: #000000;">&#40;</span> posts->forum <span style="color: #000000;">&#41;</span><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"username"</span> <span style="color: #000000;">&#93;</span> = RTrim<span style="color: #000000;">&#40;</span> posts->username <span style="color: #000000;">&#41;</span><br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"date"</span> <span style="color: #000000;">&#93;</span>     = posts->date <br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"time"</span> <span style="color: #000000;">&#93;</span>     = posts->time<br />    hPost<span style="color: #000000;">&#91;</span> <span style="color: #ff0000;">"text"</span> <span style="color: #000000;">&#93;</span>     = posts->text<br /><br /><span style="color: #00C800;">return</span> hPost    </div>[/code:36o1xfks] The structure of the generated json file is as follows: [code=fw:36o1xfks]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">&#91;</span><br />   <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"topic"</span>: <span style="color: #000000;">the</span> <span style="color: #0000ff;">title</span> <span style="color: #0000ff;">of</span> the topic,<br />      <span style="color: #ff0000;">"messages"</span>:<br />      <span style="color: #000000;">&#91;</span> <br />         <span style="color: #000000;">&#123;</span><br />            <span style="color: #ff0000;">"topic"</span>: <span style="color: #000000;">the</span> <span style="color: #0000ff;">title</span> <span style="color: #0000ff;">of</span> the topic,<br />            <span style="color: #ff0000;">"forum"</span>: <span style="color: #000000;">the</span> forum <span style="color: #0000ff;">name</span>,<br />            <span style="color: #ff0000;">"username"</span>: <span style="color: #0000ff;">name</span> <span style="color: #0000ff;">of</span> the author,<br />            <span style="color: #ff0000;">"date"</span>: <span style="color: #000000;">date</span> <span style="color: #0000ff;">of</span> the post,<br />            <span style="color: #ff0000;">"time"</span>: <span style="color: #000000;">time</span> <span style="color: #0000ff;">of</span> the post,<br />            <span style="color: #ff0000;">"text"</span>: <span style="color: #0000ff;">text</span> <span style="color: #0000ff;">of</span> the post<br />         <span style="color: #000000;">&#125;</span>,<br />        <span style="color: #00C800;">next</span> posts <span style="color: #00C800;">for</span> the same topic<br />      <span style="color: #000000;">&#93;</span><br />   <span style="color: #000000;">&#125;</span>,<br />   <span style="color: #00C800;">next</span> topic,<br />   ...<br /><span style="color: #000000;">&#93;</span></div>[/code:36o1xfks] so basically it is a list of the topics, with the name of the topic and the list of messages for such topic.
phpBB to LLM
Edited the first post of this topic with the right instructions: <!-- l --><a class="postlink-local" href="https://fivetechsupport.com/forums/viewtopic.php?p=266364&sid=34d610603696853e410ee75921e1424b#p266364">viewtopic.php?p=266364&sid=34d610603696853e410ee75921e1424b#p266364</a><!-- l -->
picture @Z
why the picture does not work "@Z" fields get? only works with the transform( function this also applies to date fields sample ====== local nCodigo := 0 local onCodigo transform( nCodigo , '@Z 9999' ) [code=fw:d2r9x4hm]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> onCodigo           <span style="color: #0000ff;">VAR</span> nCodigo         <span style="color: #0000ff;">ID</span> <span style="color: #000000;">107</span>   ;<br />            <span style="color: #0000ff;">OF</span> oCadFornecedor                                 ;<br />            <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999"</span>                                     ; <br />            <span style="color: #0000ff;">FONT</span> oFonteGets<br />  <br />* should appear empty field, only that it does not happen<br /><br />******* funciona assim<br />******* works well<br /><br />txtCodigoReduzido := Transform<span style="color: #000000;">&#40;</span> nI_Seq , <span style="color: #ff0000;">'@Z@R 999 999'</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> otxtCodigoReduzido                      ;<br />         <span style="color: #0000ff;">VAR</span>  txtCodigoReduzido                      ;<br />         <span style="color: #0000ff;">ID</span> <span style="color: #000000;">145</span>                                 ;<br />         <span style="color: #0000ff;">OF</span> oFolder:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>                 ;         <br />         <span style="color: #0000ff;">COLOR</span> CLR_HRED, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">202</span> <span style="color: #000000;">&#41;</span>    ;<br />         <span style="color: #0000ff;">FONT</span> oFonteGets      <br />*******<br />*******<br />******* <br /> </div>[/code:d2r9x4hm] [img] <!-- m --><a class="postlink" href="http://www.lopes.ms/fw/[email protected]">http://www.lopes.ms/fw/[email protected]</a><!-- m --> [/img]
picture en números de teléfonos
hola. Necesito que el usuario pueda ingresar asi (0342)452-4582 o tambien asi: (342)452-4582 ------> sin el cero defino el picture asi: [code=fw:1m0aeqjh]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"(9999)999-999999"</span>;<br /> </div>[/code:1m0aeqjh] Pero cuando se ingresa el dato queda esperando que se le haga un movimiento mas a la derecha para salir del parentesis. me explico? yo quiero que cuando el usuario presione: 3 4 2 ) salga del parentesis para poder ingresar (en el ejemplo) el número 4. Lo mismo me pasa con el numero de documento: [code=fw:1m0aeqjh]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99.999.999"</span></div>[/code:1m0aeqjh] En el caso que el usario solo tenga este numero 1.235.235 (tiene que poner un 0 delante del 1 porque sino no sigue) yo quiero que ponga el 1 el punto y que salte para que pueda poner el "2" gracias.
picture en números de teléfonos
tente com: picture "@r(###)####-####"
picture en xbrowse
Hola camaradas tengo el siguiente código [code=fw:2foy9qr4]<div class="fw" id="{CB}" style="font-family: monospace;">  <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">id</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">of</span> odlgx <span style="color: #0000ff;">update</span>;<br />                    columns <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span>;<br />                    COLSIZES <span style="color: #000000;">80</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">190</span>,<span style="color: #000000;">100</span>,<span style="color: #000000;">100</span>,<span style="color: #000000;">100</span>;<br />                    HEADERS <span style="color: #ff0000;">"Fecha"</span>, <span style="color: #ff0000;">"Comprobante"</span>, <span style="color: #ff0000;">"Descripción"</span>,<span style="color: #ff0000;">"Debe"</span> ,<span style="color: #ff0000;">"Haber"</span>,<span style="color: #ff0000;">"Total"</span>;<br />                    PICTURES <span style="color: #ff0000;">"@d"</span>, <span style="color: #00C800;">nil</span>,<span style="color: #00C800;">NIL</span>,<span style="color: #ff0000;">"@e 99,999,999.99"</span>,<span style="color: #ff0000;">"@e 99,999,999.99"</span>,<span style="color: #ff0000;">"@e 99,999,999.99"</span> ;<br />                    OBJECT oCtae lines cell<br /><br /><br /><br />  WITH OBJECT oBrw<br />     :<span style="color: #000000;">nMarqueeStyle</span> := <span style="color: #000000;">4</span><br />     :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br />     :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br />     :<span style="color: #000000;">lColDividerComplete</span> := .f.<br />     :<span style="color: #000000;">l2007</span> := .t.<br />     :<span style="color: #000000;">lAllowColHiding</span> := .f.<br />  END WITH<br /><br />  WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />     :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">npro</span> = nproa,oCtae:<span style="color: #000000;">fecha</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />     :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />  END WITH<br /><br />  WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />     :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">factura</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />  END WITH<br /><br />  WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />     :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">opera</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     :<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />  END WITH<br /><br />  WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />     :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>||iif<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">npro</span> = nproa, IIF<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">lsumo</span>,oCtae:<span style="color: #000000;">importe</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />  END WITH<br /><br />  WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><br />     :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">npro</span> = nproa,IIF<span style="color: #000000;">&#40;</span>!oCtae:<span style="color: #000000;">lsumo</span>,oCtae:<span style="color: #000000;">importe</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />  END WITH<br /><br />  WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span><br />     :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">npro</span> = nproa,oCtae:<span style="color: #000000;">saldo</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />  END WITH</div>[/code:2foy9qr4] y no me respeta los pictures numéricos me los muestra [color=#FF0000:2foy9qr4]12345.00[/color:2foy9qr4] en vez de [color=#FF0080:2foy9qr4]12.345,00[/color:2foy9qr4] Esto sólo me pasa en los xbrowse en los wbrowse los muestra correctamente. Viendo en los ejemplos encontre XBrNumFormat( 'E', .t. ) , pero tampoco lo respeta ¿Como hay que definir las columnas? Luis
picture en xbrowse
Buen dia, con bStrData a mi me funciona asi, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> WITH OBJECT oBrw:aCols[8] :cHeader := "MONTO" [b:2ptygfxv]:bStrData := {|| IIF( oQryBancos:LastRec() == 0, SPACE(10) ,; TRANSFORM( oQryBancos:mov_mtomovi, "@E 9,999,999.99" ) ) }[/b:2ptygfxv] :nWidth := 70 :bEditValue := "@E 9,999,999.99" :nFootStrAlign := AL_RIGHT :lTotal := .t. :nTotal := 0 // sumamtomovi( oQryBancos ) :nFooterType := AGGR_SUM :nEditType := EDIT_GET :bEditValid := { | oGet, oCol | mayorqcero( oGet:value() ) } :bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,; ( oCol:value := xVal ,; totalinea( oBrw, aVar, aGet ) ,; graba_movbco( lNew, aVar, oDlg, oBrw, oQryBancos ) ,; addrow( oBrw, oQryBancos, lNew ) ), ) } :bEditWhen := {|| !EMPTY( aItems[oBrw:nArrayAt, 1] ) } END WITH
picture en xbrowse
Gracias nuevamente José Luis, ahora lo muestra correctamente. Pero no tendría que ser lo lógico que una vez que definís el xbrowse, este tomara los picture correctamente. Con que necesidad los declaro si luego tengo que hacerlo columna por columna??? O hay otra forma de declararlo a como lo hago? Luis
picture en xbrowse
Nunca lo he manejado definiendolos arriba en el xbrowse porque me pasaba lo mismo que a ti, asi que los defino en sus columnas, nose si es porque es con bstrdata, pruebalo con bEditValue haber si asi si toma la definicion de la mascara en el xbrowse y no por columnas, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
picture en xbrowse
Gracias José , lo probé pero no funciona. Así que será como me indicaste anteriormente. Luis
picture en xbrowse
Mr surGom Please NEVER use bStrData. Instead assign the codeblock to bEditValue. Example: [code=fw:au2ikxdn]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">npro</span> = nproa,oCtae:<span style="color: #000000;">fecha</span>, CTOD<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// :nDataStrAlign := AL_RIGHT // not necessary because Dates are automatically justified right.</span><br />&nbsp; END WITH<br />&nbsp;</div>[/code:au2ikxdn] It is a good practice to declare the formatting with XbrNumFormat( "E", .t. ). XBrowse's internally generated format will respect this setting through out the application. If you change "E" as "A", then the entire application will use American format. However you should not directly hardcode the picture strings as "@E 999". Instead use the Function NumPict( 12, 2 ) // 12 is total size and 2 decimal places. Example: [code=fw:au2ikxdn]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">&#123;</span>||iif<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">npro</span> = nproa, IIF<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">lsumo</span>,oCtae:<span style="color: #000000;">importe</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">cEditPicture</span> := NumPict<span style="color: #000000;">&#40;</span> <span style="color: #000000;">12</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// numbers are automatically justified right. We need not specifically specify AL_RIGHT</span><br />&nbsp; END WITH<br />&nbsp;</div>[/code:au2ikxdn] I would still advise declare all column codeblocks and picture clauses inside the main XBROWSE command. Please remember that XBrowse is created to achieve more complex work with least code.
picture en xbrowse
Mr SurGom This is a suggested replacement of the code you posted above. [code=fw:1uo3hhgf]<div class="fw" id="{CB}" style="font-family: monospace;"><br />XBrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// This may be placed at the beginning of Main() function.</span><br /><br />cAmtPict    := NumPict<span style="color: #000000;">&#40;</span> <span style="color: #000000;">11</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br />aCols := <span style="color: #000000;">&#123;</span> ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">fecha</span>, BLANK<span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">fecha</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"Fetcha"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">80</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">factura</span>, BLANK<span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">factura</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"Comprobante"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">90</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">opera</span>, BLANK<span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">opera</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"Description"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">190</span> <span style="color: #000000;">&#41;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa .and.   oCtae:<span style="color: #000000;">lsumo</span>, oCtae:<span style="color: #000000;">importe</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"Debe"</span>,  cAmtPict, <span style="color: #000000;">100</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa .and. ! oCtae:<span style="color: #000000;">lsumo</span>, oCtae:<span style="color: #000000;">importe</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, &nbsp;<span style="color: #ff0000;">"Haber"</span>, cAmtPict, <span style="color: #000000;">100</span> <span style="color: #000000;">&#125;</span>, ;<br /><span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">saldo</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"Total"</span>, cAmtPict, <span style="color: #000000;">100</span> <span style="color: #000000;">&#125;</span> ;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlgx COLUMNS aCols DATASOURCE oCtae ;<br />   LINES CELL <span style="color: #0000ff;">UPDATE</span><br />   <br />WITH OBJECT oBrw<br />&nbsp; &nbsp;:<span style="color: #000000;">lDisplayZeros</span> := .f.<br />   :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWRC<br />   <span style="color: #B900B9;">// :nColDividerStyle := LINESTYLE_BLACK  // default</span><br />   :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br />   :<span style="color: #000000;">lColDividerComplete</span> := .f.<br />   <span style="color: #B900B9;">// :l2007 := .t.   // default</span><br />   :<span style="color: #000000;">lAllowColHiding</span> := .f.<br />END WITH<br /> </div>[/code:1uo3hhgf] Another Alternative [code=fw:1uo3hhgf]<div class="fw" id="{CB}" style="font-family: monospace;">XbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">&#41;</span><br />cAmtPict    := NumPict<span style="color: #000000;">&#40;</span> <span style="color: #000000;">11</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlgx DATASOURCE oCtae ;<br />   COLUMNS ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">fecha</span>, BLANK<span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">fecha</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">factura</span>, BLANK<span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">factura</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">opera</span>, BLANK<span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">opera</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa .and.   oCtae:<span style="color: #000000;">lsumo</span>, oCtae:<span style="color: #000000;">importe</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa .and. ! oCtae:<span style="color: #000000;">lsumo</span>, oCtae:<span style="color: #000000;">importe</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">saldo</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />   HEADERS <span style="color: #ff0000;">"Fecha"</span>, <span style="color: #ff0000;">"Comprobante"</span>, <span style="color: #ff0000;">"Descripción"</span>,<span style="color: #ff0000;">"Debe"</span> ,<span style="color: #ff0000;">"Haber"</span>,<span style="color: #ff0000;">"Total"</span>;<br />   PICTURES <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>,<span style="color: #00C800;">NIL</span>, cAmtPict, cAmtPict, cAmtPict ;<br />   LINES CELL <span style="color: #0000ff;">UPDATE</span><br />    <br />WITH OBJECT oBrw<br />&nbsp; &nbsp;:<span style="color: #000000;">lDisplayZeros</span> := .f.<br />   :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWRC<br />   <span style="color: #B900B9;">// :nColDividerStyle := LINESTYLE_BLACK  // default</span><br />   :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br />   :<span style="color: #000000;">lColDividerComplete</span> := .f.<br />   <span style="color: #B900B9;">// :l2007 := .t.   // default</span><br />   :<span style="color: #000000;">lAllowColHiding</span> := .f.<br />END WITH<br /> </div>[/code:1uo3hhgf]
picture en xbrowse
Gracias Nageswaragunupudi lo voy a implementar. Luis
picture en xbrowse
I forgot this please add this line oBrw:lDisplayZeros := .f. // default value is .t. When this is .f., blank values are shown as complete blanks instead of 0,00 or " / / ", etc I also edited the code posted above making some small but important corrections.
picture en xbrowse
Nageswaragunupudi, when I put your code does the following: (is equal to datasource that object) [url=http&#58;//www&#46;4shared&#46;com/photo/obJumwJW/xbrowse&#46;html:3oxsfvvx][img:3oxsfvvx]http&#58;//dc427&#46;4shared&#46;com/img/obJumwJW/xbrowse&#46;jpg[/img:3oxsfvvx][/url:3oxsfvvx] [code=fw:3oxsfvvx]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"splitter.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"report.ch"</span><br /><br /><span style="color: #00C800;">static</span> octae<br /><br /><span style="color: #00C800;">FUNCTION</span> xBrwgen<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">local</span> odlgx<br /><span style="color: #00C800;">local</span> oBrw, oSpli<br /><span style="color: #00C800;">local</span> nProa := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> napea<br /><span style="color: #00C800;">local</span> aMae := array<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oGet := array<span style="color: #000000;">&#40;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> beval  := <span style="color: #000000;">&#123;</span>|| aMae := iif<span style="color: #000000;">&#40;</span>empty<span style="color: #000000;">&#40;</span>nproa<span style="color: #000000;">&#41;</span>,buspro<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,buspro<span style="color: #000000;">&#40;</span>nproa<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, iif<span style="color: #000000;">&#40;</span>len<span style="color: #000000;">&#40;</span>aMae<span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span>,<span style="color: #000000;">&#40;</span>nproa := aMae<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,napea := aMae<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>,odlgx:<span style="color: #0000ff;">update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,filtro<span style="color: #000000;">&#40;</span>nproa,oBrw,oGet,oDlgx<span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span>,odlgx:<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;">&#125;</span><br /><span style="color: #00C800;">local</span> aSelGrad := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> .<span style="color: #000000;">5</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">251</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">237</span>, <span style="color: #000000;">178</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                    <span style="color: #000000;">&#123;</span> .<span style="color: #000000;">5</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">218</span>, <span style="color: #000000;">103</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">162</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> aGradBarSel := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span>.<span style="color: #000000;">5</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">251</span><span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">196</span>, <span style="color: #000000;">178</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span> .<span style="color: #000000;">5</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">218</span>, <span style="color: #000000;">103</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">162</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">local</span> nSaldo := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> z := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> cAmtPict<br /><br /><br /><br /> <span style="color: #00C800;">if</span> !pasaje<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"CTAEXPO"</span><span style="color: #000000;">&#41;</span>;return <span style="color: #00C800;">nil</span>; <span style="color: #00C800;">endif</span><br />   DATABASE oCtae<br />   oCtae:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />   oCtae:<span style="color: #000000;">beof</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">nil</span><span style="color: #000000;">&#125;</span><br />   oCtae:<span style="color: #000000;">bBoF</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">nil</span><span style="color: #000000;">&#125;</span><br />   oCtae:<span style="color: #000000;">setfilter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->npro = <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">//oCtae:setfilter( "(oCtae:cAlias)->npro = 0 " )</span><br /><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgx <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"dia_xbrowse"</span><br /><br /><br />  <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> nproa <span style="color: #0000ff;">id</span> <span style="color: #000000;">121</span> <span style="color: #0000ff;">of</span> odlgx <span style="color: #0000ff;">update</span> <span style="color: #0000ff;">valid</span> eval<span style="color: #000000;">&#40;</span>beval<span style="color: #000000;">&#41;</span><br />  <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> napea <span style="color: #0000ff;">id</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">of</span> odlgx <span style="color: #0000ff;">update</span><br /><br />  <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">of</span> oDlgx <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"btngastos"</span>,<span style="color: #ff0000;">"btnastos1"</span> <span style="color: #0000ff;">ACTION</span> ctaexpo<span style="color: #000000;">&#40;</span>oCtae,oBrw,nproa,.t.,.t.<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">update</span><br />  <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">of</span> oDlgx <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"btnpagos"</span>,<span style="color: #ff0000;">"btnpagos1"</span> <span style="color: #0000ff;">ACTION</span> ctaexpo<span style="color: #000000;">&#40;</span>oCtae,oBrw,nproa,.f.,.t.<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">update</span><br />  <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">103</span> <span style="color: #0000ff;">of</span> oDlgx <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"btncambiar"</span>,<span style="color: #ff0000;">"btncambiar1"</span> <span style="color: #0000ff;">ACTION</span> ctaexpo<span style="color: #000000;">&#40;</span>oCtae,oBrw,nproa,,.f.<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">update</span><br />  <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">of</span> oDlgx <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"BTNIMPRI"</span>,<span style="color: #ff0000;">"BTNIMPRI1"</span> <span style="color: #0000ff;">ACTION</span> Reporte<span style="color: #000000;">&#40;</span>nProa,oCtae<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">update</span><br />  <span style="color: #B900B9;">//REDEFINE BTNBMP oGet[7] id 105 of oDlgx resource "BTNELIMINA","BTNELIMINA1" ACTION borrar(nProa,oCtae)</span><br /><br />  <span style="color: #00C800;">for</span> z = <span style="color: #000000;">3</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">6</span><br />       oGet<span style="color: #000000;">&#91;</span>z<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">next</span><br /><br />  <span style="color: #0000ff;">REDEFINE</span> SPLITTER oSpli <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">COLOR</span> rgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">234</span>,<span style="color: #000000;">234</span>,<span style="color: #000000;">234</span><span style="color: #000000;">&#41;</span>  <span style="color: #0000ff;">of</span> odlgx _3DLOOK<br /> <br /><br />XbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">&#41;</span><br />cAmtPict    := NumPict<span style="color: #000000;">&#40;</span> <span style="color: #000000;">11</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlgx OBJECT oCtae;<br />   COLUMNS ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">fecha</span>,  <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">factura</span>, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">opera</span>, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa .and.   oCtae:<span style="color: #000000;">lsumo</span>, oCtae:<span style="color: #000000;">importe</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa .and. ! oCtae:<span style="color: #000000;">lsumo</span>, oCtae:<span style="color: #000000;">importe</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,  ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCtae:<span style="color: #000000;">npro</span> = nproa, oCtae:<span style="color: #000000;">saldo</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span> ;<br />   HEADERS <span style="color: #ff0000;">"Fecha"</span>, <span style="color: #ff0000;">"Comprobante"</span>, <span style="color: #ff0000;">"Descripción"</span>,<span style="color: #ff0000;">"Debe"</span> ,<span style="color: #ff0000;">"Haber"</span>,<span style="color: #ff0000;">"Total"</span>;<br />   COLSIZES <span style="color: #000000;">80</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">190</span>,<span style="color: #000000;">100</span>,<span style="color: #000000;">100</span>,<span style="color: #000000;">100</span>;<br />   PICTURES <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>,<span style="color: #00C800;">NIL</span>, cAmtPict, cAmtPict, cAmtPict ;<br />   LINES CELL <span style="color: #0000ff;">UPDATE</span><br /><br />WITH OBJECT oBrw<br />   :<span style="color: #000000;">lDisplayZeros</span> := .f.<br />   :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWRC<br />   <span style="color: #B900B9;">// :nColDividerStyle := LINESTYLE_BLACK  // default</span><br />   :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br />   :<span style="color: #000000;">lColDividerComplete</span> := .f.<br />   <span style="color: #B900B9;">// :l2007 := .t.   // default</span><br />   :<span style="color: #000000;">lAllowColHiding</span> := .f.<br />END WITH<br /><br /><br /><br />  <br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> odlgx<br /><br /> cierroalias<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">cAlias</span>,oCtae<span style="color: #000000;">&#41;</span><br /><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">/***************************************************************************/</span><br /> <span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> borrar<span style="color: #000000;">&#40;</span>nProa,oCtae<span style="color: #000000;">&#41;</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">/***************************************************************************/</span><br /> <span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> filtro<span style="color: #000000;">&#40;</span>nproa,oBrw,oGet,odlgx<span style="color: #000000;">&#41;</span><br /> <span style="color: #00C800;">local</span> z := <span style="color: #000000;">0</span><br />  oCtae:<span style="color: #000000;">setfilter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  oCtae:<span style="color: #000000;">setfilter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->npro = nproa<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">for</span> z = <span style="color: #000000;">3</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">6</span><br />       oGet<span style="color: #000000;">&#91;</span>z<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">next</span><br />  odlgx:<span style="color: #0000ff;">update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  oBrw:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  oBrw:<span style="color: #000000;">gobottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">/***************************************************************************/</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> reporte<span style="color: #000000;">&#40;</span>nproa <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oinfo<br /><span style="color: #00C800;">local</span> dFec := dehasta<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cAlias<br /><br /><br /><br /><br /><span style="color: #00C800;">if</span> empty<span style="color: #000000;">&#40;</span>dFec<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">if</span> !pasaje<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ctaexpo"</span><span style="color: #000000;">&#41;</span>;return <span style="color: #00C800;">nil</span>;endif<br />   cAlias := <span style="color: #0000ff;">alias</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   set order <span style="color: #0000ff;">to</span> <span style="color: #000000;">1</span><br /><br />   set filter <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->npro = nproa<br />   dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   dbseek<span style="color: #000000;">&#40;</span>dFec<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><br /><br />REPORT oInfo <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Movimiento de Cuenta"</span> preview;<br />FOOTER <span style="color: #ff0000;">"Página Nro:"</span>+str<span style="color: #000000;">&#40;</span>oInfo:<span style="color: #000000;">nPage</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">RIGHT</span>;<br />CAPTION <span style="color: #ff0000;">"Visualizar movimientos"</span><br /><br />COLUMN <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->fecha <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Fecha"</span> <span style="color: #0000ff;">picture</span> <span style="color: #ff0000;">"@d"</span><br />COLUMN <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->factura  <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Comprobante"</span><br />COLUMN <span style="color: #00C800;">DATA</span> Alltrim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->opera<span style="color: #000000;">&#41;</span>  <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Detalle"</span><br />COLUMN <span style="color: #00C800;">DATA</span> iif<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->lsumo,<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->importe,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Debe"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E 9,999,999.99"</span> <span style="color: #0000ff;">RIGHT</span><br />COLUMN <span style="color: #00C800;">DATA</span> iif<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->lsumo,space<span style="color: #000000;">&#40;</span><span style="color: #000000;">14</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->importe<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Haber"</span> <span style="color: #0000ff;">PICTURE</span> iif<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->lsumo,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">"@E 9,999,999.99"</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">RIGHT</span><br />COLUMN <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->saldo <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Saldo"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E 9,999,999.99"</span> <span style="color: #0000ff;">RIGHT</span><br /><br />ENDREPORT<br /><br />oInfo:<span style="color: #000000;">nTitleUpLine</span> := RPT_SINGLELINE<br />oInfo:<span style="color: #000000;">nTitleDnLine</span> := RPT_SINGLELINE<br />oInfo:<span style="color: #000000;">nTotalLine</span> := RPT_SINGLELINE<br /><br /><span style="color: #0000ff;">ACTIVATE</span> REPORT oInfo <span style="color: #00C800;">WHILE</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->fecha<span style="color: #000000;">&#41;</span> >= dFec<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> .and. <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->fecha <=  dFec<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 />dbclosearea<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 /><span style="color: #B900B9;">/******************************************************************************/</span><br /><br /> </div>[/code:3oxsfvvx] with other code, it displayed correctly [url=http&#58;//www&#46;4shared&#46;com/photo/fLpth_s_/xbrowse1&#46;html:3oxsfvvx][img:3oxsfvvx]http&#58;//dc674&#46;4shared&#46;com/img/fLpth_s_/xbrowse1&#46;jpg[/img:3oxsfvvx][/url:3oxsfvvx] Thank you Luis
picture en xbrowse
I needed to add [code=fw:c96tu2d4]<div class="fw" id="{CB}" style="font-family: monospace;"> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| oCtae:<span style="color: #000000;">fecha</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />&nbsp; END WITH<br /><br />&nbsp; WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| oCtae:<span style="color: #000000;">factura</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />&nbsp; END WITH<br /><br />&nbsp; WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| oCtae:<span style="color: #000000;">opera</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />&nbsp; END WITH<br /><br />&nbsp; WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| oCtae:<span style="color: #000000;">importe</span> &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp;&nbsp; &nbsp; :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />&nbsp; END WITH<br /><br />&nbsp; WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| oCtae:<span style="color: #000000;">importe</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />&nbsp; END WITH<br /><br />&nbsp; WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| oCtae:<span style="color: #000000;">saldo</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />&nbsp; END WITH</div>[/code:c96tu2d4] Thanks you Luis
picture fields data e numeric
como tratar a exibição dos campos de data e numéricos ? no modo texto funciona com "@k" como funciona no fw ? gostaria de exibir como no quadro verde quando os campos estiverem vazios [img:242zcva5]http&#58;//www&#46;lopes&#46;ms/fw/data%20vazia%20e%20campo%20n%famerico%20vazio&#46;JPG[/img:242zcva5]
picture fields data e numeric
zazibr: Para campos numericos usa el PICTURE como sigue "@Z 9,999.99" Saludos
picture get transform y round
Estimados amigos, Necesito formular los campos get's numéricos a 2 decimales. Hasta aquí no hay problema, si introduzco en el campo "oGet:cText()" un valor con mas decimales de los que refleja el picture, el dato se muestra redondeado. oGet:cText( 111.120 ) --> 111.12 oGet:cText( 111.124 ) --> 111.12 oGet:cText( 111.125 ) --> 111.13 El problema es que ahora necesito que se redondee una posición hacia arriba, si el resto de decimales es mayor de cero. oGet:cText( 111.120 ) --> 111.12 oGet:cText( 111.124 ) --> 111.13 oGet:cText( 111.125 ) --> 111.13
picture get transform y round
Prueba en el VALID sumar 0.005 Es una idea, aunque el valor quedará alterado.
picture get transform y round
Muchas gracias por la respuesta, El problema es que sólo quiero cambiar el valor de presentación. El valor del campo necesito que siga siendo el mismo
picture get transform y round
Hola, la libreria ft_roud() de Nanfor.lib te puede servir. Esta en Harbour y xHarbour Saludos Ruben Dario Fernandez[code=fw:1sh7c89f]<div class="fw" id="{CB}" style="font-family: monospace;">FT_ROUND<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;Rounds a number <span style="color: #0000ff;">to</span> a specific place<br /><br />&nbsp;Syntax<br /><br />&nbsp; &nbsp; &nbsp; FT_ROUND<span style="color: #000000;">&#40;</span> <nNumber> <span style="color: #000000;">&#91;</span>, <nRoundToAmount> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>, <cRoundType> &nbsp;<span style="color: #000000;">&#91;</span>, <cRoundDirection> &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>, <nAcceptableError> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-> nNumber<br /><br />&nbsp;Arguments<br /><br />&nbsp; &nbsp; &nbsp;<nNumber> is the number <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">round</span><br /><br />&nbsp; &nbsp; &nbsp;<nRoundToAmount> is the fraction <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">round</span> <span style="color: #0000ff;">to</span> or the number <span style="color: #0000ff;">of</span> places,<br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">default</span> is <span style="color: #000000;">2</span>.<br /><br />&nbsp; &nbsp; &nbsp;<cRoundType> is the type <span style="color: #0000ff;">of</span> rounding desired<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"D"</span> <span style="color: #00C800;">for</span> Decimal &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span> <span style="color: #00C800;">for</span> thousandth, <span style="color: #000000;">1</span>/<span style="color: #000000;">1000</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#40;</span><span style="color: #00C800;">default</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"F"</span> <span style="color: #00C800;">for</span> Fraction &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span> <span style="color: #00C800;">for</span> thirds, <span style="color: #000000;">1</span>/<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"W"</span> <span style="color: #00C800;">for</span> Whole numbers <span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span> <span style="color: #00C800;">for</span> thousand, <span style="color: #000000;">1000</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;<cRoundDirection> is the direction <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">round</span> the number toward<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"U"</span> <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">round</span> <span style="color: #0000ff;">Up</span> &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1.31</span> -> &nbsp;<span style="color: #000000;">1.4</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">-1.31</span> -> <span style="color: #000000;">-1.4</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"D"</span> <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">round</span> <span style="color: #0000ff;">Down</span> &nbsp; &nbsp;<span style="color: #000000;">1.36</span> -> &nbsp;<span style="color: #000000;">1.3</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">-1.36</span> -> <span style="color: #000000;">-1.3</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"N"</span> <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">round</span> <span style="color: #0000ff;">Normal</span> &nbsp;<span style="color: #000000;">1.5</span> &nbsp;-> &nbsp;<span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">-1.5</span> &nbsp;-> <span style="color: #000000;">-2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1.49</span> -> &nbsp;<span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">-1.49</span> -> <span style="color: #000000;">-1</span><br /><br />&nbsp; &nbsp; &nbsp;<nAcceptableError> is the amount that is considered acceptable<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">to</span> be within, i.e., <span style="color: #00C800;">if</span> you<span style="color: #ff0000;">'re within this amount of the number<br />&nbsp; &nbsp; &nbsp;you don'</span>t need <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">round</span><br /><br />&nbsp;Returns<br /><br />&nbsp; &nbsp; &nbsp;The number, rounded as specified.<br /><br />&nbsp;Description<br /><br />&nbsp; &nbsp; &nbsp;This <span style="color: #00C800;">function</span> will allow you <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">round</span> a number. &nbsp;The following can<br />&nbsp; &nbsp; &nbsp;be specified:<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">a</span>. Direction <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">up</span>, <span style="color: #0000ff;">down</span> or <span style="color: #0000ff;">normal</span> - <span style="color: #0000ff;">normal</span> is <span style="color: #000000;">4</span>/<span style="color: #000000;">5</span> convention<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;b. Type <span style="color: #000000;">&#40;</span>whole, decimal, fraction<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;c. Amount <span style="color: #000000;">&#40;</span><span style="color: #000000;">100</span><span style="color: #ff0000;">'s, 5 decimals, 16th, etc.)<br /><br />&nbsp;Examples<br /><br />&nbsp; &nbsp; &nbsp;// round normal to 2 decimal places<br />&nbsp; &nbsp; &nbsp;nDollars := FT_ROUND(nDollars)<br /><br />&nbsp; &nbsp; &nbsp;// round normal to 6 decimal places<br />&nbsp; &nbsp; &nbsp;nIntRate := FT_ROUND(nIntRate, 6)<br /><br />&nbsp; &nbsp; &nbsp;// round to nearest thousands<br />&nbsp; &nbsp; &nbsp;nPrice &nbsp; := FT_ROUND(nPrice, 3, NEAREST_WHOLE_NUMBER)<br /><br />&nbsp; &nbsp; &nbsp;// round Up to nearest third<br />&nbsp; &nbsp; &nbsp;nAmount &nbsp;:= FT_ROUND(nAmount, 3, NEAREST_FRACTION, ROUND_UP)<br /><br />&nbsp; &nbsp; &nbsp;// round down to 3 decimals Within .005<br />&nbsp; &nbsp; &nbsp;nAvg &nbsp; &nbsp; := FT_ROUND(nAvg, 3, , ROUND_DOWN, .005)<br /></span></div>[/code:1sh7c89f]
picture get transform y round
Muchas gracias Rubén, La función puede hacer los cálculos exactamente como lo necesito. Pero como se lo aplico a los pictures de los get's
picture get transform y round
Una locura perooo, quizas duplicando las variables. nUno := 111.143 nUnoAMostrar := FT_Roud(nUno,......) Queda feo pero.. Saludos Ruben Dario Fernandez
picture get transform y round
Muchas gracias a todos, Al final he cambiado la clase TClipGet que llama a la clase Get de Harbour. He añadido 2 métodos y una variable: [code=fw:2vvpcj7f]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Data</span> Ghe_nDecimal <span style="color: #0000ff;">init</span> <span style="color: #000000;">-1</span></div>[/code:2vvpcj7f]Que define el número de decimales a redondear He modificado los métodos PutMask y unTransform que se encargan de la presentación en pantalla. [code=fw:2vvpcj7f]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> PutMask<span style="color: #000000;">&#40;</span> xValue, lEdit <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> TClipGet<br /><span style="color: #00C800;">local</span> nSalto, xValue2<br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">GHE_nDecimal</span><><span style="color: #000000;">-1</span> .and. Valtype<span style="color: #000000;">&#40;</span>xValue<span style="color: #000000;">&#41;</span>=<span style="color: #ff0000;">'N'</span><br />  nSalto := <span style="color: #000000;">4</span> / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span>^<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">GHE_nDecimal</span><span style="color: #000000;">+1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />  xValue := xValue+nSalto<br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">PutMask</span><span style="color: #000000;">&#40;</span> xValue, lEdit <span style="color: #000000;">&#41;</span> <br /><br /><br /><br /><span style="color: #00C800;">METHOD</span> unTransform<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">Class</span> TClipGet<br /><span style="color: #00C800;">local</span> xValue, nSalto<br />xValue := ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">unTransform</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">if</span> ::<span style="color: #000000;">GHE_nDecimal</span><><span style="color: #000000;">-1</span> .and. Valtype<span style="color: #000000;">&#40;</span>xValue<span style="color: #000000;">&#41;</span>=<span style="color: #ff0000;">'N'</span> .and. Valtype<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">Original</span><span style="color: #000000;">&#41;</span>=<span style="color: #ff0000;">'N'</span><br />  nSalto := <span style="color: #000000;">4</span> / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span>^<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">GHE_nDecimal</span><span style="color: #000000;">+1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">if</span> ::<span style="color: #000000;">VarGet</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+nSalto == xValue .or. <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">VarGet</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+nSalto, ::<span style="color: #000000;">GHE_nDecimal</span><span style="color: #000000;">&#41;</span>==xValue<br />    xValue := ::<span style="color: #000000;">VarGet</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">else</span><br />    xValue := xValue-nSalto<br />  <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> xValue<br /> </div>[/code:2vvpcj7f] De momento y con la pruebas que he realizado funciona. Seguiré haciendo pruebas, para saber si funciona bien o si tendré algún problema.
picture para Email?
Alguien compuso algo para que se pueda ingresar solo email en un get? o que valide que lo que se ha ingresado es email? (para que no metan mysql inyectado). gracias.
picture para Email?
Lo mejor es que uses expresiones regulares ( hb_regex() ). Construir la expresión regular al principio parece algo engorroso, pero en google tienes bastantes de definidas, para e-mail puede servirte la siguiente ^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$
picture para Email?
eso andaba buscando. gracias.
picture para Email?
[code=fw:7hxv8f92]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> ValidEmailAddress<span style="color: #000000;">&#40;</span> cMailAddress <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cRegEx := <span style="color: #ff0000;">"^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+<span style="color: #000000;">\.</span>[a-zA-Z]{2,4}$"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> lIsValid := <span style="color: #00C800;">FALSE</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span>cMailAddress<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">LIKE</span> cRegEx <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lIsValid := <span style="color: #00C800;">TRUE</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> lIsValid<br />&nbsp;</div>[/code:7hxv8f92]
picture para Email?
[quote="carlos vargas":1tl0j4l7][code=fw:1tl0j4l7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> ValidEmailAddress<span style="color: #000000;">&#40;</span> cMailAddress <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> cRegEx := <span style="color: #ff0000;">"^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+<span style="color: #000000;">\.</span>[a-zA-Z]{2,4}$"</span><br />   <span style="color: #00C800;">LOCAL</span> lIsValid := <span style="color: #00C800;">FALSE</span><br /><br />   <span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span>cMailAddress<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">LIKE</span> cRegEx <span style="color: #000000;">&#41;</span><br />      lIsValid := <span style="color: #00C800;">TRUE</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> lIsValid<br /> </div>[/code:1tl0j4l7][/quote:1tl0j4l7] gracias!
pictures en los GET
Hola. TEngo que hacer que un GET permita ingresar en esta forma: 99999-99-999999 los 9 son numeros y no necesariamente deben tener la cantidad de digitos que se piden en el grupo 2 y tres (-99-999999) , lo que si se pide es que al principio tenga la cantidad que se pide ahi 99999 (cinco numeros) Como lo encaro? Gracias.
pintar filas en xbrowse multiselect- SOLUCIONADO-
Hola estoy tratando de pintar filas en un xbrowse multiselect y no puedo hacerlo funcionar, les muestro el código haber si saben cual es el motivo [code=fw:1k1gr004]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">if</span> !pasaje<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"factura"</span><span style="color: #000000;">&#41;</span>;return <span style="color: #00C800;">nil</span>;endif<br />   database oFac<br />   oFac:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><br /><br /><br />   oFac:<span style="color: #000000;">ordscope</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,nclia<span style="color: #000000;">&#41;</span><br />   oFac:<span style="color: #000000;">ordscope</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>,nclia<span style="color: #000000;">&#41;</span><br /><br />   oFac:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <br />   <span style="color: #B900B9;">//  oFac:setfilter("paga" != "S" .and. "nota" != "C" .)</span><br /><br />   <span style="color: #B900B9;">//FW_DbfToArray ( cFieldList, bFor, bWhile, nNext, nRec, lRest, aData )</span><br /><br /><br />   <span style="color: #B900B9;">//aRows := FW_DbfToArray( "DATE,TERMINAL,VALUE", { || FIELD->DATE = dDate } )</span><br />  <span style="color: #B900B9;">// aItems := fw_dbftoarray("fechida,nrofac,Importe,nota",  { || paga != "S" .and. nota != "C" })</span><br />   <span style="color: #B900B9;">// oFac:deactivate()</span><br />   <span style="color: #00C800;">do</span><br />      <span style="color: #00C800;">if</span> paga != <span style="color: #ff0000;">"S"</span> .and. nota != <span style="color: #ff0000;">"C"</span><br />         AAdd<span style="color: #000000;">&#40;</span> aItems,<span style="color: #000000;">&#123;</span>oFac:<span style="color: #000000;">fechida</span>,oFac:<span style="color: #000000;">nrofac</span>,oFac:<span style="color: #000000;">importe</span>, IIF<span style="color: #000000;">&#40;</span>oFac:<span style="color: #000000;">nota</span> = <span style="color: #ff0000;">"D"</span>, .t.,.f.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />         <br />      <span style="color: #00C800;">endif</span>   <br />      oFac:<span style="color: #000000;">skip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <br />   until oFac:<span style="color: #000000;">eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   xbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E"</span>, .T. <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> odlg1 <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"DIA_ASOCIO1"</span><br /><br />   <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">xBrowse</span> oBrw <span style="color: #0000ff;">Of</span> odlg1 array aItems ;               <span style="color: #B900B9;">//             Columns 'fechida','nrofac','Importe'  ;</span><br />             columns <span style="color: #000000;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#125;</span>;<br />             Headers <span style="color: #ff0000;">'Fecha'</span>,<span style="color: #ff0000;">'Número'</span>, <span style="color: #ff0000;">'Abona'</span>,<span style="color: #ff0000;">'nota'</span>;<br />             ColSizes <span style="color: #000000;">80</span>,<span style="color: #000000;">120</span>,<span style="color: #000000;">180</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">id</span> <span style="color: #000000;">101</span>  <span style="color: #0000ff;">UpDate</span> Cell AutoSort<br /><br /><br /><br />    With Object oBrw:<span style="color: #000000;">InsCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />        :<span style="color: #000000;">bEditValue</span>    := <span style="color: #000000;">&#123;</span> || AScan<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aSelected</span>, oBrw:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />        :<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        :<span style="color: #000000;">nHeadBmpNo</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aSelected</span> <span style="color: #000000;">&#41;</span> == oBrw:<span style="color: #000000;">nLen</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />    End<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">lDisplayZeros</span> := .F.<br />      :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWRC<br />      :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br />      :<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,colores<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nat</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">lColDividerComplete</span> := .T.<br />      :<span style="color: #000000;">lAllowColHiding</span> := .F.<br />      :<span style="color: #000000;">lRecordSelector</span> := .F.<br />   END WITH<br /><br />    oBrw:<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">&#123;</span> |r,c,f,oBrw| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">MouseColPos</span><span style="color: #000000;">&#40;</span> c <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span> , ;<br />                   <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> f := AScan<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aSelected</span>, oBrw:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span>, ;<br />                     AAdd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aSelected</span>, oBrw:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span>, ;<br />                     ADel<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aSelected</span>, f, .t. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#41;</span>, ;<br />                     oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> odlg1 <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">gobottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />etc<br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> colores<span style="color: #000000;">&#40;</span> lNota  <span style="color: #000000;">&#41;</span><br />   <br /> <br />   <span style="color: #00C800;">IF</span> lNota <br />      <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">150</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ELSE</span><br />      <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br />etc<br /><br /> </div>[/code:1k1gr004] Con otros formularias no tengo ningún problema al usar :bClrStd Muchas Gracias
pintar filas en xbrowse multiselect- SOLUCIONADO-
WITH OBJECT oBrw :lDisplayZeros := .F. :nMarqueeStyle := MARQSTYLE_HIGHLROWRC [color=#FF0000:1k7l11gt] :lMultiSelect := .t.[/color:1k7l11gt] :nStretchCol := STRETCHCOL_WIDEST :bClrStd := {|| { RGB(0,0,0),colores( aItems[ oBrw:nat, 4 ] ) } } :lColDividerComplete := .T. :lAllowColHiding := .F. :lRecordSelector := .F. END WITH
pintar filas en xbrowse multiselect- SOLUCIONADO-
Gracias Manuel pero el seleccionar los items no hay problema funciona perfecto, pero lo que no puedo es pintar la fila que está con la condición "D". Luis
pintar filas en xbrowse multiselect- SOLUCIONADO-
Ya lo intentaste asi?: [code=fw:1se3vxat]<div class="fw" id="{CB}" style="font-family: monospace;">:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, Colores<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span></div>[/code:1se3vxat]
pintar filas en xbrowse multiselect- SOLUCIONADO-
Francisco perfecto. Muchas gracias hace dos días que estaba con esto. Les voy a decir que si no fuera por Uds nunca hubiera podido hacer nada. Muchas Gracias Luis
pivot tables
Hi guys! Someone has an fw code to generate pivot tables in excel? Thanks
pixles or mm
Could You tell me , if x1,x2,x3,x4 are in pixles or mm ? DEFINE DIALOG oDlg FROM x1, x2 TO x3, x4 ; TITLE If( lAppend, "New Customer", "Customer Update" ) @ x1, x2 SAY "&Name:" OF oDlg @ x1, x2 GET cName OF oDlg
pixles or mm
Neither. They are dialog units. If you want pixels then resize the dialog in the ON INIT clause. Example: [code:4dmjl7cf]ACTIVATE DIALOG oDlg; ON INIT oDlg&#58;Move&#40; 0, 0, 1280, 1024 &#41;[/code:4dmjl7cf] EMG
planned activity
hi, I have a .exe and it start each day at 11 p.m. I do not want to use Windows planning utilities, is there any way by fwh functions (timer or others...) thanks
please a sample with timer and TRY catch
I have a timer DEFINE TIMER oTimer INTERVAL 500 OF oWnd ; ACTION ( nTime++, if ( nTime == 4, UpdateSendReceive(), )) ACTIVATE TIMER oTimer on UpdateSendReceive() must call some function but it not run well [code=fw:26xc4cwf]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> UpdateSendReceive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nReC<br /><span style="color: #00C800;">if</span> ! lWorking<br />&nbsp; &nbsp;<span style="color: #B900B9;">//nReC:=TGMSGS->(recno())</span><br />&nbsp; &nbsp;sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> isinternet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oTimer:<span style="color: #000000;">nInterval</span>=<span style="color: #000000;">5000</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oTimer:<span style="color: #000000;">nInterval</span>=<span style="color: #000000;">1500</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ntime:=<span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; lWorking = .T.<br />&nbsp; &nbsp; &nbsp; ReadMessage<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; * &nbsp;replymsgAdmin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; * &nbsp;sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ReplyMsg<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; <span style="color: #00C800;">if</span> oTimer:<span style="color: #000000;">nInterval</span>#<span style="color: #000000;">5000</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oTimer:<span style="color: #000000;">nInterval</span>=<span style="color: #000000;">5000</span><br />&nbsp; &nbsp; &nbsp; &nbsp;ntime:=<span style="color: #000000;">0</span><br />&nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; <span style="color: #0000ff;">SELECT</span> MS<br />&nbsp; &nbsp; &nbsp; &nbsp;MS-><span style="color: #000000;">&#40;</span>OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #B900B9;">//TAG "UpdtId"</span><br />&nbsp; &nbsp; &nbsp; &nbsp;MS-><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 /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;obrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;lWorking = .F.<br /><br />CATCH oError<br />&nbsp; &nbsp;oErr:=.t.<br />end<br /><span style="color: #00C800;">endif</span><br />sysrefresh<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:26xc4cwf] I wish on each 1500 second it call UpdateSendReceive() How i resolve ?