topic
stringlengths
1
63
text
stringlengths
1
577k
mariaDB y tDolphin?
Hola. quiero empezar a utilizar mariaDB, que librerias debo incluir en la aplicacion? funciona con tdolphin? gracias
mariaDB y tDolphin?
Si tienes la última actualización FWH te sugiero que utilices las clases nativas de FWH. Son muy fáciles de usar y muy bien integradas a xBrowse. Saludos
mariaDB y tDolphin?
Si ya usas Dolphin no tienes que hacer ningun cambio
mariaDB y tDolphin?
goosfancito Para FWH con Harbour y BCC7 [code=fw:vcoincj0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />LIBS1 = $<span style="color: #000000;">&#40;</span>FWH<span style="color: #000000;">&#41;</span>\LIB\FiveH.lib $<span style="color: #000000;">&#40;</span>FWH<span style="color: #000000;">&#41;</span>\LIB\FiveHC.lib $<span style="color: #000000;">&#40;</span>FWH<span style="color: #000000;">&#41;</span>\LIB\Dolphin.lib $<span style="color: #000000;">&#40;</span>FWH<span style="color: #000000;">&#41;</span>\LIB\LibMySql.lib<br />LIBS2 = $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbrtl.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbvm.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\gtgui.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hblang.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbmacro.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbrdd.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\rddntx.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\rddcdx.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\rddfpt.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbsix.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbdebug.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbcommon.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbpp.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbcpage.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbwin.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbct.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\xHB.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbcplr.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbpcre.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\png.lib $<span style="color: #000000;">&#40;</span>HPATHL<span style="color: #000000;">&#41;</span>\hbzlib.lib <br />LIBS3 = $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\cw32.lib $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\import32.lib $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\odbc32.lib $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\msimg32.lib $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\nddeapi.lib $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\iphlpapi.lib $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\psapi.lib $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\ws2_32.lib $<span style="color: #000000;">&#40;</span>CPATHL<span style="color: #000000;">&#41;</span>\shell32.lib<br />&nbsp;</div>[/code:vcoincj0] Poner DOLPHIN.LIB y LIBMYSQL,LIB en la carpeta LIB de FWH El Archivo LIBMYSQL.DLL colocar donde se ejecuta el programa ó en la carpeta windows Descargar MariaDB de aquí: [url:vcoincj0]https&#58;//downloads&#46;mariadb&#46;org/mariadb/10&#46;1&#46;21/[/url:vcoincj0]
mariaDB y tDolphin?
gacias
mariaDB y tDolphin?
[quote="horacio":132lznsj]Si tienes la última actualización FWH te sugiero que utilices las clases nativas de FWH. Son muy fáciles de usar y muy bien integradas a xBrowse. Saludos[/quote:132lznsj] Hola Cual seria esa actualizacion de que fecha ???
mariaDB y tDolphin?
La ultima es 17.04 ( Abril de 2017 ), todos los meses sale una nueva
mariadb
Buen dia... Una consulta como puedo eliminar un registro pero que cumpla la condicion bcodi es en nombre de un campo de la tabla cont0500 oRs := oCn:RowSet( "cont0500" ) // "lecturas" es una tabla de cDatabasename oRs:GoTop() Whil !oRs:Eof() If Subs(oRs:bcodi,1,1)="1" oRs:Delete();oRs:Save() Endi oRs:Skip(1) End XBROWSER oRs FASTEDIT
mariadb
Hola nadie sabe como eliminar un registro? en mariadb
mariadb
Hola te recomiendo que uses codigo nativo de SQL.
mariadb
/* oRs := oCn:RowSet( "cont0500" ) // "lecturas" es una tabla de cDatabasename oRs:GoTop() Whil !oRs:Eof() If Subs(oRs:bcodi,1,1)="1" oRs:Delete();oRs:Save() Endi oRs:Skip(1) */ cQry := "DELETE FROM cont0500" + CLRF cQry += "WHERE bcodi=" + ClipValue2SQL( "1" ) oCn:Execute( cQry )
mariadb
cQry := "DELETE FROM cont0500" + CLRF cQry += "WHERE SUBSTRING(bcodi,1,1)=" + ClipValue2SQL( "1" ) oCn:Execute( cQry )
mariadb
[quote="Dioni":gl933v4o]Buen dia... Una consulta como puedo eliminar un registro pero que cumpla la condicion bcodi es en nombre de un campo de la tabla cont0500 oRs := oCn:RowSet( "cont0500" ) // "lecturas" es una tabla de cDatabasename oRs:GoTop() Whil !oRs:Eof() If Subs(oRs:bcodi,1,1)="1" oRs:Delete();oRs:Save() Endi oRs:Skip(1) End XBROWSER oRs FASTEDIT[/quote:gl933v4o] [code=fw:gl933v4o]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DELETE FROM `cont0500` WHERE `bcodi` LIKE '1%'"</span> <span style="color: #000000;">&#41;</span><br />oRs := oCn:<span style="color: #000000;">RowSet</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"cont0500"</span> <span style="color: #000000;">&#41;</span><br />XBROWSER oRs FASTEDIT<br />&nbsp;</div>[/code:gl933v4o]
mariadb
Excelente amigos Gracias por la ayuda Funciono si busco, y quiero eliminar todos los registros que cumplan un acondision bcodi:='102125225212252' If Subs(oRs:bcodi,4,2)="1" asi se hace en archivos dbf's y en mariadb seria asi ? oCn:Execute( "DELETE FROM `cont0500` WHERE `bcodi` LIKE '12%'" ) como le digo que subs(bcodi,4,2)='12' soy nuevo en mariadb gracias
mariadb
"WHERE bcodi LIKE '12%'" is same as "SUBSTR( bcodi, 1, 2 ) = '12'" "WHERE bcode LIKE '___12%'" is same as "SUBSTR( bcodi, 4, 2 ) = '12'" LIKE is case insensitive The percentage ( % ) wildcard matches any string of zero or more characters. The underscore ( _ ) wildcard matches any single character.
mariadb - fwh 21_02
Hola a todos. Necesito hacer una aplicacion para uso personal que pueda utilizar mariadb embebido. existe algun ejemplo? gracias.
mariadb - fwh 21_02
fwh\samples\mysqlmbd.prg try [code=fw:2r35z4in]<div class="fw" id="{CB}" style="font-family: monospace;">bldmbh mysqlmbd</div>[/code:2r35z4in] in the samples folder
mariadb - fwh 21_02
Thanks, asks me "errmsg.sys", where is it?
mariadb - fwh 21_02
se me hace complicado compilar con los .bat pregunto: que librerias hay que integrar (hablo solo del mariadb) para probar mariadb embebido? porque veo en la carpeta lib varias y en la dll varias, a ver si puedo armar un proyecto con xmate y que salga funcionando al menos una conexion. gracias
mariadb and transaction
Hello, I currently use a customized version of tmysql which I modify to be able to use transactions in an easy way, currently after using calls to the query and execute methods, it is necessary to validate if there is an error to display a message, I have added a data which calls "lThrowError" which, when set to True, causes that in case of error a RunTime Error is launched, which allows me to use the rollback method, I leave an example of current use. [code=fw:1tr752x6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">STATIC</span> PROCEDURE NuevoPrestamo_Grabar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> i, cSqlDetalle := <span style="color: #ff0000;">"INSERT INTO prestamosdet (num_pres,cuota_no,fecha_prog,valor_prog,estado) VALUES "</span><br />   <span style="color: #00C800;">LOCAL</span> lGrabado := <span style="color: #00C800;">FALSE</span><br /><br />   <span style="color: #00C800;">FOR</span> i:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">&#40;</span> aTabla <span style="color: #000000;">&#41;</span><br />      cSqlDetalle += <span style="color: #ff0000;">"( &1, "</span> + Var2Str<span style="color: #000000;">&#40;</span> aTabla<span style="color: #000000;">&#91;</span> i, TABLA_ABO_NO      <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> +  <span style="color: #ff0000;">","</span> + ;<br />                                Var2Str<span style="color: #000000;">&#40;</span> aTabla<span style="color: #000000;">&#91;</span> i, TABLA_ABO_FECHA   <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> +  <span style="color: #ff0000;">","</span> + ;<br />                                Var2Str<span style="color: #000000;">&#40;</span> aTabla<span style="color: #000000;">&#91;</span> i, TABLA_ABO_VALPROG <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> +  <span style="color: #ff0000;">","</span> + <span style="color: #ff0000;">"'A'),"</span><br />   <span style="color: #00C800;">NEXT</span><br /><br />   cSqlDetalle := HB_StrShrink<span style="color: #000000;">&#40;</span> cSqlDetalle <span style="color: #000000;">&#41;</span><br /><br />   oServer:<span style="color: #000000;">lThrowError</span> := <span style="color: #00C800;">TRUE</span><br /><br />   <span style="color: #00C800;">TRY</span><br />      oServer:<span style="color: #000000;">BeginTransaction</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;">&#40;</span> nPresNum := IncCount<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"control"</span>, <span style="color: #ff0000;">"cont_pres"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />         oServer:<span style="color: #000000;">Insert2</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"prestamosmas"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"num_ruta"</span>      , nRutaCob    <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"num_clie"</span>      , nClieNum    <span style="color: #000000;">&#125;</span>, ; <span style="color: #B900B9;">/*datos de cliente*/</span><br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"nombre"</span>        , cClieNom    <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"cedula"</span>        , cClieCed    <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ciudad"</span>        , cClieCiu    <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"direccion"</span>     , cClieDir    <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"telefonos"</span>     , cClieTel    <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"num_pres"</span>      , nPresNum    <span style="color: #000000;">&#125;</span>, ; <span style="color: #B900B9;">/*datos del prestamo*/</span><br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"importe"</span>       , nImporte    <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"interes"</span>       , nInteres    <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"cuotas"</span>        , nCuotas     <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"modalidad_pago"</span>, nModalidad  <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"valor_cuota"</span>   , nValorCuota <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"total"</span>         , nTotal      <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"fecha_ent"</span>     , dFechaEnt   <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"fecha_ini"</span>     , dFechaIni   <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"fecha_fin"</span>     , dFechaFin   <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"abonado"</span>       , <span style="color: #000000;">0</span>           <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"estado"</span>        , <span style="color: #ff0000;">"A"</span>         <span style="color: #000000;">&#125;</span>, ;<br />                                            <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"nota"</span>          , cNota       <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />         oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cSqlDetalle, <span style="color: #000000;">&#123;</span> nPresNum <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ENDIF</span><br /><br />      oServer:<span style="color: #000000;">Commit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      lGrabado := <span style="color: #00C800;">TRUE</span><br /><br />   CATCH oError<br />      ShowError<span style="color: #000000;">&#40;</span> oError <span style="color: #000000;">&#41;</span><br />      oServer:<span style="color: #000000;">Rollback</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   oServer:<span style="color: #000000;">lThrowError</span> := <span style="color: #00C800;">FALSE</span><br /><br />   <span style="color: #00C800;">IF</span> lGrabado<br />      NuevoPrestamo_MostrarNumero<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">IF</span> MsgNoYes<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Desea imprimir contrato del prestamo?"</span> <span style="color: #000000;">&#41;</span><br />         NuevoPrestamo_Imprimir<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ENDIF</span><br /><br />      NuevoPrestamo_Limpiar1<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">TRUE</span> <span style="color: #000000;">&#41;</span><br /><br />      oDlgE:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      oBtnSearch:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> lGrabado<br /> </div>[/code:1tr752x6] [code=fw:1tr752x6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> Execute<span style="color: #000000;">&#40;</span> cSqlCmd, aParams, lShow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nRet, oErr<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lShow <span style="color: #0000ff;">TO</span> <span style="color: #00C800;">FALSE</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lError</span> := <span style="color: #00C800;">FALSE</span><br />&nbsp; &nbsp;::<span style="color: #000000;">cError</span> := <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> hb_IsArray<span style="color: #000000;">&#40;</span> aParams <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cSqlCmd := EvalQueryParams<span style="color: #000000;">&#40;</span> cSqlCmd, aParams, ::<span style="color: #000000;">pMySql</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lShow<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cQuery</span>, <span style="color: #ff0000;">"SQL"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ::<span style="color: #000000;">lTraceLog</span><br />&nbsp; &nbsp; &nbsp; TraceLog<span style="color: #000000;">&#40;</span> cSqlCmd <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> hb_isBlock<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bOnLoadQuery</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bOnLoadQuery</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;nRet := mysql_real_query<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">pMySQL</span>, cSqlCmd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> hb_isBlock<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bOnAfterQuery</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bOnAfterQuery</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nRet > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := <span style="color: #00C800;">TRUE</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cError</span> := ::<span style="color: #000000;">ErrorTxt</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">lThrowError</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr := ErrorNew<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">Args</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ::<span style="color: #000000;">pMySQL</span>, cSqlCmd, aParams <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">CanDefault</span> &nbsp; &nbsp;:= <span style="color: #00C800;">FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">CanRetry</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #00C800;">FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">CanSubstitute</span> := <span style="color: #00C800;">FALSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">GenCode</span> &nbsp; &nbsp; &nbsp; := EG_SYNTAX<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">Severity</span> &nbsp; &nbsp; &nbsp;:= ES_ERROR<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">SubSystem</span> &nbsp; &nbsp; := <span style="color: #ff0000;">"HBMYSQL-(EXECUTE)"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">SubCode</span> &nbsp; &nbsp; &nbsp; := ::<span style="color: #000000;">ErrNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">Description</span> &nbsp; := ::<span style="color: #000000;">cError</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oErr:<span style="color: #000000;">Operation</span> &nbsp; &nbsp; := cSqlCmd<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Eval<span style="color: #000000;">&#40;</span> ErrorBlock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oErr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> !::<span style="color: #000000;">lError</span><br />&nbsp;</div>[/code:1tr752x6] Currently in the native fiad class of mariadb / mysql what I have found is how to show or not show error messages, is there any way to simulate the way I currently work? since I want to use the native class. Thanks for your attention. salu2 carlos vargas
mariadb xbrowse bstrData
Hola. Antes que se muestre el dato en el xbrowser necesito acortar el dato si sobrepasa los 90 caracteres. he pensado en esto pero no me estaria funcionando [code=fw:20ua6sp4]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp;WITH OBJECT :<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; &nbsp; &nbsp;:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp; := <span style="color: #ff0000;">"Productos"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nWidth</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">500</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bStrData</span> := ::<span style="color: #000000;">nombreProducto</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oQry</span>:<span style="color: #000000;">FieldGet</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"C3"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; END WITH</div>[/code:20ua6sp4] al recuperar ::oQry:fieldget("C3") no me trae el dato. que estoy fallando? gracias.
mariadb xbrowse bstrData
[code=fw:2m0n6w34]<div class="fw" id="{CB}" style="font-family: monospace;">:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #0000ff;">LEFT</span><span style="color: #000000;">&#40;</span> oQry:<span style="color: #000000;">C3</span>, <span style="color: #000000;">90</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></div>[/code:2m0n6w34]
marquesina
Ssaludos, habra manera de pasar un campo memo o texto de varias lineas y vaya corriendo al estilo marquesina , como los creditos de una pelicula, osea de abajo hacia arriba, gracias
marquesina
Hola: por favor fíjate en el foro o en utilidades, hay algunos ejemplos con Dsay o con ssay creo que son de Ramon Avendaño. Saludos Ruben Fernandez
mas DATAs en un BTNBMP? (SOLUCIONADO)
Hola Foreros: Cómo puedo definir mas de una DATA de cargo en un BTNBMP ??? Esto es lo que necesito oBtn[nVez]:cargo := oRsHab:Fields("HAB_NUM"):Value oBtn[nVez]:Status := oRsHab:Fields("HAB_STS"):Value Gracias de antemano Saludos
mas DATAs en un BTNBMP? (SOLUCIONADO)
[code=fw:y3m376w2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;++nVez ??<br />&nbsp;</div>[/code:y3m376w2] Saludos.
mas DATAs en un BTNBMP? (SOLUCIONADO)
Hola, puedes usar un hash : [code=fw:2tcd2fqd]<div class="fw" id="{CB}" style="font-family: monospace;">oBtn<span style="color: #000000;">&#91;</span>nVez<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cargo</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"HAB_NUM"</span> => oRsHab:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HAB_NUM"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, ;<br />                      <span style="color: #ff0000;">"HAB_STS"</span> => oRsHab:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HAB_STS"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#125;</span></div>[/code:2tcd2fqd] Para recuperar los valores : [code=fw:2tcd2fqd]<div class="fw" id="{CB}" style="font-family: monospace;">? oBtn<span style="color: #000000;">&#91;</span>nVez<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cargo</span> <span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"HAB_NUM"</span><span style="color: #000000;">&#93;</span><br />? oBtn<span style="color: #000000;">&#91;</span>nVez<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cargo</span> <span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"HAB_STS"</span><span style="color: #000000;">&#93;</span></div>[/code:2tcd2fqd]
mas DATAs en un BTNBMP? (SOLUCIONADO)
Gracias Karinha y Gmart: Lo intento y me reporto. Saludos
mas DATAs en un BTNBMP? (SOLUCIONADO)
Amigos: Los hash funcionaron al 100% Gracias GMart1 y todos los que me apoyaron con sus respuestas Saludos
mas de un ADD
Holas, saben si es posible utilizar tablas (archivos) ADT de mas de un ADD (Advantage Data Dictionay) al mismo tiempo. saludos Marcelo
mas de un ADD
Marcelo a lo mejor te sirve este link [url:1emb1433]http&#58;//fivetechsoft&#46;com/forums/viewtopic&#46;php?t=5563&highlight=hconnection[/url:1emb1433]
mas de un ADD
Sip, gracias, seguro eso me sirve saludos Marcelo
mas propuestas para Rpreview
Sería bueno disponer de dos CLassDatas nuevas mas : Que nos permitan tener escondido el menu. CLASSDATA lListViewHide INIT .f. Que nos permita usar el preview sin el listview ( como antiguamente ) yo lo he implementado por petición pues a muchos no les gusta <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> . CLASSDATA lShowMenu INIT .T. Tambien sería bueno tener un sistema de asignar nuestros propios iconos en vez los "nuevos por defecto" algo asi : iif ( ::lBmpDefault , oBtn:hBitmap1 := FWBitmap( "Bottom2" ) , oBtn:LoadBitmaps( "Bottom2" ) ) Aqui no estoy seguro que implementación sería la mejor .
mascara en footer del xbrowse
hola a todos tengo un xbrowse con footers, el problemas es que me muestra sin las comas, como puedo poner mascara al footer de una columna determinada. sale en el footer 158236.88 yo quiero que salga 158,236.88.... se puede, disculpen mi ignorancia. salu2 Francis
mascara en footer del xbrowse
Hola amigo Prueba asi: [code=fw:13ccblsc]<div class="fw" id="{CB}" style="font-family: monospace;"><br />TRANSFORM<span style="color: #000000;">&#40;</span>Valor,<span style="color: #ff0000;">'@E 999,999,999.99'</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:13ccblsc] Espero te sirva. Saludos
mascara en footer del xbrowse
hola amigo pero como lo aplico en el footer del xbrowse ... salu2 Francis
mascara en footer del xbrowse
Hola... Prueba asi: [code=fw:2n2vg6ol]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   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>:<span style="color: #000000;">bFooter</span>:=<span style="color: #000000;">&#123;</span>|| <span style="color: #ff0000;">"$ "</span>+TRANSFORM<span style="color: #000000;">&#40;</span>Valor,<span style="color: #ff0000;">"@E 999,999,999.99"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:2n2vg6ol] Espero te sirva...
mascara en footer del xbrowse
hola amigo voy a probarlo ... gracias salu2 Francis
mascara en footer del xbrowse
Hola jrestojeda Gracias ,,, funciona.. Salu2 Francis
mask dialog not displayed [solved]
Hi at all. In the project with clipper 5.2 + FHW 1.98 , the dialogs mask are correctly diplayed : <!-- m --><a class="postlink" href="http://img834.imageshack.us/i/errmaschera1.png/">http://img834.imageshack.us/i/errmaschera1.png/</a><!-- m --> after compiling with Harbour and FHW i have this situation : <!-- m --><a class="postlink" href="http://img715.imageshack.us/i/errmaschera32bit.png/">http://img715.imageshack.us/i/errmaschera32bit.png/</a><!-- m --> the code of dialogs is this : [code=fw:2q07uw6m]<div class="fw" id="{CB}" style="font-family: monospace;"><br />    <span style="color: #00C800;">if</span> !lPreventivo<br />            <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlg;<br />                <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Testa"</span>, <span style="color: #ff0000;">"&Corpo"</span>;<br />                <span style="color: #0000ff;">DIALOGS</span> <span style="color: #ff0000;">"EDIT_ORD1"</span>, <span style="color: #ff0000;">"EDIT_PREV2"</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"B/W"</span><br />        <span style="color: #00C800;">else</span><br />            <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlg;<br />                <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Testa"</span>, <span style="color: #ff0000;">"&Corpo"</span>, <span style="color: #ff0000;">"&Accettazione"</span>;                             <br />                <span style="color: #0000ff;">DIALOGS</span> <span style="color: #ff0000;">"EDIT_PREV1"</span>, <span style="color: #ff0000;">"EDIT_PREV2"</span>, <span style="color: #ff0000;">"EDIT_PREV3"</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"B/W"</span>              <br />        <span style="color: #00C800;">endif</span><br /> </div>[/code:2q07uw6m] may the error is caused by the resources file of dialogs?thanks all
mask dialog not displayed [solved]
Did you change the type of folder control to "SysTabControl32"? EMG
mask dialog not displayed [solved]
Thanks Enrico,i have change control to "SysTabControl32" and it's all ok.Problem solved !
matrices multiplication
[code=fw:3novhpac]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   ? MatrixMult<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">4</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: #000000;">11</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">13</span>, <span style="color: #000000;">14</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</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> MatrixMult<span style="color: #000000;">&#40;</span> aMatrix1, aMatrix2 <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRowsMatrix1 := Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nColsMatrix2 := Len<span style="color: #000000;">&#40;</span> aMatrix2<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 />   <span style="color: #00C800;">local</span> aRowMatrix1, aRowMatrix2, nValRowMatrix1<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aResult := Array<span style="color: #000000;">&#40;</span> nRowsMatrix1, nColsMatrix2 &nbsp;<span style="color: #000000;">&#41;</span>, nSum<br />   <br />   aMatrix2 = ArrTranspose<span style="color: #000000;">&#40;</span> aMatrix2, .F. <span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #00C800;">for</span> each aRowMatrix1 in aMatrix1<br />      <span style="color: #00C800;">for</span> each aRowMatrix2 in aMatrix2<br />        nSum = <span style="color: #000000;">0</span><br />        <span style="color: #00C800;">for</span> each nValRowMatrix1 in aRowMatrix1<br />          ? nValRowMatrix1, aRowMatrix2<span style="color: #000000;">&#91;</span> nValRowMatrix1:__enumIndex <span style="color: #000000;">&#93;</span><br />          nSum += nValRowMatrix1 * aRowMatrix2<span style="color: #000000;">&#91;</span> nValRowMatrix1:__enumIndex <span style="color: #000000;">&#93;</span><br />        <span style="color: #00C800;">next</span><br />        aResult<span style="color: #000000;">&#91;</span> aRowMatrix1:__enumIndex, aRowMatrix2:__enumIndex <span style="color: #000000;">&#93;</span> = nSum<br />      <span style="color: #00C800;">next</span>        <br />   <span style="color: #00C800;">next</span>      <br /><br /><span style="color: #00C800;">return</span> aResult<br /><br /><span style="color: #00C800;">function</span> ArrTranspose<span style="color: #000000;">&#40;</span> aArray, lSquare <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nRows, nCols, nRow, nCol, nWidth<br />   <span style="color: #00C800;">local</span> aNew<br /><br />   <span style="color: #B900B9;">// DEFAULT lSquare := .f.</span><br /><br />   nRows          := Len<span style="color: #000000;">&#40;</span> aArray <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> lSquare<br />      nCols       := Len<span style="color: #000000;">&#40;</span> aArray<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 />   <span style="color: #00C800;">else</span><br />      nCols       := <span style="color: #000000;">1</span><br />      <span style="color: #00C800;">for</span> nRow := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nRows<br />         <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'A'</span><br />            nCols    := <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nCols, Len<span style="color: #000000;">&#40;</span> aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">next</span><br />   <span style="color: #00C800;">endif</span><br /><br />   aNew           := Array<span style="color: #000000;">&#40;</span> nCols, nRows <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> nRow := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nRows<br />      <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'A'</span><br />         nWidth  := Len<span style="color: #000000;">&#40;</span> aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nWidth<br />            aNew<span style="color: #000000;">&#91;</span> nCol, nRow <span style="color: #000000;">&#93;</span>   := aArray<span style="color: #000000;">&#91;</span> nRow, nCol <span style="color: #000000;">&#93;</span><br />         <span style="color: #00C800;">next</span><br />      <span style="color: #00C800;">else</span><br />         aNew<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span>, nRow <span style="color: #000000;">&#93;</span>      := aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> aNew<br /><br />   <br />   <br /> </div>[/code:3novhpac] [quote:3novhpac]1 11 2 13 1 12 2 14 3 11 4 13 3 12 4 14 {{37, 40}, {85, 92}}[/quote:3novhpac]
matrices multiplication
[img:crhexn74]https&#58;//github&#46;com/FiveTechSoft/screenshots/blob/master/matmult&#46;JPG?raw=true[/img:crhexn74]
matrices multiplication
Nice, now some home work: <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> [img:1kjtfa10]https&#58;//i&#46;imgur&#46;com/a1TDeej&#46;png[/img:1kjtfa10] I tryed: [code=fw:1kjtfa10]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> a := <span style="color: #000000;">&#123;</span> <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;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">LOCAL</span> b := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">11</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">13</span>, <span style="color: #000000;">14</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">15</span>, <span style="color: #000000;">16</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   ? hb_ValToExp<span style="color: #000000;">&#40;</span>MatrixMult<span style="color: #000000;">&#40;</span> a,b <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   ? hb_ValToExp<span style="color: #000000;">&#40;</span>MatrixMult<span style="color: #000000;">&#40;</span> b,a <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:1kjtfa10] and the result is [img:1kjtfa10]https&#58;//i&#46;imgur&#46;com/3J7B6CP&#46;png[/img:1kjtfa10]
matrices multiplication
The fix is pretty simple, you swapped row and col creating the result, here the correct creation: [code=fw:6t65lymz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> MatrixMult<span style="color: #000000;">&#40;</span> aMatrix1, aMatrix2 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nRowsMatrix1 := Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nColsMatrix2 := Len<span style="color: #000000;">&#40;</span> aMatrix2<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 />   <span style="color: #00C800;">local</span> aRowMatrix1, aRowMatrix2, nValRowMatrix1<br />   <span style="color: #00C800;">local</span> aResult := Array<span style="color: #000000;">&#40;</span> nRowsMatrix1, nColsMatrix2  <span style="color: #000000;">&#41;</span>, nSum</div>[/code:6t65lymz] in the original was [code=fw:6t65lymz]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">local</span> aResult := Array<span style="color: #000000;">&#40;</span> nColsMatrix1, nRowsMatrix2 <span style="color: #000000;">&#41;</span></div>[/code:6t65lymz]
matrices multiplication
Dear Antonino, Fixed in my original post many thanks! Mr. Rao has managed to implement an enhanced version that does not need the ArrTranspose() call. It will be included in the next FWH build: [code=fw:311deqrt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> MatrixMult<span style="color: #000000;">&#40;</span> matrix1, matrix2 <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> MatrixA, MatrixB, i, j, nRow, nCol, nRows, nCols, nSize, result, dot_product<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cType<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Check for scalar multiplication</span><br />&nbsp; &nbsp;cType &nbsp; &nbsp;:= ValType<span style="color: #000000;">&#40;</span> matrix1 <span style="color: #000000;">&#41;</span> + ValType<span style="color: #000000;">&#40;</span> matrix2 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> cType != <span style="color: #ff0000;">"AA"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> cType == <span style="color: #ff0000;">"NN"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> matrix1 * matrix2<br />&nbsp; &nbsp; &nbsp; elseif cType == <span style="color: #ff0000;">"NA"</span> .or. cType == <span style="color: #ff0000;">"AN"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> cType == <span style="color: #ff0000;">"NA"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i &nbsp; &nbsp; &nbsp; &nbsp;:= matrix1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MatrixA &nbsp;:= matrix2<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i &nbsp; &nbsp; &nbsp; &nbsp;:= matrix2<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MatrixA &nbsp;:= matrix1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> !HB_ISARRAY<span style="color: #000000;">&#40;</span> MatrixA<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>; MatrixA := <span style="color: #000000;">&#123;</span> MatrixA <span style="color: #000000;">&#125;</span>; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSize &nbsp; &nbsp; &nbsp; := Len<span style="color: #000000;">&#40;</span> MatrixA<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 />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> nRow := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> MatrixA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nSize<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MatrixA<span style="color: #000000;">&#91;</span> nRow, nCol <span style="color: #000000;">&#93;</span> *= i<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> MatrixA<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;? <span style="color: #ff0000;">"Invalid params"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> matrix1 <span style="color: #000000;">&#41;</span> .or. Empty<span style="color: #000000;">&#40;</span> matrix2 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">"Empty matrix"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Check for single-dim arrays</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> !<span style="color: #000000;">&#40;</span> HB_ISARRAY<span style="color: #000000;">&#40;</span> matrix1<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>; matrix1 := <span style="color: #000000;">&#123;</span> matrix1 <span style="color: #000000;">&#125;</span>; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> !<span style="color: #000000;">&#40;</span> HB_ISARRAY<span style="color: #000000;">&#40;</span> matrix2<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>; AEval<span style="color: #000000;">&#40;</span> matrix2, <span style="color: #000000;">&#123;</span> |x,i| matrix2<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> x <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;MatrixA &nbsp;:= matrix1<br />&nbsp; &nbsp;MatrixB &nbsp;:= matrix2<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Actual Matrix Multiplication</span><br />&nbsp; &nbsp;result &nbsp; := Array<span style="color: #000000;">&#40;</span> nRows := Len<span style="color: #000000;">&#40;</span> MatrixA <span style="color: #000000;">&#41;</span>, nCols := Len<span style="color: #000000;">&#40;</span> MatrixB<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nRow := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nRows<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nCols<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dot_product &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AEval<span style="color: #000000;">&#40;</span> MatrixA<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> |n,i| dot_product += n * MatrixB<span style="color: #000000;">&#91;</span> i, nCol <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CATCH<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;result<span style="color: #000000;">&#91;</span> nRow, nCol <span style="color: #000000;">&#93;</span> := dot_product<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> result<br /> </div>[/code:311deqrt]
matrices multiplication
All the new matrix functions are still under testing and may still need some fixes.
matrices multiplication
With ArrTranspose [code=fw:25dyuama]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// [ 2, 2 ] x [ 2, 2 ] = [ 2, 2 ]</span><br />   <span style="color: #00C800;">local</span> aMatriz1 := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> aMatriz2 := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">11</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">13</span>, <span style="color: #000000;">14</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #B900B9;">// [ 1, 3 ] x [ 3, 1 ] = [ 2, 1 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -2, 3 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 4 }, { 5 }, { 6 } }</span><br /><br />   <span style="color: #B900B9;">// [ 2, 3 ] x [ 3, 1 ] = [ 2, 1 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -2, 3 }, { 1, 0, -1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 4 }, { 5 }, { 6 } }</span><br /><br />   <span style="color: #B900B9;">// [ 1, 3 ] x [ 3, 2 ] = [ 1, 2 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -2, 3 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 4, 2 }, { 5, 0 }, { 6, 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 1, 2 ] x [ 2, 2 ] = [ 1, 2 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 5 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 1, 2 }, { -2, 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 2, 2 ] x [ 2, 3 ] = [ 2, 3 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 2 }, { -2, 0 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 1, 0, 2 }, { 0, 2, 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 1, 2 ] x [ 2, 1 ] = [ 1, 1 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 5 }, { 5 } }</span><br /><br />   <span style="color: #B900B9;">// [ 3, 2 ] x [ 2, 3 ] = [ 3, 3 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 2 }, { 0, -1 }, { 0, 1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 0, 3, 0 }, { 3, 0, 3 } }</span><br /><br />   <span style="color: #B900B9;">// [ 3, 3 ] x [ 3, 1 ] = [ 3, 1 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 0, 2 }, { 0, 2, 0 }, { 0, 1, 3 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 5 }, { -1 }, { 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 3, 3 ] x [ 3, 2 ] = [ 3, 2 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 2, 3 }, { 0, 1, 0 }, { 3, 2, 1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 1, -1 }, { 0, 2 }, { -2, 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 3, 3 ] x [ 3, 3 ] = [ 3, 3 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -1, 1 }, { 2, 2, 3 }, { -2, -3, -1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 1, 0, 4 }, { 0, 2, 5 }, { 1, 3, 0 } }</span><br /><br /><br />   <span style="color: #B900B9;">// [ 2, 3 ] x [ 3, 2 ] = [ 2, 2 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 2, 6 }, { 3, 4, 9 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 11, 12 }, { 13, 14 }, { 6, 9 } }</span><br /><br />   <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aMatriz1<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> = Len<span style="color: #000000;">&#40;</span> aMatriz2 <span style="color: #000000;">&#41;</span><br />      MatrixMult<span style="color: #000000;">&#40;</span> aMatriz1, aMatriz2 <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      ? <span style="color: #ff0000;">"Only multiply matrix if number columns first matrix equal to number rows second matrix"</span><br />   <span style="color: #00C800;">endif</span><br />         <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> MatrixMult<span style="color: #000000;">&#40;</span> aMatrix1, aMatrix2 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> x<br />   <span style="color: #00C800;">local</span> y<br />   <span style="color: #00C800;">local</span> z<br />   <span style="color: #00C800;">local</span> nRowsMatrix1 := Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nColsMatrix1 := Len<span style="color: #000000;">&#40;</span> aMatrix1<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 />   <span style="color: #00C800;">local</span> nRowsMatrix2 := Len<span style="color: #000000;">&#40;</span> aMatrix2 <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nColsMatrix2 := Len<span style="color: #000000;">&#40;</span> aMatrix2<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 />   <span style="color: #00C800;">local</span> aResult := Array<span style="color: #000000;">&#40;</span> nRowsMatrix1, nColsMatrix2  <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nSum    := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> nVal    := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> nIter   := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> aRowMatrix1<br />   <span style="color: #00C800;">local</span> aRowMatrix2<br />   <span style="color: #00C800;">local</span> nValRowMatrix1<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Show Matrix1, Matrix2   </span><br />   ?<br />   <span style="color: #00C800;">For</span> x = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span><br />      ?? <span style="color: #ff0000;">"[ "</span> <br />      <span style="color: #00C800;">For</span> y = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix1<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />         ?? aMatrix1<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span><br />         ??  <span style="color: #ff0000;">"   "</span><br />      <span style="color: #00C800;">Next</span> y<br />      ?? <span style="color: #ff0000;">" ]"</span> <br />      ? <br />   <span style="color: #00C800;">Next</span> x<br />   ?<br />   <span style="color: #00C800;">For</span> x = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix2 <span style="color: #000000;">&#41;</span><br />      ?? <span style="color: #ff0000;">"[ "</span> <br />      <span style="color: #00C800;">For</span> y = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix2<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />         ?? aMatrix2<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span><br />         ??  <span style="color: #ff0000;">"   "</span><br />      <span style="color: #00C800;">Next</span> y<br />      ?? <span style="color: #ff0000;">" ]"</span> <br />      ? <br />   <span style="color: #00C800;">Next</span> x<br /><br />   aMatrix2 = ArrTranspose<span style="color: #000000;">&#40;</span> aMatrix2, .F. <span style="color: #000000;">&#41;</span><br />   ? <span style="color: #ff0000;">"Transpose Matrix2"</span><br />   ?<br />   <span style="color: #00C800;">For</span> x = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix2 <span style="color: #000000;">&#41;</span><br />      ?? <span style="color: #ff0000;">"[ "</span> <br />      <span style="color: #00C800;">For</span> y = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix2<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />         ?? aMatrix2<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span><br />         ??  <span style="color: #ff0000;">"   "</span><br />      <span style="color: #00C800;">Next</span> y<br />      ?? <span style="color: #ff0000;">" ]"</span> <br />      ? <br />   <span style="color: #00C800;">Next</span> x<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Multiply matrix</span><br /><br />   <span style="color: #00C800;">For</span> x = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span><br />      nSum   := <span style="color: #000000;">0</span><br />      aRowMatrix1 := aMatrix1<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><br />      <span style="color: #00C800;">For</span> y = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nColsMatrix2 <br />          aRowMatrix2 := aMatrix2<span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span><br />          nSum   := <span style="color: #000000;">0</span><br />          <span style="color: #00C800;">For</span> z = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aRowMatrix2 <span style="color: #000000;">&#41;</span><br />             nVal := aRowMatrix1<span style="color: #000000;">&#91;</span> z <span style="color: #000000;">&#93;</span> * aRowMatrix2<span style="color: #000000;">&#91;</span> z <span style="color: #000000;">&#93;</span><br />             nSum += nVal<br />          <span style="color: #00C800;">Next</span> z<br />          aResult<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span> := nSum<br />      <span style="color: #00C800;">Next</span> y<br />   <span style="color: #00C800;">Next</span> x<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Show Result</span><br />   ? <span style="color: #ff0000;">"Result"</span><br />   ?<br />   <span style="color: #00C800;">For</span> x = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aResult <span style="color: #000000;">&#41;</span><br />      ?? <span style="color: #ff0000;">"[ "</span> <br />      <span style="color: #00C800;">For</span> y = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aResult<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />         ?? aResult<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span><br />         ??  <span style="color: #ff0000;">"   "</span><br />      <span style="color: #00C800;">Next</span> y<br />      ?? <span style="color: #ff0000;">" ]"</span> <br />      ? <br />   <span style="color: #00C800;">Next</span> x<br /><br /><span style="color: #00C800;">return</span> aResult<br /><br /><span style="color: #00C800;">function</span> ArrTranspose<span style="color: #000000;">&#40;</span> aArray, lSquare <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nRows, nCols, nRow, nCol, nWidth<br />   <span style="color: #00C800;">local</span> aNew<br /><br />   <span style="color: #B900B9;">// DEFAULT lSquare := .f.</span><br /><br />   nRows          := Len<span style="color: #000000;">&#40;</span> aArray <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> lSquare<br />      nCols       := Len<span style="color: #000000;">&#40;</span> aArray<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 />   <span style="color: #00C800;">else</span><br />      nCols       := <span style="color: #000000;">1</span><br />      <span style="color: #00C800;">for</span> nRow := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nRows<br />         <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'A'</span><br />            nCols    := <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nCols, Len<span style="color: #000000;">&#40;</span> aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">next</span><br />   <span style="color: #00C800;">endif</span><br /><br />   aNew           := Array<span style="color: #000000;">&#40;</span> nCols, nRows <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> nRow := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nRows<br />      <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'A'</span><br />         nWidth  := Len<span style="color: #000000;">&#40;</span> aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nWidth<br />            aNew<span style="color: #000000;">&#91;</span> nCol, nRow <span style="color: #000000;">&#93;</span>   := aArray<span style="color: #000000;">&#91;</span> nRow, nCol <span style="color: #000000;">&#93;</span><br />         <span style="color: #00C800;">next</span><br />      <span style="color: #00C800;">else</span><br />         aNew<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span>, nRow <span style="color: #000000;">&#93;</span>      := aArray<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> aNew<br /><br /> </div>[/code:25dyuama]
matrices multiplication
Without ArrTranspose [code=fw:fcg5uqrd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// [ 2, 2 ] x [ 2, 2 ] = [ 2, 2 ]</span><br />   <span style="color: #00C800;">local</span> aMatriz1 := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> aMatriz2 := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">11</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">13</span>, <span style="color: #000000;">14</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #B900B9;">// [ 1, 3 ] x [ 3, 1 ] = [ 2, 1 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -2, 3 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 4 }, { 5 }, { 6 } }</span><br /><br />   <span style="color: #B900B9;">// [ 2, 3 ] x [ 3, 1 ] = [ 2, 1 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -2, 3 }, { 1, 0, -1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 4 }, { 5 }, { 6 } }</span><br /><br />   <span style="color: #B900B9;">// [ 1, 3 ] x [ 3, 2 ] = [ 1, 2 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -2, 3 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 4, 2 }, { 5, 0 }, { 6, 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 1, 2 ] x [ 2, 2 ] = [ 1, 2 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 5 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 1, 2 }, { -2, 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 2, 2 ] x [ 2, 3 ] = [ 2, 3 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 2 }, { -2, 0 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 1, 0, 2 }, { 0, 2, 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 1, 2 ] x [ 2, 1 ] = [ 1, 1 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 5 }, { 5 } }</span><br /><br />   <span style="color: #B900B9;">// [ 3, 2 ] x [ 2, 3 ] = [ 3, 3 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 2 }, { 0, -1 }, { 0, 1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 0, 3, 0 }, { 3, 0, 3 } }</span><br /><br />   <span style="color: #B900B9;">// [ 3, 3 ] x [ 3, 1 ] = [ 3, 1 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 0, 2 }, { 0, 2, 0 }, { 0, 1, 3 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 5 }, { -1 }, { 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 3, 3 ] x [ 3, 2 ] = [ 3, 2 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 2, 3 }, { 0, 1, 0 }, { 3, 2, 1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 1, -1 }, { 0, 2 }, { -2, 0 } }</span><br /><br />   <span style="color: #B900B9;">// [ 3, 3 ] x [ 3, 3 ] = [ 3, 3 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, -1, 1 }, { 2, 2, 3 }, { -2, -3, -1 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 1, 0, 4 }, { 0, 2, 5 }, { 1, 3, 0 } }</span><br /><br /><br />   <span style="color: #B900B9;">// [ 2, 3 ] x [ 3, 2 ] = [ 2, 2 ]</span><br />   <span style="color: #B900B9;">//local aMatriz1 := { { 1, 2, 6 }, { 3, 4, 9 } }</span><br />   <span style="color: #B900B9;">//local aMatriz2 := { { 11, 12 }, { 13, 14 }, { 6, 9 } }</span><br /><br />   <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aMatriz1<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> = Len<span style="color: #000000;">&#40;</span> aMatriz2 <span style="color: #000000;">&#41;</span><br />      MatrixMult<span style="color: #000000;">&#40;</span> aMatriz1, aMatriz2 <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      ? <span style="color: #ff0000;">"Only multiply matrix if number columns first matrix equal to number rows second matrix"</span><br />   <span style="color: #00C800;">endif</span><br />         <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> ShowMatrix<span style="color: #000000;">&#40;</span> aMatrix <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> x<br />   <span style="color: #00C800;">local</span> y<br /><br />   ?<br />   <span style="color: #00C800;">For</span> x = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix <span style="color: #000000;">&#41;</span><br />      ?? <span style="color: #ff0000;">"[ "</span> <br />      <span style="color: #00C800;">For</span> y = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />         ?? aMatrix<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span><br />         ??  <span style="color: #ff0000;">"   "</span><br />      <span style="color: #00C800;">Next</span> y<br />      ?? <span style="color: #ff0000;">" ]"</span> <br />      ? <br />   <span style="color: #00C800;">Next</span> x<br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">function</span> MatrixMult<span style="color: #000000;">&#40;</span> aMatrix1, aMatrix2 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> x<br />   <span style="color: #00C800;">local</span> y<br />   <span style="color: #00C800;">local</span> z<br />   <span style="color: #00C800;">local</span> nRowsMatrix1 := Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nColsMatrix1 := Len<span style="color: #000000;">&#40;</span> aMatrix1<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 />   <span style="color: #00C800;">local</span> nRowsMatrix2 := Len<span style="color: #000000;">&#40;</span> aMatrix2 <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nColsMatrix2 := Len<span style="color: #000000;">&#40;</span> aMatrix2<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 />   <span style="color: #00C800;">local</span> aResult := Array<span style="color: #000000;">&#40;</span> nRowsMatrix1, nColsMatrix2  <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nSum    := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> nVal0   := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> nVal1   := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> nIter   := <span style="color: #000000;">0</span><br /><br />   ShowMatrix<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span><br />   ShowMatrix<span style="color: #000000;">&#40;</span> aMatrix2 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">For</span> x = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">For</span> y = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nColsMatrix2<br />         nSum   := <span style="color: #000000;">0</span><br />         <span style="color: #00C800;">For</span> z = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nRowsMatrix2<br />            nVal0  := aMatrix1<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> z <span style="color: #000000;">&#93;</span><br />            nVal1 := nVal0 * aMatrix2<span style="color: #000000;">&#91;</span> z <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span><br />            nSum  += nVal1<br />         <span style="color: #00C800;">Next</span> z<br />         aResult<span style="color: #000000;">&#91;</span> x <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> y <span style="color: #000000;">&#93;</span> := nSum<br />      <span style="color: #00C800;">Next</span> y<br />   <span style="color: #00C800;">Next</span> x<br /><br />   ? <span style="color: #ff0000;">"Resultado"</span><br />   ShowMatrix<span style="color: #000000;">&#40;</span> aResult <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> aResult<br /><br /><br /> </div>[/code:fcg5uqrd]
matrices multiplication
Shortest version ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> [code=fw:1ufpolpa]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   ? MatrixMult<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">4</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: #000000;">11</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">13</span>, <span style="color: #000000;">14</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</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> MatrixMult<span style="color: #000000;">&#40;</span> aMatrix1, aMatrix2 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aRowMatrix1, nColMatrix2, nRowMatrix2<br />   <span style="color: #00C800;">local</span> aResult := Array<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span>, Len<span style="color: #000000;">&#40;</span> aMatrix2<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">for</span> each aRowMatrix1 in aMatrix1<br />      <span style="color: #00C800;">for</span> nColMatrix2 = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix2<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 />         nSum = <span style="color: #000000;">0</span><br />         <span style="color: #00C800;">for</span> nRowMatrix2 = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aMatrix2 <span style="color: #000000;">&#41;</span><br />            nSum += aRowMatrix1<span style="color: #000000;">&#91;</span> nRowMatrix2 <span style="color: #000000;">&#93;</span> * aMatrix2<span style="color: #000000;">&#91;</span> nRowMatrix2 <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> nColMatrix2 <span style="color: #000000;">&#93;</span><br />         <span style="color: #00C800;">next</span> <br />         aResult<span style="color: #000000;">&#91;</span> aRowMatrix1:__enumIndex <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> nColMatrix2 <span style="color: #000000;">&#93;</span> := nSum<br />      <span style="color: #00C800;">next</span> <br />   <span style="color: #00C800;">next</span>    <br />   <br /><span style="color: #00C800;">return</span> aResult  </div>[/code:1ufpolpa] [quote:1ufpolpa]{{37, 40}, {85, 92}}[/quote:1ufpolpa]
matrices multiplication
Shortest version based on Mr. Rao version: [code=fw:11chweuz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   ? MatrixMult<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">4</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: #000000;">11</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">13</span>, <span style="color: #000000;">14</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</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> MatrixMult<span style="color: #000000;">&#40;</span> aMatrix1, aMatrix2 <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aRowMatrix1, nSum, nCols := Len<span style="color: #000000;">&#40;</span> aMatrix2<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 />   <span style="color: #00C800;">local</span> aResult := Array<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> aMatrix1 <span style="color: #000000;">&#41;</span>, nCols <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">for</span> each aRowMatrix1 in aMatrix1<br />      <span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nCols<br />         nSum = <span style="color: #000000;">0</span><br />         AEval<span style="color: #000000;">&#40;</span> aRowMatrix1, <span style="color: #000000;">&#123;</span> |n,i| nSum += n * aMatrix2<span style="color: #000000;">&#91;</span> i, nCol <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />         aResult<span style="color: #000000;">&#91;</span> aRowMatrix1:__enumIndex, nCol <span style="color: #000000;">&#93;</span> = nSum<br />      <span style="color: #00C800;">next</span><br />   <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> aResult<br /> </div>[/code:11chweuz] [quote:11chweuz]{{37, 40}, {85, 92}} { { 1*11 + 2*13, 1*12 + 2*14 }, { 3*11 + 4*13, 3*12 + 4*14 }}[/quote:11chweuz]
matrices multiplication
I am very intrigued, I did not understand what you are trying to do, I want to participate too if it comes to things to eat (cakes, sweets, ..) even if I have to go on a diet I know !!!
matrices multiplication
Dear Silvio, <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=44&t=39467">viewtopic.php?f=44&t=39467</a><!-- l -->
matrices multiplication
[quote="Antonio Linares":2kinat2f]Dear Silvio, <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=44&t=39467">viewtopic.php?f=44&t=39467</a><!-- l -->[/quote:2kinat2f] Dear antonio I know that Python it is a multi-paradigm language, which supports both procedural programming (which makes use of functions) and object-oriented programming (including features such as single and multiple inheritance, but Harbor also supports these two things. and then I don't understand what is needed to convert programs made on python to harbour that is, I do not see the need, if you have something else in mind that I do not know I raise my hands a colleague of mine ( school) builds programs with python but uses additional tools for graphics and more (TkInter which also includes the graphical interface management system, which is what you see when you use the program. Other tools to mention are PYQt and wxPython.), he use pyton to create games (PyGame, PyKyra and the 3D rendering engines) There are things that Python can't do well, or at all. For example it is not a low-level language and therefore not good for creating components such as drivers. [b:2kinat2f]It is not suitable for creating cross-platform executables and it is not even the ideal choice if the code must be as fast as possible.[/b:2kinat2f] Historically it has been mainly used for scripting and automation elements in fact my colleague uses it with [b:2kinat2f]Arduino[/b:2kinat2f]
matrices multiplication
Dear Silvio, My interest in porting those 9 lines from Python to Harbour is in building a small and simple neural network to be used from Harbour and mainly for learning purposes <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
maximize
hola, tien alguna forma de yo saber cuando una window foi maximized ? tipo ownd:bMaximized:= {|| msginfo("foi maximizado") } es possible fazer isso ? thanks
maximize
Hi, have how i know when a window was maximized ? exemple: ownd:bMaximized:= {|| msginfo("Was maximized ") } how make it ? thanks
maximize
Hi! You can try: oWnd:OnResize:={|| iif( oWnd:nWidth>=getsysmetrics(0),MsgInfo('MAXIMIZED'),nil ) }
maximize
Lailton, You can also use: oWnd:bResized = { | nSizeType, nWidth, nHeight | ... your code ... } nSizeType can be: #define SIZE_MAXIMIZED 2 #define SIZE_MINIMIZED 1 #define SIZE_RESTORED 0
maximize
Thanks Antonio. You can see about my topico (TActiveX) thanks
maximize
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=82084#p82084">viewtopic.php?p=82084#p82084</a><!-- l -->
maximize a minimized exe
How can I maximize a minimized 16 bit exe from another EXE. Thanks in advance Otto
maximize a minimized exe
Try using FindWindow() and then ShowWindow(). EMG
maximize a minimized exe
Enrico, Where can further information be found regarding the use of these 2 functions? It is not in the 1.1 xHarbour manual nor the FiveWin Help files for 7.04. Regards, Ken
maximize a minimized exe
This is a sample: [code:xmwbit9q]#include "Fivewin&#46;ch" #define SW_MAXIMIZE 3 FUNCTION MAIN&#40;&#41; LOCAL hWnd &#58;= FINDWINDOW&#40; 0, "Main window title" &#41; IF !EMPTY&#40; hWnd &#41; SHOWWINDOW&#40; hWnd, SW_MAXIMIZE &#41; ELSE ? "Window not found" ENDIF RETURN NIL[/code:xmwbit9q] EMG
maximize a minimized exe
[quote="Ken Wantz":1fnn6879]Enrico, Where can further information be found regarding the use of these 2 functions? It is not in the 1.1 xHarbour manual nor the FiveWin Help files for 7.04. Regards, Ken[/quote:1fnn6879] Both functions are documented inside fwfun.chm. EMG
maximize a minimized exe
Ken, Besides Enrico's example, please review FWH\samples\ShowApp.prg also
maximize a minimized exe
Thanks Enrico and Antonio, Another stupid leson learned. I was doing a search for FIND expecting all possibilities to be listed. Instead, I got 5 completely different titles. That will teach me that shortcuts do not always work. Regards, Ken
maxrow() and maxcol()
How I can converte from clipper these functions ?'
maxrow() and maxcol()
You can get the screen resolution but the amount of rows and cols depends on what font you use
maxrow() and maxcol()
I use a dialog #include "fivewin.ch" #include "constant.ch" FUNCTION BlackJack() Local nBottom := 42 Local nRight := 99 Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 ) Local nHeight := nBottom * DLG_CHARPIX_H DEFINE DIALOG oDlg21 ; TITLE "test" ; SIZE nWidth, nHeigh ACTIVATE DIALOG oDlg21 CENTERED
maxrow() and maxcol()
resolved!!! [img:ro66ch1d]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2016/02/n&#46;jpg[/img:ro66ch1d]
maxrow() and maxcol()
I wish simulate a n animation from top/sx to center bu tI dont't now how make it
maxrow() and maxcol()
Very nice! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Using a timer and changing the coordinates of the image control ?
maxrow() and maxcol()
no I'm made this [code=fw:1vpzikr5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Muovi<span style="color: #000000;">&#40;</span> nWidth,nHeight <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oSprite<br /><br />&nbsp; &nbsp;cardmap:= <span style="color: #ff0000;">"Back"</span><br /><br /><br /><br /><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> BITMAP oSprite;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">RESOURCE</span> cardmap;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span> NOBORDER<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #000000;">ltransparent</span>:=.t.<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">650</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">600</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">580</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nYPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">540</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">520</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">500</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">480</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">440</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">420</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">400</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">380</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">340</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">320</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">300</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">280</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">240</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1vpzikr5] But I not have a right animation I wish have an animation ogf a card from the deck (at left ) to center
maxrow() and maxcol()
a test to try [code=fw:1175lwnd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"constant.ch"</span><br /><span style="color: #00D7D7;">#define</span> &nbsp; TXT_GAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"EasyBlackJack"</span><br /><span style="color: #00D7D7;">#define</span> &nbsp; TXT_RELEASE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"1.00"</span><br /><span style="color: #00C800;">FUNCTION</span> BlackJack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> i<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Local</span> nBottom &nbsp; := <span style="color: #000000;">42</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Local</span> nRight &nbsp; &nbsp;:= <span style="color: #000000;">99</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Local</span> nWidth := &nbsp;<span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nRight * DLG_CHARPIX_W, <span style="color: #000000;">180</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Local</span> nHeight := nBottom * DLG_CHARPIX_H<br /><br />oImagen = TImage<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Define</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"PANNOBLACK"</span>, &nbsp;<span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg21 &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> TXT_GAME +<span style="color: #ff0000;">" "</span>+ TXT_RELEASE &nbsp; &nbsp; ;<br />&nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> nWidth, nHeight<br /><br />oDlg21:<span style="color: #000000;">bPainted</span> := <span style="color: #000000;">&#123;</span>|hDC| PalBmpDraw<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oImagen:<span style="color: #000000;">hBitmap</span>,, oDlg21:<span style="color: #000000;">nWidth</span>, oDlg21:<span style="color: #000000;">nHeight</span>,, .T.<span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg21 <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>BuildMenu<span style="color: #000000;">&#40;</span>nWidth,nHeight<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br />&nbsp;<span style="color: #00C800;">Function</span> &nbsp;BuildMenu<span style="color: #000000;">&#40;</span>nWidth,nHeight<span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #000000;">2015</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Info"</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Cards"</span> <span style="color: #0000ff;">action</span> Presentazione<span style="color: #000000;">&#40;</span>nWidth,nHeight<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; oDlg21:<span style="color: #000000;">SetMenu</span><span style="color: #000000;">&#40;</span>oMenu<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">Function</span> Presentazione<span style="color: #000000;">&#40;</span>nWidth,nHeight<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; Muovi<span style="color: #000000;">&#40;</span>nWidth,nHeight<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #00C800;">function</span> Muovi<span style="color: #000000;">&#40;</span> nWidth,nHeight <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oSprite<br /><br />&nbsp; &nbsp;cardmap:= <span style="color: #ff0000;">"Back"</span><br /><br /><br /><br /><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> BITMAP oSprite;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">RESOURCE</span> cardmap;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span> NOBORDER<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #000000;">ltransparent</span>:=.t.<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">650</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">600</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">580</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nYPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">540</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">520</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">500</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">480</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">440</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">420</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">400</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">380</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">340</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">320</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">300</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">280</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">sleep</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nxPos := <span style="color: #000000;">240</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nyPos := <span style="color: #000000;">80</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oSprite:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nYPos, nXPos, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1175lwnd] the test.rc 1 24 "WindowsXP.Manifest" BACK BITMAP ".\CARD\BACK.BMP" PANNOBLACK BITMAP ".\PANNO\BLACK.BMP" [b:1175lwnd]the back.bmp[/b:1175lwnd] [img:1175lwnd]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2016/02/BACK&#46;bmp[/img:1175lwnd] [b:1175lwnd]the BLACK.jpg[/b:1175lwnd] [img:1175lwnd]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2016/02/BLACK&#46;jpg[/img:1175lwnd] I wish this animation see the line red [img:1175lwnd]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2016/02/mov&#46;jpg[/img:1175lwnd] it is possible ?
maxrow() and maxcol()
Silvio, the card-painting of Your sample doesn't look very nice ( not transparent and bad movement ) As well I repainted the card with Pixelformer like You can see have a look at my solution : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/Cardmove1.zip">http://www.pflegeplus.com/DOWNLOADS/Cardmove1.zip</a><!-- m --> Moving a image-group and changing the direction You can have a look at : <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=31972">viewtopic.php?f=3&t=31972</a><!-- l --> [img:fqjhyhx0]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Cardmove1&#46;jpg[/img:fqjhyhx0] best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
maxrow() and maxcol()
Thanks Uwe, Now the animation run ok but now I have another problem [img:27mww9b4]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2016/02/move&#46;jpg[/img:27mww9b4] two cards for the Dealer the first card ( back) is moved ok the second card (ace) is moved ok but the ace is down and I not see good the card how I can make to have it up then I tried to move a card for the player it is moving but came from a bad point look at mail pls it must go out from deck and go to position I insert [img:27mww9b4]http&#58;//www&#46;eoeo&#46;it/wp-content/uploads/2016/02/mm&#46;jpg[/img:27mww9b4] the red line is the animation now the green line is the animation i wish
maxrow() and maxcol()
Silvio, left down or down left is my other sample. I think You need a [color=#0000FF:1f4x0nzo][b:1f4x0nzo]DIAGONAL[/b:1f4x0nzo]-[/color:1f4x0nzo]calculation from the upper-right corner ? [img:1f4x0nzo]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Imgmove2&#46;jpg[/img:1f4x0nzo] best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
maxrow() and maxcol()
Silvio, added new calculations to display [color=#0000FF:8imoycas][b:8imoycas]VERTICAL movements[/b:8imoycas][/color:8imoycas] I still have to bring the [color=#FF0000:8imoycas]last painted image on TOP[/color:8imoycas] After all I think the basics are done for You to carry on with the rest. have a look at Your email ( I changed from RESOURCE to FILENAME for my tests ! ) [b:8imoycas]The changes for VERTICAL movements[/b:8imoycas] [code=fw:8imoycas]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> CardMove<span style="color: #000000;">&#40;</span>cCardName, nTDI, nTPI, nLl, nCard, lDealer<span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">// FUNCTION CardMove(</span><br /><span style="color: #B900B9;">//CardName, </span><br /><span style="color: #B900B9;">//Top dealer, </span><br /><span style="color: #B900B9;">//Top player, </span><br /><span style="color: #B900B9;">//left start position, </span><br /><span style="color: #B900B9;">//nCard, </span><br /><span style="color: #B900B9;">//dealer or player)</span><br /><br />* <span style="color: #00C800;">Local</span> oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">local</span> cardmap<br /><span style="color: #00C800;">Local</span> G := <span style="color: #000000;">46</span>, H := <span style="color: #000000;">41</span>, I := <span style="color: #000000;">1</span>, J := <span style="color: #000000;">1</span><br /><br /><span style="color: #00C800;">IF</span> ccardname = <span style="color: #000000;">0</span><br />    cardmap := c_path1 + <span style="color: #ff0000;">"Back.bmp"</span><br /><span style="color: #00C800;">ELSE</span><br />      cardmap := c_path1 + <span style="color: #ff0000;">"card"</span> +alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>ccardname<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".bmp"</span><br /><span style="color: #00C800;">Endif</span><br /><br />@ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">IMAGE</span> oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span> FILENAME CardMap NOBORDER<br /><br />oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lTransparent</span> := .T.<br />oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> lDealer = .T. <span style="color: #B900B9;">// DEALER  movement HORIZONTAL top / right to top / left</span><br />    <span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br />        <span style="color: #00C800;">FOR</span> J := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> G<br />            nLl-= <span style="color: #000000;">10</span><br />            oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Move</span> <span style="color: #000000;">&#40;</span> nTDI,nLl,,,.t.<span style="color: #000000;">&#41;</span><br />            oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            SYSWAIT1<span style="color: #000000;">&#40;</span><span style="color: #000000;">0.01</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">NEXT</span><br />        nLl := <span style="color: #000000;">660</span><br />        G -= <span style="color: #000000;">8</span><br />    <span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">ELSE</span> <span style="color: #B900B9;">// PLAYER  movement VERTICAL from top / right to bottom / left</span><br />    nLl := <span style="color: #000000;">660</span><br />    <span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br />        <span style="color: #00C800;">FOR</span> J := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> H<br />            nLl-= <span style="color: #000000;">10</span><br />            oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Move</span> <span style="color: #000000;">&#40;</span> nTDI+= <span style="color: #000000;">8</span>,nLl,,,.t.<span style="color: #000000;">&#41;</span><br />            oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            SYSWAIT1<span style="color: #000000;">&#40;</span><span style="color: #000000;">0.01</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">NEXT</span><br />        nLl := <span style="color: #000000;">660</span><br />        G -= <span style="color: #000000;">8</span><br />    <span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:8imoycas] best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
maxrow() and maxcol()
Uwe, [b:3uvyi0ro]your test sample run ok and it was I wish[/b:3uvyi0ro] When I put this function [b:3uvyi0ro]on my source it make error [/b:3uvyi0ro] and I not understood why [b:3uvyi0ro]the error[/b:3uvyi0ro] [code=fw:3uvyi0ro]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br />&nbsp; &nbsp;Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">G</span>:\13_02_2016\BlackJack\BlackJack.Exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">Size</span>: <span style="color: #000000;">7</span>,<span style="color: #000000;">474</span>,<span style="color: #000000;">688</span> bytes<br />&nbsp; &nbsp;Compiler version: <span style="color: #000000;">xHarbour</span> <span style="color: #000000;">1.2</span><span style="color: #000000;">.3</span> Intl. <span style="color: #000000;">&#40;</span>SimpLex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>Build <span style="color: #000000;">20150603</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;FiveWin &nbsp;Version: <span style="color: #000000;">FWHX</span> <span style="color: #000000;">16.01</span><br />&nbsp; &nbsp;Windows version: <span style="color: #000000;">6.1</span>, Build <span style="color: #000000;">7600</span> <br /><br />&nbsp; &nbsp;Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">24</span> secs <br />&nbsp; &nbsp;Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">02</span>/<span style="color: #000000;">20</span>/<span style="color: #000000;">16</span>, <span style="color: #000000;">00</span>:<span style="color: #000000;">43</span>:<span style="color: #000000;">25</span><br />&nbsp; &nbsp;Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span> &nbsp;<span style="color: #00C800;">Class</span>: <span style="color: #ff0000;">'NIL'</span> has no exported <span style="color: #00C800;">method</span>: <span style="color: #000000;">NWIDTH</span><br />&nbsp; &nbsp;Args:<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> &nbsp; <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = U &nbsp; <br /><br />Stack Calls<br />===========<br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> NWIDTH<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\source\classes\BITMAP.PRG => TBITMAP:<span style="color: #00C800;">NEW</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">178</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">IMAGE</span>.PRG => TIMAGE:<span style="color: #00C800;">NEW</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">53</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\PBlack.prg => CARDMOVE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">959</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\PBlack.prg => PLAY21<span style="color: #000000;">&#40;</span> <span style="color: #000000;">290</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\PBlack.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>BUILDMENU<span style="color: #000000;">&#40;</span> <span style="color: #000000;">118</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">MENU</span>.PRG => TMENU:<span style="color: #000000;">COMMAND</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1062</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">COMMAND</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">380</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">905</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> DIALOGBOXINDIRECT<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">293</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\PBlack.prg => BLACKJACK<span style="color: #000000;">&#40;</span> <span style="color: #000000;">101</span> <span style="color: #000000;">&#41;</span></div>[/code:3uvyi0ro]
maxrow() and maxcol()
Silvio, Are you using ... OF oWnd when you create your bitmap ? from bitmap.prg line 178: nHeight := Min( ::nHeight(), oWnd:nHeight() ) it seems as oWnd is nil
maxrow() and maxcol()
Antonio, It is strange we use oDgl21 ( dialog) and it is static I have the CardMove function ( made from Uwe and Modify by me) see the call to this function [code=fw:2l2vr6jf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> oDlg21<br /><span style="color: #00C800;">static</span> c_path1<br /><span style="color: #00C800;">static</span> oSprite<span style="color: #000000;">&#91;</span><span style="color: #000000;">52</span><span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">static</span> nCard<br /><span style="color: #00C800;">static</span> adeck<br /><span style="color: #00C800;">static</span> ncardval  := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">static</span> ccardname := <span style="color: #000000;">2</span><br /><span style="color: #00C800;">static</span> ccardBmp  := <span style="color: #000000;">3</span><br /><span style="color: #00C800;">static</span> ndecksize := <span style="color: #000000;">52</span><br /><span style="color: #00C800;">static</span> ndelay := <span style="color: #000000;">2</span><br /><span style="color: #00C800;">static</span> anewdeck<br /><br /><br /><span style="color: #00C800;">Function</span> Play21<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <span style="color: #00C800;">local</span> nmaxchips := <span style="color: #000000;">1000</span><br />  <span style="color: #00C800;">local</span> nchips<br />  <span style="color: #00C800;">local</span> nbet := <span style="color: #000000;">0</span><br />  <span style="color: #00C800;">local</span> ncardsleft := <span style="color: #000000;">0</span><br />  <span style="color: #00C800;">local</span> ndealerdealt := <span style="color: #000000;">0</span><br />  <span style="color: #00C800;">local</span> nplayerdealt := <span style="color: #000000;">0</span><br />  <span style="color: #00C800;">local</span> ndeckpos := <span style="color: #000000;">1</span><br />  <span style="color: #00C800;">local</span> caction := <span style="color: #ff0000;">" "</span><br />  <span style="color: #00C800;">local</span> aplayershand<br />  <span style="color: #00C800;">local</span> adealershand<br />  <span style="color: #00C800;">local</span> ldoubledown := .f.<br />  <span style="color: #00C800;">local</span> lplayerbust := .f., ldealerbust := .f.<br />  <span style="color: #00C800;">local</span> nplayerhandval<br />  <span style="color: #00C800;">local</span> ndealerhandval<br />  <span style="color: #00C800;">local</span> cplayagain := <span style="color: #ff0000;">"Y"</span><br />  <span style="color: #00C800;">local</span> ndealrow := <span style="color: #000000;">95</span><br />  <span style="color: #00C800;">local</span> nplayrow := <span style="color: #000000;">450</span><br />  <span style="color: #00C800;">local</span> ndealcol := <span style="color: #000000;">660</span><br />  <span style="color: #00C800;">local</span> nplaycol := <span style="color: #000000;">660</span><br />  nchips := nmaxchips<br />  nCard:= <span style="color: #000000;">1</span><br /><br /><br /><span style="color: #00C800;">do</span>  <span style="color: #00C800;">while</span> .t.<br /><br /><br />    aplayershand := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />    adealershand := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">if</span> ncardsleft < <span style="color: #000000;">10</span>    <span style="color: #B900B9;">// if there are <  10 cards on deck  it make a shuffle</span><br />    <br />      <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Please wait while I shuffle the deck..."</span>,<span style="color: #ff0000;">"BlackJack"</span><span style="color: #000000;">&#41;</span><br />      newdeck<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>    <span style="color: #B900B9;">// create an array with 4 field for the cards</span><br />      shuffle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>      <span style="color: #B900B9;">// shuffle the card  array  with random function </span><br /><br />      ncardsleft := ndecksize<br />      ndeckpos := <span style="color: #000000;">1</span><br />      <br />    <span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #B900B9;">// show the chips</span><br /><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"You have "</span>+alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nchips<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" chips."</span>,<span style="color: #ff0000;">"BlackJack"</span><span style="color: #000000;">&#41;</span><br />nbet := <span style="color: #000000;">1</span><br />MsgGet<span style="color: #000000;">&#40;</span> TXT_GAME, TXT_HOW_BAT_CHIPS, @nBet, , , <span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"your Bet is :"</span>+STR<span style="color: #000000;">&#40;</span>nBet<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><br />    ndealerdealt := <span style="color: #000000;">10</span><br />    nplayerdealt := <span style="color: #000000;">10</span><br /><br /><br /><span style="color: #B900B9;">// delear Cards</span><br />CardMove<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>, ndealrow, nplayrow, ndealcol+ndealerdealt*<span style="color: #000000;">4</span>, nCard, .T.<span style="color: #000000;">&#41;</span>             <span style="color: #B900B9;">// animation card delear   Back ( hide) </span><br />    aadd<span style="color: #000000;">&#40;</span>adealershand,<span style="color: #000000;">&#123;</span>adeck<span style="color: #000000;">&#91;</span>ndeckpos,ncardval<span style="color: #000000;">&#93;</span>,adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardname<span style="color: #000000;">&#93;</span>,adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardBmp<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// save to array this card</span><br />    ndeckpos ++              <span style="color: #B900B9;">// deck position</span><br />    ndealerdealt+=<span style="color: #000000;">20</span><br />    nCard++                    <span style="color: #B900B9;">// oSprite array</span><br /><br />CardMove<span style="color: #000000;">&#40;</span>adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardBmp<span style="color: #000000;">&#93;</span>, ndealrow, nplayrow, ndealcol+ndealerdealt*<span style="color: #000000;">4</span>, nCard, .T.<span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// animation card delear </span><br /> aadd<span style="color: #000000;">&#40;</span>adealershand,<span style="color: #000000;">&#123;</span>adeck<span style="color: #000000;">&#91;</span>ndeckpos,ncardval<span style="color: #000000;">&#93;</span>,adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardname<span style="color: #000000;">&#93;</span>,adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardBmp<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>    <span style="color: #B900B9;">// save to array this card</span><br />  ndeckpos ++          <span style="color: #B900B9;">// deck position</span><br />  ndealerdealt +=<span style="color: #000000;">20</span><br />  nCard++              <span style="color: #B900B9;">// oSprite array</span><br /><br /><br /><br /><span style="color: #B900B9;">// Player cards</span><br />CardMove<span style="color: #000000;">&#40;</span>adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardBmp<span style="color: #000000;">&#93;</span>,ndealrow, nplayrow, nplaycol+nplayerdealt*<span style="color: #000000;">4</span>, nCard, .F.<span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// animation  first card player  </span><br />    aadd<span style="color: #000000;">&#40;</span>aplayershand,<span style="color: #000000;">&#123;</span>adeck<span style="color: #000000;">&#91;</span>ndeckpos,ncardval<span style="color: #000000;">&#93;</span>,adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardname<span style="color: #000000;">&#93;</span>,adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardBmp<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// save to array this card</span><br />    ndeckpos ++<br />    nplayerdealt+=<span style="color: #000000;">20</span><br />     nCard++<br /><br />CardMove<span style="color: #000000;">&#40;</span>adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardBmp<span style="color: #000000;">&#93;</span>,ndealrow, nplayrow, nplaycol+nplayerdealt*<span style="color: #000000;">4</span>, nCard, .F.<span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// animation  Second card player  </span><br />    aadd<span style="color: #000000;">&#40;</span>aplayershand,<span style="color: #000000;">&#123;</span>adeck<span style="color: #000000;">&#91;</span>ndeckpos,ncardval<span style="color: #000000;">&#93;</span>,adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardname<span style="color: #000000;">&#93;</span>,adeck<span style="color: #000000;">&#91;</span>ndeckpos,ccardBmp<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// save to array this card</span><br />    ndeckpos ++<br />    nplayerdealt+=<span style="color: #000000;">20</span><br />     nCard++<br /><br /><br />   ldoubledown := .t.<br />    lplayerbust := .f.<br />    ldealerbust := .f.<br />    lonecard := .f.<br /><br />  <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .t.  <span style="color: #B900B9;">// the players hand</span><br /><br />.....<br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .t   <span style="color: #B900B9;">// delear Hand </span><br /><span style="color: #B900B9;">// cicle for the delear hand</span><br />....<br /><br /><span style="color: #00C800;">enddo</span><br /><br /><br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />  <span style="color: #B900B9;">// case of total point cards</span><br />....<br /> <span style="color: #00C800;">endcase</span><br /><br /><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Dealers hand "</span>+ alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>ndealerhandval<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+CRLF+;<br />                <span style="color: #ff0000;">"Players hand "</span> + alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nplayerhandval<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,TXT_GAME <span style="color: #000000;">&#41;</span><br /><br /><br /> ncardsleft := ndecksize - ndeckpos<br /><br /><br /><br />    <span style="color: #00C800;">IF</span> msgYesNo<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Play again? "</span><span style="color: #000000;">&#41;</span><br />       clrscr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">else</span><br />       clrscr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        exit<br />     <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">enddo</span><br /><br /><br /><br /><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><br /><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">FUNCTION</span> CardMove<span style="color: #000000;">&#40;</span>cCardName, nTDI, nTPI, nLl, nCard, lDealer<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cardmap<br /><span style="color: #00C800;">Local</span> G := <span style="color: #000000;">46</span>, H := <span style="color: #000000;">41</span>, I := <span style="color: #000000;">1</span>, J := <span style="color: #000000;">1</span><br /><br /><span style="color: #00C800;">IF</span> ccardname = <span style="color: #000000;">0</span><br />   cardmap := c_path1 + <span style="color: #ff0000;">"Back.bmp"</span><br /><span style="color: #00C800;">ELSE</span><br />      cardmap := c_path1 + <span style="color: #ff0000;">"card"</span> +alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>ccardname<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".bmp"</span><br /><span style="color: #00C800;">Endif</span><br /><br />@ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">IMAGE</span> oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span> FILENAME CardMap NOBORDER <span style="color: #0000ff;">of</span> oDlg21<br /><br />oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lTransparent</span> := .T.<br />oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> lDealer = .T.<br />   <span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br />      <span style="color: #00C800;">FOR</span> J := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> G<br />         nLl-= <span style="color: #000000;">10</span><br />         oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Move</span> <span style="color: #000000;">&#40;</span> nTDI,nLl,,,.t.<span style="color: #000000;">&#41;</span><br />         oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         SYSWAIT1<span style="color: #000000;">&#40;</span><span style="color: #000000;">0.01</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">NEXT</span><br />      nLl := <span style="color: #000000;">660</span><br />      G -= <span style="color: #000000;">8</span><br />   <span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">ELSE</span><br />   nLl := <span style="color: #000000;">660</span><br />   <span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br />      <span style="color: #00C800;">FOR</span> J := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> H<br />         nLl-= <span style="color: #000000;">10</span><br />         oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Move</span> <span style="color: #000000;">&#40;</span> nTDI+= <span style="color: #000000;">8</span>,nLl,,,.t.<span style="color: #000000;">&#41;</span><br />         oSprite<span style="color: #000000;">&#91;</span>nCard<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         SYSWAIT1<span style="color: #000000;">&#40;</span><span style="color: #000000;">0.01</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">NEXT</span><br />      nLl := <span style="color: #000000;">660</span><br />      G -= <span style="color: #000000;">8</span><br />   <span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> SYSWAIT1<span style="color: #000000;">&#40;</span> nLong <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nSeconds<br /><br /><span style="color: #00C800;">DEFAULT</span> nLong := .<span style="color: #000000;">1</span><br />nSeconds := Seconds<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + nLong<br /><br /><span style="color: #00C800;">WHILE</span> Seconds<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> < nSeconds<br />   SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:2l2vr6jf]
maxrow() and maxcol()
but now I'm trying at office and it seems to run ok very very very very strange
maxrow() and maxcol()
Silvio, Tested from resource without any problem.( big exe-file ) Some improvements and new documentation for better understandig of image-positioning- and speed-adjustment included. Just change the defined values to see the different results. Now You can define / calculate the space between the images <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/Cardmove2.zip">http://www.pflegeplus.com/DOWNLOADS/Cardmove2.zip</a><!-- m --> I added 2 lines, to get the needed values ( only needed during programming ) As well I tested the requested tooltip-solution ( visible on last painted image at bottom ) I noticed a missing tooltip-close, leaving the image-area [color=#0000FF:3nkhtdsl]oDlg21:bLClicked := {|nRow, nCol| MsgAlert( "Row : " + ALLTRIM(STR( nRow ) ) + CRLF + ; "Col : " + ALLTRIM(STR( nCol ) ), "Position" ) }[/color:3nkhtdsl] [img:3nkhtdsl]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Cardmove2&#46;jpg[/img:3nkhtdsl] best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
md5
Hola compañeros, tengo que enviar unos datos por internet a la Agencia de Rentas y piden que se anexe con un codigo md5 y vi mensajes anteriores por ejemplo el de Vailton que me parece sencillo pero al hacer la prueba no la reconoce [code=fw:1sd99a26]<div class="fw" id="{CB}" style="font-family: monospace;">With Harbour:<br /><span style="color: #000000;">Code</span>: <span style="color: #0000ff;">Select</span> all  Expand view<br />? hb_md5<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"teste"</span> <span style="color: #000000;">&#41;</span><br /><br /><br />With xHarbour:<br /><span style="color: #000000;">Code</span>: <span style="color: #0000ff;">Select</span> all  Expand view<br />? md5<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"teste"</span> <span style="color: #000000;">&#41;</span><br />Vailton Renato</div>[/code:1sd99a26] Quisiera saber si existe en xharbour y que librería hay que enlazar para utilizar dicha funcion Utilizo xharbour 1.21 y fwh712 y bcc582. Y si en caso de no existir en xHarbour si hay alguna forma, tambien vi en <!-- m --><a class="postlink" href="http://dollar.ecom.cmu.edu/sec/cryptosource.htm">http://dollar.ecom.cmu.edu/sec/cryptosource.htm</a><!-- m --> los codigos fuentes de md5 en c, pero de eso no se nada. Si alguien lo utiliza agradeceria me orientara Gracias Gracias
md5
Eu uso xHarbour e chamo com HB_MD5( cParametro ) ou entao HB_MD5File( cArquivo ) A função está definida em RTL.LIB
md5
Gracias Sambomb voy a probar. Luis
mdb: contains data but recordcount() answers -1
Hi,my small sample access-database contains one table with three fields and four recordsets. To browse it, I use following code:[code:1w6rcsu6]function browsen&#40;&#41; local oWin2 local oConnection &#58;= TOleAuto&#40;&#41;&#58;New&#40; "ADODB&#46;Connection" &#41; local oRecordSet local oBrw DEFINE WINDOW oWin2 MDICHILD FROM 5, 7 TO 17, 40 TITLE "XBrowse" oConnection&#58;Open&#40; "Provider=Microsoft&#46;Jet&#46;OLEDB&#46;4&#46;0;Data Source=gilbert&#46;mdb; Persist Security Info=False" &#41; oRecordSet&#58;=TOleAuto&#40;&#41;&#58;New&#40; "ADODB&#46;Recordset" &#41; oRecordSet&#58;Open&#40; "SELECT * FROM Name", oConnection &#41; msginfo&#40;oRecordSet&#58;Fields&#40; "Name" &#41;&#58;Value&#41; // Here I get a value = "Hans" msginfo&#40;oRecordSet&#58;RecordCount&#40;&#41;&#41; // Here the response = "-1" oBrw&#58;=TXbrowse&#40;&#41;&#58;New&#40;oWin2&#41; oBrw&#58;SetAdo&#40; oRecordSet &#41; oBrw&#58;Createfromcode&#40;&#41; oWin2&#58;SetControl&#40;oBrw&#41; ACTIVATE WINDOW oWin2 return &#46;t&#46; [/code:1w6rcsu6]When I call "msginfo(oRecordSet:Fields( "Name" ):Value)" I get "Hans" as an answer, what is the content of Name in the first record. But when I call "msginfo(oRecordSet:RecordCount())" the answer is "-1".As a consequence, xbrowse does not show any records. I get the same behaviour with mysql-databases.Can somebody help me?
mdb: contains data but recordcount() answers -1
Try[code:1yw63yg9]oRecordSet&#58;Open&#40; "SELECT * FROM Name", oConnection, 1, 3 &#41;[/code:1yw63yg9]EMG
mdb: contains data but recordcount() answers -1
Enrico, thank you, with mdb it did the trick. But with mySql the same problem remains. What is it, that these parameters do? And have I to use other parameters for mySql?
mdb: contains data but recordcount() answers -1
Try one of the following values for the third parameter:[code:6tlkdo49]#define adOpenForwardOnly 0 #define adOpenKeyset 1 #define adOpenDynamic 2 #define adOpenStatic 3[/code:6tlkdo49]EMG
mdb: contains data but recordcount() answers -1
And as the last resort try[code:2rborr53]oRs&#58;CursorLocation = adUseServer[/code:2rborr53] or [code:2rborr53]oRs&#58;CursorLocation = adUseClient[/code:2rborr53] where [code:2rborr53]#define adUseServer 2 #define adUseClient 3[/code:2rborr53]EMG
mdb: contains data but recordcount() answers -1
RecordCount() works correctly only if CursorLocation is adUseClient. RecordCount() always returns -1 when the recordset is opened on the server ( i.e., CursorLication = adUseServer)
mdb: contains data but recordcount() answers -1
NageswaraRao, Enrico,Thanks a lot, now it works with both types of databases <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
mdb: contains data but recordcount() answers -1
[quote="nageswaragunupudi":1n2px7w4]RecordCount() works correctly only if CursorLocation is adUseClient. RecordCount() always returns -1 when the recordset is opened on the server ( i.e., CursorLication = adUseServer)[/quote:1n2px7w4]This is not completely true. The following sample using MSDE work with both CursorLocation:[code:1n2px7w4]#define adOpenForwardOnly 0 #define adOpenKeyset 1 #define adOpenDynamic 2 #define adOpenStatic 3 #define adLockReadOnly 1 #define adLockPessimistic 2 #define adLockOptimistic 3 #define adLockBatchOptimistic 4 #define adUseServer 2 #define adUseClient 3 FUNCTION MAIN&#40;&#41; LOCAL oRs &#58;= CREATEOBJECT&#40; "ADODB&#46;Recordset" &#41; // oRs&#58;CursorLocation = adUseServer oRs&#58;CursorLocation = adUseClient oRs&#58;Open&#40; "SELECT * FROM Contatti ORDER BY RagSoc2, RagSoc1", "Provider=SQLOLEDB;Integrated Security=SSPI;Data Source=EMAG\Emag;Initial Catalog=Ecmp", adOpenKeyset, adLockOptimistic &#41; ? oRs&#58;RecordCount oRs&#58;Close&#40;&#41; RETURN NIL[/code:1n2px7w4]EMG
me ayudan me sale error al compilar ejemplo testxbrw
[b:8bzg0u0k]Hola compile el ejemplo testxbrw para conocerlo y me sale este error por que sera <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> [/b:8bzg0u0k] Harbour Compiler Alpha build 44.0 (Flex) Copyright 1999-2004, <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m --> Compiling 'C:\FWH\SAMPLES\testxbrw.prg'... Lines 690, Functions/Procedures 21 Generating C source output to 'C:\FWH\SAMPLES\testxbrw.hrb'... Done. Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland c:\fwh\samples\testxbrw.hrb: Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland Error: Unresolved external '_HB_FUN_ADSSETSERVERTYPE' referenced from C:\FWH\SAMPLES\TESTXBRW.OBJ Error: Unresolved external '_HB_FUN_ADSSETFILETYPE' referenced from C:\FWH\SAMPLES\TESTXBRW.OBJ Error: Unresolved external '_HB_FUN_ADSKEYCOUNT' referenced from C:\FWH\SAMPLES\TESTXBRW.OBJ Error: Unresolved external '_HB_FUN_ADSGETRELKEYPOS' referenced from C:\FWH\SAMPLES\TESTXBRW.OBJ Error: Unresolved external '_HB_FUN_ADSSETRELKEYPOS' referenced from C:\FWH\SAMPLES\TESTXBRW.OBJ Error: Unresolved external '_HB_FUN__ADS' referenced from C:\FWH\SAMPLES\TESTXBRW.OBJ Fin del proceso. MAKE Version 5.2 Copyright (c) 1987, 2000 Borland ** error 2 ** deleting C:\FWH\SAMPLES\testxbrw.exe Ha habido ERRORES al intentar Generar la Aplicacion [b:8bzg0u0k]ATENTAMENTE yo la preguntona <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Saluditos Aida <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> [/b:8bzg0u0k]
me ayudan me sale error al compilar ejemplo testxbrw
Ya pude compilar el ejemplo me puse a leer y leer y leer y leer en todo el foro y encontre la respuesta si esta muy padre el xBrowse <!-- s:P --><img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz" /><!-- s:P --> <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: --> ya me anime y quitandome el miedo ya guarde el listbox en la cajita de recuerdos y empese a ponerlo en mi programita hasta el momento todo bien pero si me atoro ya saben empesare de preguntona Gracias y un bonito fin de semana Aida <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
me ayudan me sale error al compilar ejemplo testxbrw
you must REM these lines /*extern AdsKeyCount, AdsGetRelKeyPos, AdsSetRelKeyPos #command SET SERVER LOCAL => AdsSetServerType ( 1 ) #command SET SERVER REMOTE => AdsSetServerType ( 2 ) #command SET FILETYPE TO <x:NTX,CDX,ADT> ; => AdsSetFileType( if( upper( <(x)> ) == "NTX", 1, ; if( upper( <(x)> ) == "CDX", 2, 3 ) ) ) */ and then //REQUEST ADS //rddRegister( "ADS", 1 ) //rddsetdefault( "ADS" ) //SET SERVER LOCAL //SET FILETYPE TO CDX