topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
pasar codigo de RPG a Harbour se podra? | Aida:
Una precisión, no es lo mismo RPG (Report Program Generator) que PRG (Código xBase), yo conozco el lenguaje RPG
así que si necesitas apoyo, estoy a tus ordenes.
Te adjunto unas imágenes de código RPG para que le "eches un ojito", y veras que el proyecto tiene lo suyo, habrá que
analizar cada programa RPG para entender lo que hace y codificarlo en código xBase, ya sea Harbour o xHarbour, no
existe un convertidor, al menos yo no lo conozco.
[url=http://www.subirimagenes.com/privadas-clip1-2268119.html:2p0sa4lr][img:2p0sa4lr]http://s2.subirimagenes.com/privadas/previo/thump_2268119clip1.jpg[/img:2p0sa4lr][/url:2p0sa4lr]
[url=http://www.subirimagenes.com/privadas-clip2-2268120.html:2p0sa4lr][img:2p0sa4lr]http://s2.subirimagenes.com/privadas/previo/thump_2268120clip2.jpg[/img:2p0sa4lr][/url:2p0sa4lr]
[url=http://www.subirimagenes.com/privadas-clip3-2268121.html:2p0sa4lr][img:2p0sa4lr]http://s2.subirimagenes.com/privadas/previo/thump_2268121clip3.jpg[/img:2p0sa4lr][/url:2p0sa4lr]
Saludos, abajo tienes mi correo |
pasar codigo de RPG a Harbour se podra? | Aida , En realidad no es complicado , lo demorado es que toca leer todo el código. Hace muchos años pase uno de RPG Clipper, también de Cobol a Delphi.
Me acuerdo que también pace varios programas de RPG BAJO PC (RPG Para Micro ).a Visual BAsic,
Toca ver el código, Tiene Algún Manual de Usuario para ver el Diseño de las pantalla. En si Documentación.
Saludos |
pasar codigo de RPG a Harbour se podra? | Primero que Nada
[color=#800000:1mawzck0]FELIZ PRÓXIMO AÑO NUEVO 2015[/color:1mawzck0] <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: -->
Gracias a todos estoy en espera de que me entreguen los archivos, seguramente sera ya en Enero <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
yo les aviso cuando los tenga para darles lata <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: -->
por cierto que bases de datos usa el RPG por que imagino tendré que importar todo a MysQl
Gracias <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Saluditos <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> |
pasar codigo de RPG a Harbour se podra? | Hola Aida, espero estes bien, no se si esto podra ayudarte, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
<!-- m --><a class="postlink" href="http://soporte900.wordpress.com/2012/03/26/manual-as400i-introduccion-a-as400-2/">http://soporte900.wordpress.com/2012/03 ... a-as400-2/</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.rpgforweb.com/rpgforweb.htm">http://www.rpgforweb.com/rpgforweb.htm</a><!-- m --> |
pasar codigo de RPG a Harbour se podra? | Si Aida hay que emigar la base de datos. y se puede pasar al motor de base de datos que tu quieras.
Aida es un AS400 |
pasar codigo de RPG a Harbour se podra? | Gracias <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Saluditos <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> |
pasar codigo delphi a xbase | hola, necesito pasar el siguiente codigo de delphi a xbase, a ver si alguien me echa la mano
//A CONTINUACION UN EJEMPLO DE COMO LEER UN CAMPO BLOB QUE CONTIENE COSTOS Y PRECIOS
if FX_FIXED.FindKey('B',XXXXX); Codigo del producto
if OkR then
begin
SourceField :=FX_FIXED.FindField('FX_COSTOS');
Try
BlobStreamData :=TDBISAMBlobStream.Create(TBlobField(SourceField),bmRead);
BlobStreamData.Seek(0,0);
BlobStreamData.Read(CostosProducto,SizeOf(CostosProducto)); //CostosProducto : RegCostos
Finally
BlobStreamData.Free;
end;
end;
gracias |
pasar codigo delphi a xbase | <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> |
pasar codigo delphi a xbase | No es tan simple como parece. Tendrás que buscar el código fuente de la Clase TDBISAMBlobStream
Es la clase la que tienes que portar |
pasar datos de columna a fila | tengo un problema en una tabla tengo varios campos uno de ellos es el campo llamado maquina y tiene bvarios datos que se repiten y algunos no se repiten es decir mas o menos asi:maquina033033119148149152que funcion puedo ocupar para hacer un reporte pero que ese campo lo concentre en una fila de esta forma:033,119,148,149,152 |
pasar datos de columna a fila | Tienes que construirla... no he visto rutinas que hagan esto como parte del clipper ni de harbour ni de xharbourEsto es más o menos la secuencia:1) crea un array con valores unicos que vas leyendo2) con los valores unicos del array puedes crear una base de datos temporal3) ahora que ya tienes la base de datos temporal, reinicias la lectura y vas colocando en cada campo los valores originales... y listo |
pasar datos de columna a fila | Estimado pakotelPuedes ocupar PrintCargas los valores máquina a un arreglo y verifica que no se repitan, luego, suponiendo que el arreglo se llama maquina:[code:3bkz1nuq]
nInc:=1 //centimetros
nLargo:=Len(maquina)
PRINT oPrn
PAGE
for i=1 to nLargo
oPrn:CmSay(nFila,nCol+nInc,maquina[i]) //nInc es el incremento
nInc+=2 // calcula el tamaño del campo maquina
next
ENDPAGE
ENDPRINT
[/code:3bkz1nuq]Nota : si son muchos valores de máquinas debes controlar el salto al final de la liniaEspero que te sirvaSaludos Waldemar |
pasar de NTX a CDX | Hola:Me gustaría encontrar información para pasar índices NTX a CDX.Creo que además de añadir:[color=green:3rl4f7wx]ANNOUNCE RDDSYS
REQUEST DBFCDX, DBFFPT[/color:3rl4f7wx]Hay que hacer mas cosas, pero no se cuales.Tampoco entiendo bien lo de los TAGS. ¿No puedo seguir haciendo?USE CLIENTESINDEX ON FIELD->NOMBRE TO INDICE1INDEX ON FIELD->CODIGO TO INDICE2Dbcloseall()select 1use clientes index indice1, indice2..dbsetorder(2)browse()dbsetorder(1)¿?Muchas gracias. Un saludo |
pasar de NTX a CDX | USE JLORDEN NEW INDEX ON jlorden->ORD_NUMORD TAG NUMERO INDEX ON jlorden->ORD_NUMCOM TAG COMPROMISO INDEX ON jlorden->ORD_NUMGAS TAG CAUSADO INDEX ON jlorden->ORD_FCHORD TAG FCHORD INDEX ON jlorden->ORD_CODBEN TAG CODBENluego usasa SETORDER(n) o el nombre del TAG, revisa en las ultilidades habia una guia de uso de los CDX, no tienes que hacer mas nada, para crear tus DBF puedes usar DBUM o cualquier editor como PROMETHEUS... |
pasar de NTX a CDX | Con los indices CDX, puedes seguir utilizando todas las funciones y comandos que usabas con los NTX.Pero ademas te permiten implementar nuevas funcionalidades. Te paso dos PDF que te pueden servir de ayuda. [url:1mkfthud]http://www.ea6dd.com/ftp/bielsys/dbfcdx/dbfcdx%20indices.pdf[/url:1mkfthud](Recopilación de varias fuentes)[url:1mkfthud]http://www.ea6dd.com/ftp/bielsys/dbfcdx/dbfcdx.pdf[/url:1mkfthud](Jose A.Suárez Moreno)No son de autoria propia, y no se exactamente de donde los he sacado. |
pasar de NTX a CDX | Cuidado con los campos MEMO, si los utilizas |
pasar de NTX a CDX | Muchas gracias a todos.Sí uso campos memo, ¿qué ocurre?.Un saludo |
pasar de NTX a CDX | Cada RDD los maneja a su manera, sería conveniente que si tienes campos memo crearas un archivo con una estructura identica y copies con APPEND FROM, utilizando el RDD indicado para cada archivo |
pasar de NTX a CDX | Quique:Sí, eso lo había leído. Pensé que había que hacer algo más.En cuanto a los tags, entonces ¿no se puede seguir haciendo?USE PROVEE[b:2h1pibft] INDEX ON PROVEE->NOMBRE TO (pPath+"\PROVEE")
INDEX ON PROVEE->CODIGO TO (pPath+"\PROVEE2")
INDEX ON PROVEE->NIF TO (pPath+"\PROVEE3")[/b:2h1pibft]¿No es posible tener los índices separados y cambiar el índice activo con dbsetorder?Muchas gracias a todos. |
pasar de NTX a CDX | hasta donde recuerdo, si se puede, pero la última vez que lo hice fue hace como 12 años, cuando todavía no existía harbour |
pasar de NTX a CDX | [quote="MOISES":9yp3kb5j]Quique:
Sí, eso lo había leído. Pensé que había que hacer algo más.
En cuanto a los tags, entonces ¿no se puede seguir haciendo?
USE PROVEE
[b:9yp3kb5j] INDEX ON PROVEE->NOMBRE TO (pPath+"\PROVEE")
INDEX ON PROVEE->CODIGO TO (pPath+"\PROVEE2")
INDEX ON PROVEE->NIF TO (pPath+"\PROVEE3")[/b:9yp3kb5j]
¿No es posible tener los índices separados y cambiar el índice activo con dbsetorder?
Muchas gracias a todos.[/quote:9yp3kb5j]Si estoy en lo cierto si lo puedes hacer, pero la idea de los CDX creo es no tener tantos archivos .CDX, ya que puedes tener varios indices en un solo archivo, estos son mas rapido y mas pequeños los archivos, a menos que tengas una verdadera necesidad de tenerlos en forma individual. <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
pasar de NTX a CDX | Por supuesto que pueden usarse indices separados, aunque te aseguro que te será más practico tenerlos juntos.Se puede utilizar dbSetOrder tanto si los indices estan juntos como separados.Conclusion, basta con que regeneres los indices a formato CDX, y el resto de codigo que utilizabas hasta ahora con NTX, seguira funcionando. |
pasar de NTX a CDX | TE SIMPLIFICAS LA VIDA SI UTILIZAS UN SOLO INDICEY LA TRANSFORMACION ES MUY SENCILLA:DONDE USAS:USE PROVEE INDEX ON PROVEE->NOMBRE TO (pPath+"\PROVEE") INDEX ON PROVEE->CODIGO TO (pPath+"\PROVEE2") INDEX ON PROVEE->NIF TO (pPath+"\PROVEE3") LO CAMBIAS PORUSE PROVEEINDEX ON _FIELD->NOMBRE TAG PROVEE TO (pPath+"\PROVEE") INDEX ON _FIELD->CODIGO TAG PROVEE2 TO (pPath+"\PROVEE")INDEX ON _FIELD->NIF TAG PROVEE3 TO (pPath+"\PROVEE")Y LOS SET INDEX LOS CAMBIAS A SET ORDERDONDE DIGASET INDEX TO PROVEE,PROVEE2,PROVEE3SIMPLEMENTE ESCRIBESSET ORDER TO PROVEE OSET ORDER TO 1A MI PARTICULARMENTE PREFIERO UTILIZAR NOMBRES EN LOS TAG QUE INDIQUEN LA NATURALEZA DEL ORDER, DE FORMA QUE EL CODIGO SE AUTO-DOCUMENTA |
pasar de NTX a CDX | UN DETALLE, CON CDX,SI DESEAS RE-GENERAR LOS INDICES, TE RECOMIENDO BORRARLOS ANTES DE GENERAR Y EVITA EL RE-INDEXNO ES PORQUE TE VAYA A DAR PROBLEMAS, SINO PORQUE ES MÁS RÁPIDO EL PROCESO |
pasar el foco desde una ventana nomodal a otra nomodal | Gente:
no consigo pasar el foco a una ventana nomodal desde una ventana no modal, por mas que le pongo al segundo dialogo el SETFOCUS() en el Init no toma el foco
[code=fw:13n9y07t]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> Guia<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oBtn<br /> <span style="color: #00C800;">LOCAL</span> nKey<br /> <span style="color: #00C800;">LOCAL</span> aDatos := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BRW_GUIA"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Notas de Pedido"</span> <span style="color: #B900B9;">//FONT oFontS</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> cString <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">OF</span> oDlg <br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br /> COLUMNS <span style="color: #ff0000;">"if(codusu='00',' ', FACBOL)"</span>,<span style="color: #ff0000;">"dtoc(FECHA)"</span>,<span style="color: #ff0000;">"NUMERO"</span>,<span style="color: #ff0000;">"MCODI->NG"</span>,<span style="color: #ff0000;">"IIF(MONEDA=='S', 'S/.', 'US$')"</span>,;<br /> <span style="color: #ff0000;">"TOTBRUTO"</span>,<span style="color: #ff0000;">"TOTDSCTO"</span>,<span style="color: #ff0000;">"TOTSUB"</span>,<span style="color: #ff0000;">"TOTIGV"</span>,<span style="color: #ff0000;">"TOTAL"</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CABGUIA"</span>,<span style="color: #ff0000;">"MCODI"</span> ;<br /> FIELDSIZES <span style="color: #000000;">30</span>,<span style="color: #000000;">68</span>,<span style="color: #000000;">54</span>,<span style="color: #000000;">200</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">85</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">85</span> ;<br /> HEADERS ;<br /> <span style="color: #ff0000;">"F/B"</span> ;<br /> ,<span style="color: #ff0000;">"FECHA"</span> ;<br /> ,<span style="color: #ff0000;">"NUMERO"</span> ;<br /> ,<span style="color: #ff0000;">"CLIENTE"</span> ;<br /> ,<span style="color: #ff0000;">"MON."</span> ;<br /> ,<span style="color: #ff0000;">"T.BRUTO"</span> ;<br /> ,<span style="color: #ff0000;">"T.DSCTO"</span> ;<br /> ,<span style="color: #ff0000;">"SUBTOT"</span> ;<br /> ,<span style="color: #ff0000;">"IGV"</span> ;<br /> ,<span style="color: #ff0000;">"TOTAL"</span> ;<br /> PICTURES <span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"99/99/9999"</span>,<span style="color: #00C800;">nil</span>,<span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #ff0000;">'999,999.99'</span>,<span style="color: #ff0000;">'999,999.99'</span>,<span style="color: #ff0000;">'999,999.99'</span>,<span style="color: #ff0000;">'99,999,999.99'</span> ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4001</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> LINES CELL NOBORDER <span style="color: #0000ff;">UPDATE</span><br /><br /> oBrw:<span style="color: #000000;">aJustify</span> := <span style="color: #000000;">{</span>.F.,.T.,.F.,.F.,.F.,.T.,.T.,.T.,.T.,.T.<span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span> |nKey| ProcMtn<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">{</span> || ProcMtn<span style="color: #000000;">(</span> VK_RETURN <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> <br /> oBrw:<span style="color: #000000;">l2007</span> := .f.<br /> oBrw:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> CLR_HBLUE,RGB<span style="color: #000000;">(</span><span style="color: #000000;">232</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">232</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> <br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">ID</span> ID_NEW <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ProcMtn<span style="color: #000000;">(</span>VK_INSERT<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Ingresa un nuevo registro"</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">ID</span> ID_CHANGE <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ProcMtn<span style="color: #000000;">(</span>VK_RETURN<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ===> presiono boton y a va abrir el dialogo odlgdet<br /> oBtn:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Modifica el registro"</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">ID</span> ID_DEL <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ProcMtn<span style="color: #000000;">(</span>VK_DELETE<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Anula Nota de Pedido"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">ID</span> ID_CANCEL <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> CANCEL<br /> oBtn:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Sale de la ventana"</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NOWAIT</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span>oDlg:<span style="color: #0000ff;">MOVE</span><span style="color: #000000;">(</span><span style="color: #000000;">50</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>,oDlg:<span style="color: #000000;">bLostFocus</span> = <span style="color: #000000;">{</span> || oDlgDet:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> ==>blostfocus lo utilizo para que el foco se quede en el dialogo oDlgDet pero no se activa el foco en ese dialogo<br /> <br />....<br />....<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ProcMtn<span style="color: #000000;">(</span>nKey<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nRecAnt<br /> *- Evalua<br /> <span style="color: #00C800;">IF</span> nKey>=<span style="color: #000000;">96</span> .AND. nKey<=<span style="color: #000000;">105</span><br /> nKey:=nKey<span style="color: #000000;">-48</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> nKey == VK_RETURN<br /> oDlg:<span style="color: #000000;">bLostFocus</span> = <span style="color: #000000;">{</span> || oDlgDet:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ==>le anticipo al primer <span style="color: #0000ff;">dialog</span> nomodal que se va quedar el foco en el dialogo odlgdet pero no lo hace<br /> oBrw:<span style="color: #000000;">bLostFocus</span> = <span style="color: #000000;">{</span> || oDlgDet:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ==>le anticipo al primer <span style="color: #0000ff;">dialog</span> nomodal que se va quedar el foco en el dialogo odlgdet pero no lo hace <br /> NuevoDet<span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span><br /> ....<br /> ....<br /> Encase<br />....<br />...<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> Nuevodet<span style="color: #000000;">(</span>lmodo<span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgDet <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"DLG_CABGuia"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Nota de Pedido"</span> <span style="color: #0000ff;">FONT</span> oFontS ==>llamo a esta dialogo lo abre pero el foco se queda en la ventana que lo invoco<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> dFecha <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlgDet <span style="color: #0000ff;">UPDATE</span> ; <br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span>iif<span style="color: #000000;">(</span>codusu=<span style="color: #ff0000;">"01"</span> .or. codusu=<span style="color: #ff0000;">"02"</span> .or. codusu=<span style="color: #ff0000;">"03"</span> .or. codusu=<span style="color: #ff0000;">"04"</span>, oDlgDet:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">oJump</span>:=oDlgDet:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>,<span style="color: #000000;">)</span>,.T.<span style="color: #000000;">)</span> <br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cNumero <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">OF</span> oDlgDet <span style="color: #0000ff;">UPDATE</span> ; <br /> <span style="color: #0000ff;">VALID</span><span style="color: #000000;">(</span> cNumero:=StrZero<span style="color: #000000;">(</span>val<span style="color: #000000;">(</span>cNumero<span style="color: #000000;">)</span>,<span style="color: #000000;">6</span><span style="color: #000000;">)</span>, oDlgDet:<span style="color: #0000ff;">update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .t.<span style="color: #000000;">)</span><br /> ....<br /> ....<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgDet <span style="color: #0000ff;">NOWAIT</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">init</span> <span style="color: #000000;">(</span>oDlgDet:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrwDet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">valid</span> <span style="color: #000000;">(</span>detguiat-><span style="color: #000000;">(</span>DBCloseArea<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,.t.<span style="color: #000000;">)</span><br /> <br /> cabguia-><span style="color: #000000;">(</span>DBSetOrder<span style="color: #000000;">(</span><span style="color: #000000;">4</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span><br /> </div>[/code:13n9y07t]
Gracias |
pasar el foco desde una ventana nomodal a otra nomodal | La claúsula ACTIVATE DIALOG ... ON INIT debe devolver una expresión lógica .F. para poder cambiar el foco
Por ejemplo:
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oGet:SetFocus(), .F. ) |
pasar el foco desde una ventana nomodal a otra nomodal | Gracias Maestro Antonio!
Funciono perfecto |
pasar numero entero a binario | Necesito una funcion para pasar un número entero a binario de 7 bits.Ejemplo:nEntrada=10cSalida:=functionconversora(nEntrada)cSalida debe contener la cadena: '0001010'Saludos. |
pasar numero entero a binario | A ver... L2BIN(nValor) Convierte un valor numérico de CA-Clipper en un valor entero binario de 32 bits ────────────────────────────────────── Sintaxis L2BIN(<nExp>) --> cEnteroBinario Argumentos <nExp>es el valor numérico que se va a convertir. Los números decimales se truncan. Devuelve L2BIN() devuelve una cadena de caracteres de 4 bytes formateada como un entero binario de 32 bits. Descripción L2BIN() es una función de bajo nivel que se utiliza con FWRITE() para escribir valores numéricos de CA-Clipper en un fichero binario. Esta función es similar a I2BIN(), que formatea un valor numérico de CA-Clipper en un valor binario de 16 bits. L2BIN() es la función inversa de BIN2L(). Espero te sirva...Salu2 |
pasar numero entero a binario | Ando buscando lo mismo. pudiste resolverlo? [quote="Verhoven":bv6kvv2n]Necesito una funcion para pasar un número entero a binario de 7 bits.
Ejemplo:
nEntrada=10
cSalida:=functionconversora(nEntrada)
cSalida debe contener la cadena: '0001010'
Saludos.[/quote:bv6kvv2n] |
pasar numero entero a binario | [code:vc5dbill]
#include "FiveWin.ch"
function Main()
MsgInfo( NumToBinary( 10 ) )
return nil
function NumToBinary( n )
local cNum := ""
while n > 0
cNum += If( lAnd( n, 1 ), "1", "0" )
n = Int( n / 2 )
end
return cNum
[/code:vc5dbill] |
pasar numero entero a binario | perfecto.[quote="Antonio Linares":38ohh51d][code:38ohh51d]
#include "FiveWin.ch"
function Main()
MsgInfo( NumToBinary( 10 ) )
return nil
function NumToBinary( n )
local cNum := ""
while n > 0
cNum += If( lAnd( n, 1 ), "1", "0" )
n = Int( n / 2 )
end
return cNum
[/code:38ohh51d][/quote:38ohh51d] |
pasar parametro a rpreview | Quisiera pasar como parámetro a rpreview.prg el email del cliente. Tengo fwh 1509
¿Alguien sabe podría echarme una mano?
Muchas Gracias |
pasar parametro a rpreview | Garbi:
Una forma sencilla es que crees una variable de memoria:
En el PRG que envía la dirección de correo
[code=fw:1ivlu6ae]<div class="fw" id="{CB}" style="font-family: monospace;"><br />MEMVAR cMail<br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />......<br />......<br /><br />cMail := <span style="color: #ff0000;">"Ladirección.mx"</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> </div>[/code:1ivlu6ae]
Y en el RPreview.Prg
[code=fw:1ivlu6ae]<div class="fw" id="{CB}" style="font-family: monospace;"><br />MEMVAR cMail<br /><span style="color: #00C800;">FUNCTION</span> RPreview<span style="color: #000000;">(</span> oDevice <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>cMail<span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>.T:<span style="color: #000000;">)</span><br /> </div>[/code:1ivlu6ae]
Saludos |
pasar parametro a rpreview | Gracias.
En vez de memvar he usado variables publicas y ha funcionado perfectamente.
Ay la vejez, mira que parezco novato.
Muchas Gracias. |
pasar parametro a rpreview | Garbi
<!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> , así pasa cuando sucede <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Saludos |
passing a function several times? | I am using a function in my program to pass a filename variable to a field, but i need to pass it to several fields. I know I could repeat the function for each variable but I also know that I can change where the variable is placed.
Here is the code ;
STATIC FUNCTION FileName
LOCAL cDir := ALLTRIM(CURDIR())
LOCAL cApp := ""
cApp := cGetFile( "*.rpt","Report Files",1,cDir)
IF cApp == "*.rpt"
cApp := "default"
ELSE
IF "\"$cApp
cApp := ALLTRIM(subst(cApp , rat("\",cApp)+1,12))
cApp := LEFT(cApp, LEN(cApp) - 4)
ENDIF
ENDIF
IF !Empty(cApp)
mReportID := Alltrim(cApp)+".rpt"
oReportID:Refresh()
ENDIF
RETURN NIL
What I need to know is, how can I tell my program to change where the outcome is stored without rewriting it for each variable? |
passing a function several times? | [quote:10jggoxt]What I need to know is, how can I tell my program to change where the outcome is stored without rewriting it for each variable?[/quote:10jggoxt]
Sorry I have not understood exactly what do you want.
Maybe the code below can give you some ideas?
STATIC cApp := ""
STATIC FUNCTION SetRptName()
/*
the body of the function almost the same as the body of your function FileName()
*/
...
RETURN ( NIL )
STATIC FUNCTION GetRptName()
RETURN ( cApp ) |
passing a function several times? | maybe this will explain my question better?
CODE ;
STATIC FUNCTION FileName
LOCAL cDir := ALLTRIM(CURDIR())
LOCAL cApp := ""
cApp := cGetFile( "*.rpt","Report Files",1,cDir)
IF cApp == "*.rpt"
cApp := "default"
ELSE
IF "\"$cApp
cApp := ALLTRIM(subst(cApp , rat("\",cApp)+1,12))
cApp := LEFT(cApp, LEN(cApp) - 4)
ENDIF
ENDIF
IF !Empty(cApp)
mReportID := Alltrim(cApp)+".rpt"
oReportID:Refresh()
ENDIF
IF !Empty(cApp)
mFileProof := Alltrim(cApp)+".rpt"
oFileProof:Refresh()
ENDIF
IF !Empty(cApp)
mFinalFile := Alltrim(cApp)+".rpt"
oFinalFile:Refresh()
ENDIF
IF !Empty(cApp)
mReprint := Alltrim(cApp)+".rpt"
oReprint:Refresh()
ENDIF
RETURN NIL
the problem is, they all refresh with the same value, and I want each o:refresh to be able to hold a seperate value?
thanks for any help! |
passing a function several times? | They refresh with the same value because you are assigning to all of them the same value. Try assigning different values and you will get different values.
EMG |
passing a function several times? | So, should I have a different LOCAL cApp for each refresh? |
passing a function several times? | Yes. Or anyelse assign different values to the different objects.
EMG |
passing a function several times? | Many Thanks Enrico. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
passing a function several times? | I think you should rewrite your function such a way that it returns not NIL but cApp. In your main code you will have the following
LOCAL cApp
.....
IF ( !EMPTY( cApp := FileName() ) )
mReportID := Alltrim(cApp)+".rpt"
oReportID:Refresh()
ENDIF
.....
Or you can write general function as for example AssignVal()
FUNCTION AssignVal( &cVarName, oObject )
and call it for various arguments as below
AssignVal( &mReportID, oReportID )
AssignVal( &mFileProof, oFileProof )
and so on. |
passing parameters between 2 exe | Hello
How can we pass a parameter between 2 exe and how the second will retreive it ?
i know shellexecute(....) can pass parameter
in program1.exe shellexecute(,"open""program2.exe",param)
is there another way to do it and how to retreive the param in program2
Thanks for help,
Richard |
passing parameters between 2 exe | You can use a file to pass and receive parameters.
EMG |
passing parameters between 2 exe | [quote="Richard Chidiak":7m8vvpdk]how to retreive the param in program2[/quote:7m8vvpdk]
[code=fw:7m8vvpdk]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span> cParam1, cParam2, etc. <span style="color: #000000;">)</span></div>[/code:7m8vvpdk]
EMG |
passing parameters between 2 exe | Exactly what i am looking for
Thank you Enrico
Richard |
passing parameters between 2 exe | According to the Windows API this is the way to do it (of course other systems work fine as well). This way is to send data to an already running app:
[url:3pd7q2uw]http://msdn.microsoft.com/en-us/library/windows/desktop/ms649011(v=vs.85).aspx[/url:3pd7q2uw]
A working example:
[url:3pd7q2uw]http://msdn.microsoft.com/en-us/library/windows/desktop/ms649009(v=vs.85).aspx[/url:3pd7q2uw] |
passing parameters between 2 exe | Hi Antonio.
For those who do not know C + +
It is possible to have an example of this code to operate in xHarbour and Harbour?
regards |
passing parameters between 2 exe | Here are two sample programs.
wndsend.prg
wndget.prg
[code=fw:b18tn6sy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// wndsend.prg</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oBar, oBrw<br /><br /> USE CUSTOMER <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SendWnd"</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">32</span> <span style="color: #000000;">2007</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SendMsg"</span> <span style="color: #0000ff;">ACTION</span> SendData<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CUSTOMER"</span> ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES NOBORDER<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> CLOSE <span style="color: #00C800;">DATA</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SendData<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> hDstWnd := FindWindow<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TCDWnd"</span>, <span style="color: #ff0000;">"GetWnd"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> hDstWnd <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"window not found"</span><br /> <span style="color: #00C800;">else</span><br /> SendDataToApp<span style="color: #000000;">(</span> hDstWnd, <span style="color: #000000;">1</span>, ;<br /> FW_ValToExp<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> CUSTOMER->FIRST, CUSTOMER->LAST, CUSTOMER->CITY <span style="color: #000000;">}</span> <span style="color: #000000;">)</span>, ;<br /> WndMain<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">HB_FUNC</span> <span style="color: #000000;">(</span>SENDDATATOAPP<span style="color: #000000;">)</span> <span style="color: #B900B9;">// ( hDestWnd, nMsgID, cData, hFromWnd )</span><br /><span style="color: #000000;">{</span><br /> COPYDATASTRUCT cds;<br /><br /> cds.dwData = hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> cds.cbData = hb_parclen<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>;<br /> cds.lpData = <span style="color: #000000;">(</span>PVOID<span style="color: #000000;">)</span> hb_parcx<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>;<br /><br /> SendMessage<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>HWND<span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, WM_COPYDATA, <span style="color: #000000;">(</span>WPARAM<span style="color: #000000;">)</span> <span style="color: #000000;">(</span>HWND<span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>LPARAM<span style="color: #000000;">)</span> <span style="color: #000000;">(</span>LPVOID<span style="color: #000000;">)</span> &cds <span style="color: #000000;">)</span>;<br /> hb_ret<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">HB_FUNC</span> <span style="color: #000000;">(</span>PARSECOPYDATA<span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> PCOPYDATASTRUCT pCDS;<br /><br /> pCDS = <span style="color: #000000;">(</span>PCOPYDATASTRUCT<span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> hb_stornl<span style="color: #000000;">(</span> pCDS->dwData, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> hb_retclen<span style="color: #000000;">(</span> pCDS->lpData, pCDS->cbData <span style="color: #000000;">)</span>;<br /><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /><span style="color: #B900B9;">//============================================================================//</span><br /> </div>[/code:b18tn6sy]
wndget.prg:
[code=fw:b18tn6sy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// wndget.prg</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oBar, oBrw<br /><br /> oWnd := TCDWnd<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"GetWnd"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">32</span> <span style="color: #000000;">2007</span><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">''</span><br /><br /> oWnd:<span style="color: #000000;">bOnGetData</span> := <span style="color: #000000;">{</span> |oWnd, oFrom, nID, cData| ;<br /> OnGetData<span style="color: #000000;">(</span> oWnd, oFrom, nID, cData, oBrw <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd DATASOURCE <span style="color: #000000;">{</span><span style="color: #000000;">}</span> ;<br /> COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> ;<br /> HEADERS <span style="color: #ff0000;">"First"</span>, <span style="color: #ff0000;">"Last"</span>, <span style="color: #ff0000;">"City"</span> ;<br /> COLSIZES <span style="color: #000000;">80</span>, <span style="color: #000000;">80</span>, <span style="color: #000000;">80</span> ;<br /> CELL LINES NOBORDER<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> CLOSE <span style="color: #00C800;">DATA</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OnGetData<span style="color: #000000;">(</span> oWnd, oFrom, nMsgID, cData, oBrw <span style="color: #000000;">)</span><br /><br /> AAdd<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">aArrayData</span>, &cData <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">//============================================================================//</span><br /><br /><span style="color: #00D7D7;">#define</span> WM_COPYDATA 0x004A<br /><br /><span style="color: #00C800;">CLASS</span> TCDWnd <span style="color: #0000ff;">FROM</span> TWindow <span style="color: #00C800;">STATIC</span><br /><br /> <span style="color: #00C800;">DATA</span> bOnGetData<br /><br /> CLASSDATA lRegistered AS LOGICAL<br /><br /> <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TCDWnd<br /><br /> <span style="color: #00C800;">local</span> nDataID := <span style="color: #000000;">0</span>, cData<br /><br /> <span style="color: #00C800;">if</span> nMsg == WM_COPYDATA<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bOnGetData</span> != <span style="color: #00C800;">nil</span><br /> cData := ParseCopyData<span style="color: #000000;">(</span> nLParam, @nDataID <span style="color: #000000;">)</span><br /> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnGetData</span>, <span style="color: #00C800;">Self</span>, nWParam, nDataID, cData <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">HandleEvent</span><span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">HB_FUNC</span> <span style="color: #000000;">(</span>SENDDATATOAPP<span style="color: #000000;">)</span> <span style="color: #B900B9;">// ( hDestWnd, nMsgID, cData, hFromWnd )</span><br /><span style="color: #000000;">{</span><br /> COPYDATASTRUCT cds;<br /><br /> cds.dwData = hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> cds.cbData = hb_parclen<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>;<br /> cds.lpData = <span style="color: #000000;">(</span>PVOID<span style="color: #000000;">)</span> hb_parcx<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>;<br /><br /> SendMessage<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>HWND<span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, WM_COPYDATA, <span style="color: #000000;">(</span>WPARAM<span style="color: #000000;">)</span> <span style="color: #000000;">(</span>HWND<span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>LPARAM<span style="color: #000000;">)</span> <span style="color: #000000;">(</span>LPVOID<span style="color: #000000;">)</span> &cds <span style="color: #000000;">)</span>;<br /> hb_ret<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">HB_FUNC</span> <span style="color: #000000;">(</span>PARSECOPYDATA<span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> PCOPYDATASTRUCT pCDS;<br /><br /> pCDS = <span style="color: #000000;">(</span>PCOPYDATASTRUCT<span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> hb_stornl<span style="color: #000000;">(</span> pCDS->dwData, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> hb_retclen<span style="color: #000000;">(</span> pCDS->lpData, pCDS->cbData <span style="color: #000000;">)</span>;<br /><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /><span style="color: #B900B9;">//============================================================================//</span><br /> </div>[/code:b18tn6sy]
Independently compile and build the two exes wndsend.exe and wndget.exe, either in Harbour or xHarbour.
wndsend.prg opens and shows browse of customer.dbf in fwh\samples folder. You may need the exe files located in fwh\samples folder or have the customer.dbf in the same folder where the wndsend.exe resides.
Launch both programs and move the windows so that you can see both windows without overlapping each other.
wndget.exe shows browse of an empty array with three columns.
wndsend.exe shows browse of customer.dbf. Move to any row of the browse and click "SendMsg" button on the buttonbar.
Now this program sends an array of CUSTOMER->FIRST, CUSTOMER->LAST, CUSTOMER-CITY to WndGet.Exe through WM_COPYDATA message.
WndGet.exe responds to WM_COPYDATA message and retrieves the data, appends to the array and displays the data in the browse.
Keep moving to different rows in the customer browse of WndSend.Exe and press "SendMsg" button. The information of the row is received by WndGet.Exe and shown in its array browse.
Notes:
I have used SendMessage() function to send the messages. Those who are aware the difference between SendMessage() and PostMessage() may be tempted to use PostMessage(), but that does not work here.
The disadvantage of SendMessage() is that the sending program waits till the responding application completes processing the message ( or ignores ). In the case of our example, till the HandleEvent method returns 0.
Therefore the responding program should retrieve and store the message and signal handling of the event fast. |
passing parameters between 2 exe | Mr Rao
Thanks for such a detailed explanation
Regards |
passing parameters between 2 exe | Hello nages
Thanks for the example
I'll try
Thanks again |
password | anybody has sample with using password window. |
password | Friend,
See SAMPLES\TESTPASS.PRG |
password en tabla access | He podido grabar registros enuna tabla access pero ahora mi cliente me pide que la encripte grabando un password. alguien sabe como hacerlo
Estoy usando fwh 2.07 y xharbour
Gracias por la ayuda |
password en tabla access | Hola
Para grabar una pasword encriptado en una DBF, yo pongo lo sig:
Usuarios->Password := Encrypt( cPassword, "Clave" )
Espero y te sirva.
Saludos
Marco A. Delgado. |
password in access files | Does somebody knows how to put a password in this file type via fivewin and xharbour?
I can open read write and close the access table but i don't know how put a password to encrypt it
Thank for any help |
password in access files | [code:qdxup07v]FUNCTION MAIN()
LOCAL oJro := CREATEOBJECT( "JRO.JetEngine" )
LOCAL cConStr1 := "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=mymdb.mdb"
LOCAL cConStr2 := "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=newmdb.mdb;Jet OLEDB:Database Password=newpwd"
oJro:CompactDatabase( cConStr1, cConStr2 )
RETURN NIL[/code:qdxup07v]
EMG |
password in access files | sorry but I tried your solution and I have an ole error in compacdatabase instruction called by tole the name of the error is "error jro.jetengine/16389 sure I'm making something wrong |
password in access files | I don't know. My sample works fine here.
EMG |
password manager with mod harbour | Hello friends,
I have a utility to encrypt the original passwords.
For now, I have to manually copy the encrypted value and the IV into the database.
For internal use, this is entirely sufficient.
Perhaps someone is interested and we could further develop this project.
Encrypt original key with master password
Please enter your master password below to check its length, and enter the password you want to encrypt with the key.
Best regards,
Otto
[img:1c62m951]https://mybergland.com/fwforum/encryptclip4.jpg[/img:1c62m951]
[code=fw:1c62m951]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><!DOCTYPE html><br /><html><br /><head><br /> <meta charset=<span style="color: #ff0000;">"UTF-8"</span>><br /> <title>Key Length Checker</title><br /> <!-- Bootstrap <span style="color: #000000;">5</span> CSS --><br /> <link rel=<span style="color: #ff0000;">"stylesheet"</span> href=<span style="color: #ff0000;">"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"</span>><br /></head><br /><body><br /> <div <span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"container mt-5"</span>><br /> <h1>Encrypt original key with master password</h1><br /> <p>Please enter your master password below <span style="color: #0000ff;">to</span> check its length</p><br /> <input type=<span style="color: #ff0000;">"text"</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"keyInput"</span> placeholder=<span style="color: #ff0000;">"Enter your encryption key"</span> oninput=<span style="color: #ff0000;">"checkKeyLength()"</span>><br /> <p <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"keyLengthDisplay"</span>></p><br /> <button onclick=<span style="color: #ff0000;">"checkKeyLength()"</span>>Check Length</button><br /> <p <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"result"</span>></p><br /> <br /> <p>Next, enter the password you want <span style="color: #0000ff;">to</span> encrypt with the key</p><br /> <input type=<span style="color: #ff0000;">"text"</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"pwInput"</span> placeholder=<span style="color: #ff0000;">"Enter your password"</span>><br /> <button onclick=<span style="color: #ff0000;">"performEncryption()"</span>>Encrypt</button><br /> </div><br /> <br /> <!-- Bootstrap <span style="color: #000000;">5</span> JS and jQuery --><br /> <script src=<span style="color: #ff0000;">"https://code.jquery.com/jquery-3.6.0.min.js"</span>></script><br /> <script src=<span style="color: #ff0000;">"https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"</span>></script><br /> <br /> <script><br /> <span style="color: #00C800;">function</span> checkKeyLength<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> const keyInput = document.getElementById<span style="color: #000000;">(</span><span style="color: #ff0000;">'keyInput'</span><span style="color: #000000;">)</span>;<br /> <br /> const key = keyInput.value.trim<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /> const keyLength = key.length * <span style="color: #000000;">8</span>;<br /> <br /> let resultMessage;<br /> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>keyLength === <span style="color: #000000;">128</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> resultMessage = `The key length is <span style="color: #000000;">128</span> bits.`;<br /> <span style="color: #000000;">}</span> <span style="color: #00C800;">else</span> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>keyLength === <span style="color: #000000;">256</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> resultMessage = `The key length is <span style="color: #000000;">256</span> bits.`;<br /> <span style="color: #000000;">}</span> <span style="color: #00C800;">else</span> <span style="color: #000000;">{</span><br /> resultMessage = `The key length should be either <span style="color: #000000;">128</span> bits or <span style="color: #000000;">256</span> bits. <span style="color: #000000;">(</span>Current length: $<span style="color: #000000;">{</span>keyLength<span style="color: #000000;">}</span> bits<span style="color: #000000;">)</span>`;<br /> <span style="color: #000000;">}</span><br /> <br /> document.getElementById<span style="color: #000000;">(</span><span style="color: #ff0000;">'result'</span><span style="color: #000000;">)</span>.textContent = resultMessage;<br /> document.getElementById<span style="color: #000000;">(</span><span style="color: #ff0000;">'keyLengthDisplay'</span><span style="color: #000000;">)</span>.textContent = `Current key length: $<span style="color: #000000;">{</span>keyLength<span style="color: #000000;">}</span> bits`;<br /> <span style="color: #000000;">}</span><br /> <br /> <span style="color: #B900B9;">// Funktion zur Verschlüsselung des Passworts mit AES</span><br /> async <span style="color: #00C800;">function</span> encryptPassword<span style="color: #000000;">(</span>password, encryptionKey<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">try</span> <span style="color: #000000;">{</span><br /> const encodedKey = await crypto.subtle.importKey<span style="color: #000000;">(</span><span style="color: #ff0000;">'raw'</span>, encryptionKey, <span style="color: #000000;">{</span> <span style="color: #0000ff;">name</span>: <span style="color: #ff0000;">'AES-GCM'</span> <span style="color: #000000;">}</span>, <span style="color: #00C800;">false</span>, <span style="color: #000000;">[</span><span style="color: #ff0000;">'encrypt'</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>;<br /> const encodedData = <span style="color: #00C800;">new</span> TextEncoder<span style="color: #000000;">(</span><span style="color: #000000;">)</span>.encode<span style="color: #000000;">(</span>password<span style="color: #000000;">)</span>;<br /> const iv = crypto.getRandomValues<span style="color: #000000;">(</span><span style="color: #00C800;">new</span> Uint8Array<span style="color: #000000;">(</span><span style="color: #000000;">12</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>;<br /> console.log<span style="color: #000000;">(</span> <span style="color: #ff0000;">"iv"</span>, arrayBufferToHexString<span style="color: #000000;">(</span>iv<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> const encryptedData = await crypto.subtle.encrypt<span style="color: #000000;">(</span><span style="color: #000000;">{</span> <span style="color: #0000ff;">name</span>: <span style="color: #ff0000;">'AES-GCM'</span>, iv <span style="color: #000000;">}</span>, encodedKey, encodedData<span style="color: #000000;">)</span>;<br /> const encryptedPassword = Array.<span style="color: #0000ff;">from</span><span style="color: #000000;">(</span><span style="color: #00C800;">new</span> Uint8Array<span style="color: #000000;">(</span>encryptedData<span style="color: #000000;">)</span><span style="color: #000000;">)</span>.map<span style="color: #000000;">(</span>byte => <span style="color: #000000;">(</span><span style="color: #ff0000;">'00'</span> + byte.toString<span style="color: #000000;">(</span><span style="color: #000000;">16</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>.slice<span style="color: #000000;">(</span><span style="color: #000000;">-2</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>.<span style="color: #0000ff;">join</span><span style="color: #000000;">(</span><span style="color: #ff0000;">''</span><span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">{</span> encryptedPassword, iv <span style="color: #000000;">}</span>;<br /> <span style="color: #000000;">}</span> catch <span style="color: #000000;">(</span>error<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> console.error<span style="color: #000000;">(</span><span style="color: #ff0000;">'Verschlüsselung fehlgeschlagen:'</span>, error<span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">null</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /> <br /> <span style="color: #B900B9;">// Funktion zur Entschlüsselung des Passworts mit AES</span><br /> async <span style="color: #00C800;">function</span> decryptPassword<span style="color: #000000;">(</span>encryptedPassword, encryptionKey, iv<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">try</span> <span style="color: #000000;">{</span><br /> const encodedPassword = Uint8Array.<span style="color: #0000ff;">from</span><span style="color: #000000;">(</span>Array.<span style="color: #0000ff;">from</span><span style="color: #000000;">(</span>encryptedPassword.<span style="color: #0000ff;">match</span><span style="color: #000000;">(</span>/.<span style="color: #000000;">{</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">}</span>/g<span style="color: #000000;">)</span>, byte => parseInt<span style="color: #000000;">(</span>byte, <span style="color: #000000;">16</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>;<br /> const encodedKey = await crypto.subtle.importKey<span style="color: #000000;">(</span><span style="color: #ff0000;">'raw'</span>, encryptionKey, <span style="color: #000000;">{</span> <span style="color: #0000ff;">name</span>: <span style="color: #ff0000;">'AES-GCM'</span> <span style="color: #000000;">}</span>, <span style="color: #00C800;">false</span>, <span style="color: #000000;">[</span><span style="color: #ff0000;">'decrypt'</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>;<br /> const decryptedData = await crypto.subtle.decrypt<span style="color: #000000;">(</span><span style="color: #000000;">{</span> <span style="color: #0000ff;">name</span>: <span style="color: #ff0000;">'AES-GCM'</span>, iv <span style="color: #000000;">}</span>, encodedKey, encodedPassword<span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">new</span> TextDecoder<span style="color: #000000;">(</span><span style="color: #000000;">)</span>.decode<span style="color: #000000;">(</span>decryptedData<span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span> catch <span style="color: #000000;">(</span>error<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> console.error<span style="color: #000000;">(</span><span style="color: #ff0000;">'Entschlüsselung fehlgeschlagen:'</span>, error<span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">null</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /> <br /> <span style="color: #B900B9;">// Helper function to convert ArrayBuffer to hex string</span><br /> <span style="color: #00C800;">function</span> arrayBufferToHexString<span style="color: #000000;">(</span>buffer<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> Array.<span style="color: #0000ff;">from</span><span style="color: #000000;">(</span><span style="color: #00C800;">new</span> Uint8Array<span style="color: #000000;">(</span>buffer<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> .map<span style="color: #000000;">(</span>byte => <span style="color: #000000;">(</span><span style="color: #ff0000;">'00'</span> + byte.toString<span style="color: #000000;">(</span><span style="color: #000000;">16</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>.slice<span style="color: #000000;">(</span><span style="color: #000000;">-2</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> .<span style="color: #0000ff;">join</span><span style="color: #000000;">(</span><span style="color: #ff0000;">''</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <br /> <br /> <span style="color: #B900B9;">// Funktion zum Aufrufen der Verschlüsselungsfunktion</span><br /> <span style="color: #00C800;">function</span> performEncryption<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> const originalPassword = document.getElementById<span style="color: #000000;">(</span><span style="color: #ff0000;">'pwInput'</span><span style="color: #000000;">)</span>.value;<br /> const encryptionKey = <span style="color: #00C800;">new</span> TextEncoder<span style="color: #000000;">(</span><span style="color: #000000;">)</span>.encode<span style="color: #000000;">(</span><span style="color: #ff0000;">'AtSw992025451855'</span><span style="color: #000000;">)</span>; <span style="color: #B900B9;">// Dummy-Verschlüsselungsschlüssel!</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'originalPassword'</span>, originalPassword <span style="color: #000000;">)</span>;<br /> <br /> const mysecretkey = document.getElementById<span style="color: #000000;">(</span><span style="color: #ff0000;">'keyInput'</span><span style="color: #000000;">)</span>.value;<br /> console.log<span style="color: #000000;">(</span> <span style="color: #ff0000;">'my_secret key'</span>, mysecretkey <span style="color: #000000;">)</span><br /> <br /> <span style="color: #B900B9;">// Passwort verschlüsseln</span><br /> encryptPassword<span style="color: #000000;">(</span>originalPassword, encryptionKey<span style="color: #000000;">)</span><br /> .then<span style="color: #000000;">(</span><span style="color: #000000;">(</span><span style="color: #000000;">{</span> encryptedPassword, iv <span style="color: #000000;">}</span><span style="color: #000000;">)</span> => <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>encryptedPassword !== <span style="color: #00C800;">null</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'Verschlüsseltes Passwort:'</span>, encryptedPassword<span style="color: #000000;">)</span>;<br /> <br /> <span style="color: #B900B9;">// Passwort entschlüsseln (Beispiel)</span><br /> decryptPassword<span style="color: #000000;">(</span>encryptedPassword, encryptionKey, iv<span style="color: #000000;">)</span><br /> .then<span style="color: #000000;">(</span>decryptedPassword => <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>decryptedPassword !== <span style="color: #00C800;">null</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'Entschlüsseltes Passwort:'</span>, decryptedPassword<span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span> <span style="color: #00C800;">else</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'Fehler bei der Entschlüsselung.'</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span> <span style="color: #00C800;">else</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'Fehler bei der Verschlüsselung.'</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> </script><br /></body><br /></html><br /><br /> </div>[/code:1c62m951] |
password manager with mod harbour | Hello friends,
I am working on a password manager for managing personal passwords using just one master password.
Using a password manager increases security and reduces the risk of password theft.
The program utilizes the Web Crypto API to encrypt and decrypt passwords with AES-GCM.
Passwords are extracted from a dBase file (DBF).
The encrypted passwords are encrypted using an encryption key and an initialization vector (IV) as parameters.
In the DBF file, the encrypted password and the initialization vector are stored.
Both values are retrieved from the DBF file using an AJAX request. Decryption takes place on the client-side in the web browser.
The encryption key is not stored; it is the master password and must always be entered by the user.
However, it is essential to choose a secure master password for the password manager itself, as it grants access to all stored passwords.
Passwords can be categorized based on the contexts in which they may be used.
Here are some examples of password categories that you could use for personal, social, and business purposes:
Personal Passwords:
1. Personal email address
2. Social media (e.g., Facebook, Twitter, Instagram)
3. Online shopping (e.g., Amazon, eBay)
4. Entertainment sites (e.g., Netflix, YouTube)
5. Personal Wi-Fi network
Social Passwords:
1. Forums and discussion groups (e.g., Reddit, Stack Overflow)
2. Online games (e.g., Steam, PlayStation Network)
3. Chat apps (e.g., WhatsApp, Discord)
Business Passwords:
1. Business email address
2. Company network
3. Business software or tools
4. Work-related cloud services (e.g., Google Workspace, Microsoft 365)
5. Business social media or websites
Other categories could include:
1. Banking and financial accounts
2. Healthcare and medical services
3. Educational institutions (e.g., university accounts)
4. Government or agency access
Best regards,
Otto
[code=fw:2a0muudd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />$<span style="color: #000000;">(</span>document<span style="color: #000000;">)</span>.ready<span style="color: #000000;">(</span><span style="color: #00C800;">function</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> passwordBtn.<span style="color: #0000ff;">on</span><span style="color: #000000;">(</span><span style="color: #ff0000;">'click'</span>, <span style="color: #00C800;">function</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <span style="color: #0000ff;">var</span> putData = <span style="color: #000000;">{</span><span style="color: #000000;">}</span>;<br /> putData<span style="color: #000000;">[</span><span style="color: #ff0000;">"request"</span><span style="color: #000000;">]</span> = <span style="color: #ff0000;">"edit"</span>;<br /> <br /> <span style="color: #0000ff;">var</span> row = getSelections<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span>; <br /> <span style="color: #0000ff;">var</span> <span style="color: #0000ff;">id</span> = row.<span style="color: #0000ff;">id</span>; <br /> <span style="color: #0000ff;">var</span> cIdx = <span style="color: #0000ff;">id</span>.toString<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /> putData<span style="color: #000000;">[</span><span style="color: #ff0000;">"id"</span><span style="color: #000000;">]</span> = cIdx;<br /> <br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">"putData:"</span>, putData<span style="color: #000000;">)</span>; <span style="color: #B900B9;">// Konsolenausgabe zum Testen</span><br /> <br /> $.ajax<span style="color: #000000;">(</span><span style="color: #000000;">{</span><br /> url: <span style="color: #ff0000;">"./getRecord.prg"</span>,<br /> type: <span style="color: #ff0000;">"PUT"</span>,<br /> dataType: <span style="color: #ff0000;">"json"</span>,<br /> <span style="color: #00C800;">data</span>: <span style="color: #000000;">JSON</span>.stringify<span style="color: #000000;">(</span>putData<span style="color: #000000;">)</span>,<br /> success: <span style="color: #00C800;">function</span><span style="color: #000000;">(</span><span style="color: #00C800;">data</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">"Response:"</span>, <span style="color: #00C800;">data</span><span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">var</span> obj = <span style="color: #00C800;">data</span>.array<span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span>;<br /> encryptedPassword = obj.link;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>encryptedPassword !== <span style="color: #00C800;">null</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'Verschlüsseltes Passwort:aus dem DBF file'</span>, encryptedPassword<span style="color: #000000;">)</span>;<br /> <span style="color: #B900B9;">// const iv = "8fbc9ec521b300fe9d845987";</span><br /> <span style="color: #B900B9;">// Convert the hexadecimal string 'iv' to a Uint8Array</span><br /> const ivHexString = <span style="color: #ff0000;">"8fbc9ec521b300fe9d845987"</span>;<br /> const iv = <span style="color: #00C800;">new</span> Uint8Array<span style="color: #000000;">(</span>ivHexString.<span style="color: #0000ff;">match</span><span style="color: #000000;">(</span>/.<span style="color: #000000;">{</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">}</span>/g<span style="color: #000000;">)</span>.map<span style="color: #000000;">(</span>byte => parseInt<span style="color: #000000;">(</span>byte, <span style="color: #000000;">16</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>;<br /> const encryptionKey = <span style="color: #00C800;">new</span> TextEncoder<span style="color: #000000;">(</span><span style="color: #000000;">)</span>.encode<span style="color: #000000;">(</span><span style="color: #ff0000;">'dummy_key_123456'</span><span style="color: #000000;">)</span>; <span style="color: #B900B9;">// Dummy-Verschlüsselungsschlüssel!</span><br /> <span style="color: #B900B9;">// Passwort entschlüsseln</span><br /> decryptPassword<span style="color: #000000;">(</span>encryptedPassword, encryptionKey, iv<span style="color: #000000;">)</span><br /> .then<span style="color: #000000;">(</span>decryptedPassword => <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>decryptedPassword !== <span style="color: #00C800;">null</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'Entschlüsseltes Passwort:'</span>, decryptedPassword<span style="color: #000000;">)</span>;<br /> alert<span style="color: #000000;">(</span> decryptedPassword <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span> <span style="color: #00C800;">else</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'Fehler bei der Entschlüsselung.'</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span> <span style="color: #00C800;">else</span> <span style="color: #000000;">{</span><br /> console.log<span style="color: #000000;">(</span><span style="color: #ff0000;">'Fehler bei der Verschlüsselung.'</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span>,<br /> error: <span style="color: #00C800;">function</span><span style="color: #000000;">(</span>jqXHR, textStatus, errorThrown<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> console.error<span style="color: #000000;">(</span><span style="color: #ff0000;">"AJAX-Fehler:"</span>, textStatus, errorThrown<span style="color: #000000;">)</span>;<br /> alert<span style="color: #000000;">(</span><span style="color: #ff0000;">"Fehler beim Lesen"</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><span style="color: #000000;">)</span>;<br /><br /><br /><br /> </div>[/code:2a0muudd]
[img:2a0muudd]https://mybergland.com/fwforum/lockbox.jpg[/img:2a0muudd] |
password manager with mod harbour | The Recipe:
A clear structure and a handful of small modules.
[img:nwehdpd4]https://mybergland.com/fwforum/lockboxharburinoclip5.jpg[/img:nwehdpd4]
[img:nwehdpd4]https://mybergland.com/fwforum/lockboxfiles.jpg[/img:nwehdpd4]
[img:nwehdpd4]https://mybergland.com/fwforum/lockbox.gif[/img:nwehdpd4] |
password manager with mod harbour | I have decided to create an administrator mode for the LockBox as well. It simply adds more convenience.
[img:205kinas]https://mybergland.com/fwforum/lockboxadmin.gif[/img:205kinas] |
password manager with mod harbour | If you have already developed a few blocks and functions, it is very easy to create and expand new programs. Now, I am implementing the login functionality.
[img:2s8ndh6g]https://mybergland.com/fwforum/lockboxadmin.gif[/img:2s8ndh6g] |
paste to getfield | Some of my customers complain about that if they paste a long text to a getfield that only a part of the original text is shown.
I tried to test this with an original FIVEWIN program with the same result.
If I insert than mark the get and insert again the whole text is taken.
testfoc.prg
[img:1n6cis6r]http://www.atzwanger-software.com/fw/clip3get.jpg[/img:1n6cis6r] |
paste to getfield | Open testfoc.rc with BRW, double click on a GET and click on Automatic scroll Horizontal.
EMG |
paste to getfield | Enrico,
would you be please so kind to post the working rc-file.
Thanks in advance
Otto |
paste to getfield | [quote="Otto":3ducri3n]would you be please so kind to post the working rc-file.[/quote:3ducri3n]Hi Otto:
Here you are a working TestFoc.rc[code:3ducri3n]TESTFOCUS DIALOG 6, 15, 207, 113
STYLE DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Testing Focus"
FONT 8, "MS Sans Serif"
{
GROUPBOX "", 301, 8, 3, 192, 82, BS_GROUPBOX
LTEXT "Get - 1", -1, 20, 23, 30, 8
EDITTEXT 101, 58, 20, 132, 13, ES_AUTOHSCROLL
LTEXT "Get - 2", -1, 19, 44, 30, 8
EDITTEXT 102, 58, 41, 132, 13, ES_AUTOHSCROLL
LTEXT "Get - 3", -1, 19, 65, 30, 8
EDITTEXT 103, 58, 62, 132, 13, ES_AUTOHSCROLL
PUSHBUTTON "&Create", 104, 74, 92, 40, 15
PUSHBUTTON "&Save", 105, 117, 92, 40, 15
PUSHBUTTON "&Ok", 106, 160, 92, 40, 15
}
[/code:3ducri3n]Best regards.
Manuel Mercado |
paste to getfield | Enrico, Manuel,
thank you. Now it is working.
Best regards,
Otto |
path command to libary | Hello,
It has been a while that i was working on my app, a lot of other things to do.
I am prepering a package to install my app. I think it is wise to put the app in the application folder and the database in the llbary folder. Is there a command that I can use to get the libary folder. I use Path(), Respath() and Userpath(), but I could not find a LibaryPath(). Is there one available. |
path command to libary | René,
I have just emailed you the FiveMac libraries with the new function LibraryPath()
many thanks for your great feedback <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
path command to libary | [code=fw:3eplfjyy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> LIBRARYPATH <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSString * Userpath = <span style="color: #000000;">[</span> @<span style="color: #ff0000;">"~/Library"</span> stringByExpandingTildeInPath <span style="color: #000000;">]</span>;<br /> <br /> hb_retc<span style="color: #000000;">(</span> <span style="color: #000000;">[</span> Userpath cStringUsingEncoding : <span style="color: #000000;">NSWindowsCP1252StringEncoding</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span></div>[/code:3eplfjyy] |
path of an image | I want save a path of a image into a get of a dialog
I can explain
I use to take the image Cgetfile but it give me
c:\bar\bitmaps\risto\cafe\cafe.jpg
on c\bar there is the Exe file
I want save only .\bitmaps\risto\cafe\cafe.jpg
or
If I have in future another folder down the cafe folder
all path respect the exe name path (GetModuleFileName(GetInstance()))
any solution pls ? |
path of an image | Just curious .. why don't you import your images into a .rc file and call them from a compiled resource rather than from a file location?.. Reason I ask is if you store your images in a sub folder the end user may accidentally delete them and then you lose all reference to them and your images fail to load.
Check the batch file rc2dll32.bat to be able to compile all your .rc files into a .res and then include the .res into your final compile to create the .exe.
Rick Lipkin |
path of an image | Rick it is catalog user I cannot insert thenm on a rc resources
if you create a archive of friends and insert a friend and you want insert his photo , why you must insert the photo into a rc file ? |
path of an image | You can use a Substring like :
( I noticed ".\" returns a wrong Backslash-direction. Using : "." + "\" works fine.
1. Get Your Main-directory :
[color=#0000FF:2q0admm8]c_path := CURDRIVE() + ":\" + GETCURDIR() [/color:2q0admm8]
2. the complete Path ( can be the Result from Image-selection ) :
[color=#0000FF:2q0admm8]cFile := c_path + "\Bitmaps\Olga.jpg"
Msgalert ( c_path + "\Bitmaps\Olga.jpg" )[/color:2q0admm8]
3. create the String :
[color=#0000FF:2q0admm8]cNewfile := "." + "\" + Substr(cFile, Len(c_path) + 2 , Len(cFile) )
Msgalert( cNewFile )[/color:2q0admm8]
4. Test if File exists :
[color=#0000FF:2q0admm8]IF FILE ( cNewfile )
Msgalert( cNewfile + " found !", "Attention" )
ENDIF[/color:2q0admm8]
Tested and works !!!
1. the full path
2. only the Subdirectory(s) with File
3. the Seek-result
[img:2q0admm8]http://www.pflegeplus.com/pictures/pathseek.jpg[/img:2q0admm8]
Best regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
path of an image | [quote="MdaSolution":2loplypq]Rick it is catalog user I cannot insert thenm on a rc resources
if you create a archive of friends and insert a friend and you want insert his photo , why you must insert the photo into a rc file ?[/quote:2loplypq]
I would prefer to store the image buffer in a memo field if I use RDD or into a binary field if I am using some RDMS. |
path of an image | Rao,
Do you have any examples on how to use memo fields to deal with images?
TIA. |
path of an image | [quote="hua":2lox38nv]Rao,
Do you have any examples on how to use memo fields to deal with images?
TIA.[/quote:2lox38nv]
DBFCDX RDD.
If we are having a memo filed by name IMAGE in a dbf file.
FIELD->IMAGE := MemoRead( "myimage.jpg" ) stores the image buffer in the memo field.
MemoWrit( cImageFileName, FIELD->IMAGE ) saves the image buffer to a file on disk.
fwh\samples\wwonders.dbf has a memofield IMAGE holding image buffers of different jpegs.
You can view these images with the simple program \fwh\samples\xbrimag1.prg.
This is a better way to store images of employees, products, etc. |
path of an image | Thank you very much Rao. This will solve the problem where user remembers to make regular backups of their data but not of the images.
Does it only work with DBFCDX and not DBFNTX? |
path of an image | [quote="hua":1a5o2o8h]Thank you very much Rao. This will solve the problem where user remembers to make regular backups of their data but not of the images.
Does it only work with DBFCDX and not DBFNTX?[/quote:1a5o2o8h]
DBFCDX or ADSCDX, ADSADT as far as I know. I think DBFNTX memo fields can not have binary data, I am not sure.
Please note that FPT files will be very large because it contains all image data. May require periodical packing. Still this is a lot better than dealing with number of different files.
Works with all RDMS with ADO. |
path of an image | One last question on the subject Rao, what's the fastest way to display the image in the memo field? Is there any faster method compared to:
i. read memo field
ii. write binary data in memo field to a temporary file
iii. get control to read that file and refresh it.
Off the top of my head, the optimized way would seem to be to read the binary data directly into memory and get whatever control meant to display the image to use that. I'm just not sure whether that's possible to do |
path of an image | [quote:39hrdk5q]Off the top of my head, the optimized way would seem to be to read the binary data directly into memory and get whatever control meant to display the image to use that. I'm just not sure whether that's possible to do
[/quote:39hrdk5q]
You are absolutely right. It is not efficient to write to disk and then read it again.
If you run the sample xbrimag1.prg, you will notice that the image buffer is directly displayed in the browse. There are no disk writes and reads. |
path of an image | Any snippet of how to do it with, let say, TImage control?
TIA |
path of an image | Sorry,
Perhaps I not understood How resolve it
I have the exe file C:\risto\Risto.exe
I have images for an cash application into .\bitmaps\pos
and on this folder we have many other folders
sample :
.\bitmaps\pos\imagenes
and on this we have for a sample :
.\bitmaps\pos\imagenes\bocadillos
.\bitmaps\pos\imagenes\cafes
.\bitmaps\pos\imagenes\cervezas
and on each folders we have the images sample
.\bitmaps\pos\imagenes\cervezas\heineken1.jpg
I wish save the string [b:2628tbx7]".\bitmaps\pos\imagenes\cervezas\heineken1.jpg"[/b:2628tbx7]
But I don't Know where the final user post his images
I wish save all folders ( and subfolders) respct the EXE FOlder that in this case in on C:\risto\Risto.exe |
path of an image | [quote="hua":14lvoog6]Any snippet of how to do it with, let say, TImage control?
TIA[/quote:14lvoog6]
Please see
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=22302&p=118743#p118743">viewtopic.php?f=6&t=22302&p=118743#p118743</a><!-- l --> |
path of an image | MdaSolution,
I think that you are trying to figure out where your .Exe file is running from..... You can use this:
[code=fw:xayrbxpl]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">LOCAL</span> ExePath := cFilePath<span style="color: #000000;">(</span> GetModuleFileName<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> BmpPath := ExePath + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\p</span>os"</span><br /> </div>[/code:xayrbxpl] |
path of an image | yes Bayron,
But I not Know the folder
sample : .\bitmaps\risto\cafe\cafe.jpg
the user can insert bitmap from .\bitmaps\risto\cafe\ or .\bitmaps\risto\ or .\bitmaps\
I don't Know where |
path of an image | I think Bayron is on the right track .. I use the same logic to find the location of the exe that the workstation opened ..
[code=fw:16yqzh2w]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//-- get timestamp on .exe //</span><br /><br />cFILE := GetModuleFileName<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br />aDIR := DIRECTORY<span style="color: #000000;">(</span> cFILE <span style="color: #000000;">)</span><br />dEXE := aDIR<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><br /><br /><span style="color: #B900B9;">// where .exe started from is default directory //</span><br /><br />mSTART := RAT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"<span style="color: #000000;">\"</span>, cFILE )<br />cDEFA := SUBSTR(cFILE,1,mSTART-1)<br /><br />aDIR := NIL<br /><br />SET DEFA to ( cDEFA )<br /><br /></span></div>[/code:16yqzh2w]
The important part of this code is setting Set Defa to .. location of your exe. This allows you to globally set the location of your app to not only open your tables but to have a starting point for calling your icons and bitmaps ..
It does not matter if you are connecting via a logical drive or by a network path or unc such as :
c:\apps\yourapp.exe
g:\apps\yourapp.exe
\\server\apps\yourapp.exe
By identifying the location of your executable .. you can globally set your Default and anywhere in your app you can get that default by
cDEFA := SET(7) .. returns one of the above paths .. then using that variable get your bitmaps like
cDEFA := SET(7)
DEFINE BITMAP oBMAP FILENAME (cDEFA+"\bitmaps\risto\cafe\cafe.bmp") of oWnd
Hope that helps.
Rick Lipkin |
path of an image | Hi,
My scheme is:
.exe program+ .ini path configuration in same directory, and separated data directory
Example:
Account.Exe and Account.Ini in something directory.
Run.Ini contents:
[code=fw:2cqebhlc]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PathProgram=\ProgramDir\Account<br /> </div>[/code:2cqebhlc]
So .exe is launched in something directory and path data is independent from .exe.
Just, my 2 cents
regards |
patternlock | [img:2qql8cmf]https://mybergland.com/fwforum/patternlock.jpg[/img:2qql8cmf] |
patternlock | [img:1lejoblv]https://mybergland.com/fwforum/patternlock.jpg[/img:1lejoblv] |
patternlock | Dear Otto,
I think that the amount of possibilities is low, so users may "guess" other users on several tries
[code=fw:3tx9umt2]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ? NCombinations<span style="color: #000000;">(</span> <span style="color: #000000;">9</span>, <span style="color: #000000;">[</span><span style="color: #0000ff;">from</span> <span style="color: #000000;">3</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">9</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// and I think the above is not correct as several solutions may be impossible</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> NFactorial<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> nResult := <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">local</span> x<br /> <br /> <span style="color: #00C800;">for</span> x = n <span style="color: #0000ff;">to</span> <span style="color: #000000;">1</span> step <span style="color: #000000;">-1</span><br /> nResult := nResult * x<br /> <span style="color: #00C800;">Next</span> x<br /><br /><span style="color: #00C800;">return</span> nResult<br /><br /><span style="color: #00C800;">function</span> NCombinations<span style="color: #000000;">(</span> n, m <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> nFactorial<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> / <span style="color: #000000;">(</span> nFactorial<span style="color: #000000;">(</span> m <span style="color: #000000;">)</span> * nFactorial <span style="color: #000000;">(</span> n - m <span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:3tx9umt2] |
patternlock | Dear Antonio,
Thank you.
Maybe you can post an example that is safe and works.
It would be great.
Thanks in advane.
Best regards,
Otto
Edit:
I did some more tests and I think it is save but you have to tune it.
[img:35x1vflg]https://mybergland.com/fwforum/patternlock.gif[/img:35x1vflg] |
patternlock | Dear Otto,
I think that 4 x 4 dots would be safer
Android uses it (I would say it is 4x4 also) |
patternlock | Hello friends,
You can now log in to the mod harbour web app with a password or pattern lock.
Best regards,
Otto
[img:279j4evp]https://mybergland.com/fwforum/patternlock2.gif[/img:279j4evp] |
patternlock | Dear Otto
Please can post an example
Thank you |
patternlock | Hello Adhemar,
I posted the link here:
[url:34n9d10u]https://www.facebook.com/groups/modharbour.club/permalink/970994220121472/[/url:34n9d10u]
Best regards,
Otto
[code=fw:34n9d10u]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">function</span> main<br /><br />TEMPLATE<br /><br /><!DOCTYPE html><br /><html xmlns=<span style="color: #ff0000;">"http://www.w3.org/1999/xhtml"</span>><br /><br /><head><br /> <meta http-equiv=<span style="color: #ff0000;">"Content-Type"</span> content=<span style="color: #ff0000;">"text/html; charset=utf-8"</span> /><br /> <meta <span style="color: #0000ff;">name</span>=<span style="color: #ff0000;">"viewport"</span> content=<span style="color: #ff0000;">"width=320, user-scalable=no, initial-scale=1.0, maximum-scale=1.0"</span> /><br /> <title>Pattern Lock</title><br /><br /> <link rel=<span style="color: #ff0000;">"stylesheet"</span> type=<span style="color: #ff0000;">"text/css"</span> href=<span style="color: #ff0000;">"_style/patternlock.css"</span>/><br /> <script src=<span style="color: #ff0000;">"_script/patternlock.js"</span>></script><br /><br /> <script><br /> <span style="color: #00C800;">function</span> submitform<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">{</span><br /> alert<span style="color: #000000;">(</span><span style="color: #ff0000;">"PW you entered "</span> + document.getElementById<span style="color: #000000;">(</span><span style="color: #ff0000;">"password"</span><span style="color: #000000;">)</span>.value<span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">true</span>;<br /> <span style="color: #000000;">}</span><br /> </script><br /><br /><style><br /> body<span style="color: #000000;">{</span><br /> text-align:<span style="color: #0000ff;">center</span>;<br /> font-family:<span style="color: #000000;">Arial</span>, Helvetica, sans-serif;<br /> <span style="color: #000000;">}</span><br /></style><br /><br /></head><br /><br /><body><br /> <form <span style="color: #00C800;">method</span>=<span style="color: #ff0000;">"post"</span> onsubmit=<span style="color: #ff0000;">"return submitform()"</span>><br /> <h2>Please login</h2><br /><br /> <div><br /> <input type=<span style="color: #ff0000;">"password"</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"password"</span> <span style="color: #0000ff;">name</span>=<span style="color: #ff0000;">"password"</span> <span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"patternlock"</span> /><br /> <input type=<span style="color: #ff0000;">"submit"</span> value=<span style="color: #ff0000;">"login"</span>/><br /> </div><br /> </form><br /><br /></body><br /></html><br /><br /><br />ENDTEXT<br /><br /><span style="color: #00C800;">return</span> <br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:34n9d10u] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.