topic
stringlengths
1
63
text
stringlengths
1
577k
instant refresh
Ehab This code works for me .. SELECT EMPLOYEE nRECNO := RECNO() IF MsgYesNo( "Are you SURE you want to DELETE this?" ) dbSelectArea( "EMPLOYEE" ) IF RECLOCK( 5 ) dbDelete() dbUnlock() dbCommit() SKIP+1 IF EOF() dbGoTop() ENDIF nRECNO := RECNO() ENDIF ENDIF GOTO nRECNO oBROW:UpStable() oBROW:Refresh(.T.) SysReFresh()
instant refresh
Can I have the old browse with the first record browsed before the deletion ? I mean updating the browse having the first ecord before the deletion except the record deleted .
instant refresh
Ehab, XBrowse does an unusal type of refresh. I have tried a few things and found that this works. Change the Delete() method to this: [code:27azanlq]method _delete(oBrw,oDlg) if msgYesNo("Delete this record?") super:delete() endif ::skip(-1) ::skip(1) oBrw:refresh() return self[/code:27azanlq] James
instant refresh
But that is not valid with first record in the browse and last record if I delete either of them ? I tried all possible methods from Xbrowse concerning the eof() , bof() with no success . Thanks
instant refresh
Ehab, Gee, you want it to work all the time...Ok, if you insist. [code:1um9a3lj]method _delete(oBrw,oDlg) if msgYesNo("Delete this record?") super:delete() endif ::skip(-1) ::skip(0) oBrw:refresh() return self[/code:1um9a3lj] James
instant refresh
That is not working all the time . It works with first and last recrd but in the middle I need the previous code . That code does not detect bof() and eof() [code:m5bsh5ah] if ::eof() .OR. ::bof() ::skip(-1) ::skip(0) else ::skip(-1) ::skip(1) endif [/code:m5bsh5ah]
instant refresh
Yes I could solve it like this . It works : [code:3gbdbfe0] method _delete(oBrw,oDlg) if msgYesNo("Delete this record?") super:delete() endif ::skip(1) ::skip(0) if oBrw:eof() ::skip(-1) ::skip(0) endif oBrw:refresh() return self [/code:3gbdbfe0] How to pack . when ever I involve pack command I faced with DBF execlusive required !!
instant refresh
Ehab, >How to pack . when ever I involve pack command I faced with DBF execlusive required !! A better solution is to reuse deleted records. Change the delete method to blank out the record and the append method to look for blank records before adding a new one. James
instant refresh
I should point out that this delete method should more properly be a method of the browse not the database class since it is dealing with browse issues not database issues. Making it a method of the database class means that you cannot use it when not browsing. It is curious that none of the browses have delete methods. They would have to also handle arrays. An alternative would be to make the above delete method of the datbase class something like browseDelete() instead. James
instant refresh
Could you please help in syntax . I failed totaly ?! Thanks
instant refresh
Ehab, >Could you please help in syntax. I'm not sure what syntax you mean. Did you mean making a browseDelete() method? If so, you just define it in your class definition and name the method--just the same as the current delete() method you have. Actually, you can just rename it in both places. [code:379q76b3]class ... from TData ... method BrowseDelete() endclass method BrowseDelete() ... return self[/code:379q76b3] OK, you may be cofused about the way the current delete method is defined. Because "delete" is a reserved word, we have to use a special way of defining it. This is only used for reserved words. [code:379q76b3]class ... from TData message delete method _delete endclass method _delete() ... return self[/code:379q76b3] James
instant refresh
Oka I did it in such a way but about calling the two methods ? [code:nzm90l0e] //--- meter class class Tmeter from TData method new method browser method add method edit message delete method BrowseDelete Hidden: data lAdd as logical endclass //--- meter class class Tmeterdelete from TData method new method browser method add method edit method DBFdelete Hidden: data lAdd as logical endclass .. method BrowseDelete(oBrw,oMeter) ::skip(1) ::skip(0) if oBrw:eof() ::skip(-1) ::skip(0) endif oBrw:refresh() return self //---------------------------------------------------------------------------// method DBFdelete(oMeter,oBrw) local nRecno if msgYesNo("Delete this record?") super:delete() endif nRECNO := oMeter:RECNO() oMeter:pack() GOTO nRECNO return self [/code:nzm90l0e]
instant refresh
Ehab, No, it is much simpler. [code:2g61m9d2]//--- meter class class Tmeter from TData method new method browser method add method edit method BrowseDelete Hidden: data lAdd as logical endclass .. method BrowseDelete(oBrw,oMeter) if msgYesNo("Delete this record?") ::delete() endif ::skip(1) ::skip(0) if oBrw:eof() ::skip(-1) ::skip(0) endif oBrw:refresh() return self [/code:2g61m9d2] Keep in mind that this is a table class (we call them DBFs) so a browse function (method) doesn't really belong in this class, but we are doing it because it is easier than adding it to the TXBrowse class. You don't want to mess with the table delete method and it shouldn't have any interfaces in it--you may want to call it from other code (as we did above in the BrowseDelete() method). Also you don't ever want to change the name of the method (like DBFDelete) because you want all tables to have a delete method (called "delete"). This is one of the basics of using OOP and it allows you to do things like pass any object and call the delete method. If each object had a different name for the delete method then you would have to code a large DO CASE statement and add to it for each new object--not good. You can't do this with procedural coding. [code:2g61m9d2]function whatever( oObject ) oObject:delete() return self[/code:2g61m9d2] Also you do not need a new class for a new method. The method is part of the existing class--in your case TMeter. See OOP is really simple. James
instant refresh
Where in code can I pack the deleted records and in same time keep the existing browse as BrowseDelete(oBrw,oMeter) ? I f packed the shape of the browse is going to be redisplayed aganist BrowseDelete(oBrw,oMeter). Thanks
instant refresh
Ehab, You cannot pack a data file while it is being used. It must be in exclusive use and it takes way too long. My suggestion as before is to reuse records. Or, you can pack during reindexing which also requires exclusive use. When you delete records with SET DELETED ON, they will be invisible so there is no need to pack. Also when you when you index you should always use the FOR NOT DELETED() clause so the index record count will not include deleted records. James
instant refresh
Any way to delete and pack at the same time beside keeping the browse as BrowseDelete() do ?
instant refresh
Ehab, >Any way to delete and pack at the same time beside keeping the browse as BrowseDelete() do ? Did you read my previous message? No, you cannot pack a file after deleting a record, nor would it be practical even if you could. This has nothing to do with the browse delete method--you can't do it using any method or function. James
instant refresh
No harm fom putting pack after using the file like below or you think there is a better place to for the pack for the deleted commands : [code:2370vs6w] use mete exclusive index on me_mc_serl to mete index on me_date to mete2 pack use [/code:2370vs6w]
instant refresh
Ehab, No you don't want to do it that way either. What if the database has a million records? Every time the user opens the file it is going to get packed which could take a half hour. You have to pack databases using a separate routine that the user can call occassionally. You can leave deleted records in the database for quite some time unless you are deleting lots of them and if you doing that you need to rethink the design. Still the best solution is to reuse deleted records. Then you never have to PACK. James
instruccion indexacion
iuso esta expression para indexarSELE 1 USE FACTU01 INDEX ON RUT TO FACTU01 set index to FACTU01
instruccion indexacion
Prueba así:INDEX ON FACTU01->RUT TO FACTU01 [quote="jlaranguizp":rcy4qc2d]iuso esta expression para indexar SELE 1 USE FACTU01 INDEX ON RUT TO FACTU01 set index to FACTU01[/quote:rcy4qc2d]
int64_t equivalente en long
Estimados tengo que retornar un int64_t desde c a harbour como seria la conversión? no estoy muy claro si resia float ó float float. [code=fw:3auy807g]<div class="fw" id="{CB}" style="font-family: monospace;">int64_t VLCWrapperImpl::<span style="color: #000000;">GetLength</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; int64_t length = libvlc_media_player_get_length<span style="color: #000000;">&#40;</span>pMediaPlayer_<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; <span style="color: #00C800;">return</span> length;<br /><span style="color: #000000;">&#125;</span></div>[/code:3auy807g] [quote:3auy807g]hb_retnl( (long) ... ); hb_retnll( (long long) ...);[/quote:3auy807g]
int64_t equivalente en long
Carlos, hb_retnll( ( HB_LONGLONG ) ... )
int64_t equivalente en long
Mil Gracia antonio
intento de treeview
Como Máximo queria la Clase treeview empecé a mirar su documentación . Como era una clase heredada de tableview pensé que podría ser muy similar ,pero parece que el datasource no tiene mucho que ver . He visto unos cuantos ejemplos de código por internet y la verdad que lian aun mas mis conceptos .Parece que la mejor omas facil solución pasa por usar una clase que se llama NStreeController y asociarla al nsoutlineview . Esa clase parece que se puede cargar desee un array ,pero sinceramente estoy muy perdido . pongo la parte de codigo que tengo que permite carga la clase en pantalla y definirlas columnas ( son las mismas que las de browse ) , pero el datasource no esta empezado a implementar y tampoco se muy bien como funciona su clase correspondiente en fw para windows. [code=fw:3idhiue7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> TREECREATE <span style="color: #000000;">&#41;</span> <br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; NSScrollView * sv = <span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#91;</span> NSScrollView alloc <span style="color: #000000;">&#93;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;initWithFrame : <span style="color: #000000;">NSMakeRect</span><span style="color: #000000;">&#40;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>, hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; NSOutlineView &nbsp;* browse;<br />&nbsp; &nbsp; NSWindow * <span style="color: #0000ff;">window</span> = <span style="color: #000000;">&#40;</span> NSWindow * <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #B900B9;">// while( [ [ data->hWnd className ] isEqual : @"NSTabViewItem" &nbsp;] )</span><br />&nbsp; &nbsp; <span style="color: #B900B9;">// &nbsp; data->hWnd = [ [ ( ( NSTabViewItem * ) data->hWnd ) tabView ] window ]; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> sv setAutoresizingMask : <span style="color: #000000;">NSViewWidthSizable</span> | NSViewHeightSizable <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> sv setHasVerticalScroller : <span style="color: #000000;">YES</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> sv setHasHorizontalScroller : <span style="color: #000000;">YES</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> sv setBorderType : <span style="color: #000000;">NSBezelBorder</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; browse = <span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#91;</span> NSOutlineView alloc <span style="color: #000000;">&#93;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; initWithFrame : <span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#91;</span> sv contentView <span style="color: #000000;">&#93;</span> frame <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <span style="color: #B900B9;">// [ browse setAllowsColumnSelection : YES ];</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> sv setDocumentView : <span style="color: #000000;">browse</span> <span style="color: #000000;">&#93;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> GetView<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">window</span> <span style="color: #000000;">&#41;</span> addSubview : <span style="color: #000000;">sv</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <span style="color: #B900B9;">// esto es añadido </span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; hb_retnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> browse <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span> &nbsp;<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> TREEADDCOLUM <span style="color: #000000;">&#41;</span> <br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; NSOutlineView * browse = <span style="color: #000000;">&#40;</span> NSOutlineView * <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; NSString * string = <span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#91;</span> NSString alloc <span style="color: #000000;">&#93;</span> initWithCString: <span style="color: #000000;">ISCHAR</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> ? hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#93;</span> autorelease <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; TableColumn * column = <span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#91;</span> TableColumn alloc <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">init</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; column->id = <span style="color: #000000;">&#91;</span> browse numberOfColumns <span style="color: #000000;">&#93;</span>; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> column setWidth : <span style="color: #000000;">100</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <span style="color: #B900B9;">// [column setEditable: YES];</span><br />&nbsp; &nbsp; <span style="color: #B900B9;">// [ column setResizable: YES ];</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#91;</span> column headerCell <span style="color: #000000;">&#93;</span> setStringValue: <span style="color: #000000;">string</span> <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp; <span style="color: #000000;">&#91;</span> browse addTableColumn : <span style="color: #000000;">column</span> <span style="color: #000000;">&#93;</span>;<br /><span style="color: #000000;">&#125;</span> &nbsp;<br />&nbsp;</div>[/code:3idhiue7]
intento pero el icono no aparece al lado del titulo
hola. [code=fw:shsdr286]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIcon <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"1"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">".: Sistema administrativo :."</span> <span style="color: #0000ff;">ICON</span> oIcon <-------------- no funciona<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SETicon</span><span style="color: #000000;">&#40;</span>oIcon<span style="color: #000000;">&#41;</span> <-------------- no funciona<br />&nbsp;</div>[/code:shsdr286] como puedo hacer para que el icono aparezca? porque en la app si funciona, en la barra de estado de windows tambien, pero en el titulo del windows aparece el por defecto
intento pero el icono no aparece al lado del titulo
Try [code=fw:28qnygr2]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">".: Sistema administrativo :."</span> <span style="color: #0000ff;">ICON</span> <span style="color: #ff0000;">"1"</span></div>[/code:28qnygr2] EMG
intento pero el icono no aparece al lado del titulo
[quote="goosfancito":3a7mlkyq]hola. [code=fw:3a7mlkyq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIcon <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"1"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">".: Sistema administrativo :."</span> <span style="color: #0000ff;">ICON</span> oIcon <-------------- no funciona<br /><br />   ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SETicon</span><span style="color: #000000;">&#40;</span>oIcon<span style="color: #000000;">&#41;</span> <-------------- no funciona<br /> </div>[/code:3a7mlkyq] como puedo hacer para que el icono aparezca? porque en la app si funciona, en la barra de estado de windows tambien, pero en el titulo del windows aparece el por defecto[/quote:3a7mlkyq] Gustavo , la ventana que te ocurre esto es MDI o MDICHILD ? Por lo que explicas creo que sera MDI Yo para el icono del la ventana principal MDI utilizo el nombre en recursos por ejemplo si es "OBRAS" lo asigno siempre a "AAOBRAS" asi me aseguro que es siempre el primero de la lista. y me funciona bien. Saludos. Jose.
intento pero el icono no aparece al lado del titulo
Hago como Enrico dice y funciona bién. [code=fw:y8o0bwrg]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oHand &nbsp;<span style="color: #0000ff;">RESOURCE</span> &nbsp;<span style="color: #ff0000;">"Dedo"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> &nbsp; oIco &nbsp; <span style="color: #0000ff;">RESOURCE</span> &nbsp;<span style="color: #ff0000;">"ICONE01"</span> &nbsp;<span style="color: #B900B9;">// EM IMAGENS.RES</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> &nbsp; oFont &nbsp;<span style="color: #0000ff;">NAME</span> cFont <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, cFontH WEIGHT <span style="color: #000000;">300</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> cTitle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span> MENUINFO <span style="color: #000000;">3</span> <span style="color: #0000ff;">ICON</span> oIco <span style="color: #0000ff;">MDI</span><br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span> oFont <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:y8o0bwrg] Saludos.
intento pero el icono no aparece al lado del titulo
he probado todas las formas que me dicen y ninguna me funciona , estoy con harbour y fwh 2020.
intento pero el icono no aparece al lado del titulo
llamar siempre el primero ICON del .RES [url:2bi3xj3y]https&#58;//i&#46;imgur&#46;com/3XTHtiy&#46;png[/url:2bi3xj3y] [img:2bi3xj3y]https&#58;//i&#46;imgur&#46;com/3XTHtiy&#46;png[/img:2bi3xj3y] Regards, saludos.
intento pero el icono no aparece al lado del titulo
siempre hago asi [url:dec472vx]https&#58;//drive&#46;google&#46;com/file/d/1js-dJyTb04XK4WJA3UK9g9D_isQDekP_/view?usp=sharing[/url:dec472vx] pero no me funciona en esta version.
intento pero el icono no aparece al lado del titulo
[quote="goosfancito":2qn6b571]hola. [code=fw:2qn6b571]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIcon <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"1"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">".: Sistema administrativo :."</span> <span style="color: #0000ff;">ICON</span> oIcon <-------------- no funciona<br /><br />   ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SETicon</span><span style="color: #000000;">&#40;</span>oIcon<span style="color: #000000;">&#41;</span> <-------------- no funciona<br /> </div>[/code:2qn6b571] como puedo hacer para que el icono aparezca? porque en la app si funciona, en la barra de estado de windows tambien, pero en el titulo del windows aparece el por defecto[/quote:2qn6b571] Me parece en pelles C el nombre de tu icono empieza con # y en el codigo fuente lo estas obviando Tambien podria ser que le falta al nombre del icono que lo pongas entre comillas en pelles c
intento pero el icono no aparece al lado del titulo
tenias razon faltaba el # gracias
intercept repeated values in an array
I have a cicle : [code=fw:2z79p1lx]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">local</span> nvalore,ntotale,n.k<br /><span style="color: #00C800;">local</span> nat<br /><span style="color: #00C800;">local</span> aTmp:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />nValore := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">For</span> k= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nTotale &nbsp;:= EstrattoSumDist<span style="color: #000000;">&#40;</span>n,k,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//sample n+k </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span> &nbsp;nTotale==nvalore<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span>b<span style="color: #000000;">&#93;</span> nAt := AScan<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> |a| &nbsp;a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> &nbsp;= n &nbsp;.or. &nbsp;a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> &nbsp;= n<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span>/b<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nAt == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aadd<span style="color: #000000;">&#40;</span>aTmp,<span style="color: #000000;">&#123;</span>n,k<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HB_ADel<span style="color: #000000;">&#40;</span> aTmp, nAt, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp;</div>[/code:2z79p1lx] why not run ok ? it add repeated value into array
intercept repeated values in an array
[code=fw:2yjkbtjv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\FWH..\SAMPLES\CICLO.PRG</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// LOCAL nvalore, ntotale, n.k // <- ERROR.</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nvalore, ntotale, n, k<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nat<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aTmp := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;nValore := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;ntotale := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">FOR</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">05</span> <span style="color: #B900B9;">// 90 // Only test</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> k = <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">05</span> <span style="color: #B900B9;">//90 // Only test</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nTotale := EstrattoSumDist<span style="color: #000000;">&#40;</span> n, k, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//sample n+k</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> nTotale == nvalore<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nAt := AScan<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = n .OR. a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = n <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> nAt == <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aAdd<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> n, k <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HB_ADel<span style="color: #000000;">&#40;</span> aTmp, nAt, .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span> k<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">NEXT</span> n<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> EstrattoSumDist<span style="color: #000000;">&#40;</span> n, k, nn <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ? n, k, nn</span><br /><br />&nbsp; &nbsp;? n + k<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// FIN / END</span><br />&nbsp;</div>[/code:2yjkbtjv] Regards, saludos.
intercept repeated values in an array
[quote="karinha":3q45clas][code=fw:3q45clas]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\FWH..\SAMPLES\CICLO.PRG</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// LOCAL nvalore, ntotale, n.k // <- ERROR.</span><br />   <span style="color: #00C800;">LOCAL</span> nvalore, ntotale, n, k<br />   <span style="color: #00C800;">LOCAL</span> nat<br />   <span style="color: #00C800;">LOCAL</span> aTmp := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   nValore := <span style="color: #000000;">0</span><br />   ntotale := <span style="color: #000000;">0</span><br /><br />   <span style="color: #00C800;">FOR</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">05</span> <span style="color: #B900B9;">// 90 // Only test</span><br /><br />      <span style="color: #00C800;">FOR</span> k = <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">05</span> <span style="color: #B900B9;">//90 // Only test</span><br /><br />         nTotale := EstrattoSumDist<span style="color: #000000;">&#40;</span> n, k, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//sample n+k</span><br /><br />         <span style="color: #00C800;">IF</span> nTotale == nvalore<br /><br />            nAt := AScan<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = n .OR. a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = n <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />            <span style="color: #00C800;">IF</span> nAt == <span style="color: #000000;">0</span><br /><br />               aAdd<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> n, k <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />            <span style="color: #00C800;">ELSE</span><br /><br />               HB_ADel<span style="color: #000000;">&#40;</span> aTmp, nAt, .T. <span style="color: #000000;">&#41;</span><br /><br />            <span style="color: #00C800;">ENDIF</span><br /><br />         <span style="color: #00C800;">ENDIF</span><br /><br />      <span style="color: #00C800;">NEXT</span> k<br /><br />   <span style="color: #00C800;">NEXT</span> n<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> EstrattoSumDist<span style="color: #000000;">&#40;</span> n, k, nn <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// ? n, k, nn</span><br /><br />   ? n + k<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// FIN / END</span><br /> </div>[/code:3q45clas] Regards, saludos.[/quote:3q45clas] your test not run the array aTmp is Empty [b:3q45clas]my test[/b:3q45clas] [img:3q45clas]https&#58;//i&#46;postimg&#46;cc/cJ51VwLx/r&#46;png[/img:3q45clas] With the sum the nvalore must be min. 3 and not 1 sample 1+2 = 3 as you can see on picture the number 1 and 2 are repeated [code=fw:3q45clas]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> aTmp:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> nAt<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> nTotale<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> nValore := <span style="color: #000000;">3</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">For</span> k= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nTotale &nbsp;:= &nbsp; k+n <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span> &nbsp;nTotale=nvalore<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">/* &nbsp;nAt := AScan( aTmp, { |a| a[1] = n .or. a[2] = n} )<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if nAt == 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aadd<span style="color: #000000;">&#40;</span>aTmp,<span style="color: #000000;">&#123;</span>n,k<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">/* else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HB_ADel( aTmp, nAt, .t. )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Endif */</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; xbrowser aTmp<br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:3q45clas]
intercept repeated values in an array
Now I make another test But I believe it is not correct [code=fw:1dkxdyt7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> aTmp:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />    <span style="color: #00C800;">local</span> nAt<br />    <span style="color: #00C800;">local</span> nTotale<br />    <span style="color: #00C800;">local</span> nValore := <span style="color: #000000;">3</span><br /><br />     <span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />        <span style="color: #00C800;">For</span> k= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />              nTotale  :=   k+n <br />              <span style="color: #00C800;">If</span>  nTotale=nvalore<br />                    nAt := AScan<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = n .or. a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = n<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                                  aadd<span style="color: #000000;">&#40;</span>aTmp,<span style="color: #000000;">&#123;</span>n,k,nAt<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />                  <span style="color: #00C800;">Endif</span><br />            <span style="color: #00C800;">next</span><br />         <span style="color: #00C800;">next</span><br /><br /><span style="color: #B900B9;">//erased repeated</span><br /><br />         <span style="color: #00C800;">for</span> t= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>aTmp<span style="color: #000000;">&#41;</span><br />                  <span style="color: #00C800;">If</span> aTmp<span style="color: #000000;">&#91;</span>t<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>=<span style="color: #000000;">0</span><br />                       HB_ADel<span style="color: #000000;">&#40;</span> aTmp, t, .t. <span style="color: #000000;">&#41;</span><br />                    <span style="color: #00C800;">Endif</span><br />           <span style="color: #00C800;">next</span><br /><br /><br />      xbrowser aTmp<br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:1dkxdyt7]
intercept repeated values in an array
Silvio, y crear un nuevo arreglo no? [code=fw:257s1nin]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> aTmp:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, aResu := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> nAt<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> nTotale<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> nValore := <span style="color: #000000;">9</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">For</span> k= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nTotale &nbsp;:= &nbsp; k+n<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span> &nbsp;nTotale=nvalore<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nAt := AScan<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = n .or. a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = n<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aadd<span style="color: #000000;">&#40;</span>aTmp,<span style="color: #000000;">&#123;</span>n,k,nAt<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #B900B9;">//erased repeated</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> t= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>aTmp<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span> aTmp<span style="color: #000000;">&#91;</span>t<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>=<span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Aadd<span style="color: #000000;">&#40;</span> aResu, aTmp<span style="color: #000000;">&#91;</span>t<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><br />&nbsp; &nbsp; &nbsp; xbrowser aResu<br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:257s1nin]
intercept repeated values in an array
[quote="cmsoft":1kvsbn1z]Silvio, y crear un nuevo arreglo no? [code=fw:1kvsbn1z]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> aTmp:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, aResu := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />    <span style="color: #00C800;">local</span> nAt<br />    <span style="color: #00C800;">local</span> nTotale<br />    <span style="color: #00C800;">local</span> nValore := <span style="color: #000000;">9</span><br /><br />     <span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />        <span style="color: #00C800;">For</span> k= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />              nTotale  :=   k+n<br />              <span style="color: #00C800;">If</span>  nTotale=nvalore<br />                    nAt := AScan<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = n .or. a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = n<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                                  aadd<span style="color: #000000;">&#40;</span>aTmp,<span style="color: #000000;">&#123;</span>n,k,nAt<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />                  <span style="color: #00C800;">Endif</span><br />            <span style="color: #00C800;">next</span><br />         <span style="color: #00C800;">next</span><br /><br /><span style="color: #B900B9;">//erased repeated</span><br /><br />         <span style="color: #00C800;">for</span> t= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>aTmp<span style="color: #000000;">&#41;</span><br />                  <span style="color: #00C800;">If</span> aTmp<span style="color: #000000;">&#91;</span>t<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>=<span style="color: #000000;">0</span><br />                       Aadd<span style="color: #000000;">&#40;</span> aResu, aTmp<span style="color: #000000;">&#91;</span>t<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />                    <span style="color: #00C800;">Endif</span><br />           <span style="color: #00C800;">next</span><br /><br /><br />      xbrowser aResu<br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1kvsbn1z][/quote:1kvsbn1z] As I wrote on private mail the problem is another for the two dimensional array i solved [code=fw:1kvsbn1z]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />        <span style="color: #00C800;">For</span> k= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />              nTotale  := Calc_Ambi_Sum_dist<span style="color: #000000;">&#40;</span>n,k,ntipo<span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">If</span>  nTotale=nvalore<br />                    nAt := AScan<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = n .or. a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = n<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                    <span style="color: #00C800;">If</span> nAt == <span style="color: #000000;">0</span><br />                       aadd<span style="color: #000000;">&#40;</span>aTmp,<span style="color: #000000;">&#123;</span>n,k<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />                    <span style="color: #00C800;">Endif</span><br />                  <span style="color: #00C800;">Endif</span><br />            <span style="color: #00C800;">next</span><br />         <span style="color: #00C800;">next</span></div>[/code:1kvsbn1z] [code=fw:1kvsbn1z]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Calc_Ambi_Sum_dist<span style="color: #000000;">&#40;</span>n1,n2,nTipo<span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//---------------------------------------</span><br />   <span style="color: #00C800;">local</span> nNum:=<span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> nTemp:=<span style="color: #000000;">0</span><br />   <span style="color: #00C800;">Do</span> <span style="color: #00C800;">case</span><br />      <span style="color: #00C800;">case</span> nTipo= <span style="color: #000000;">1</span> <span style="color: #B900B9;">// suma ciclométrica      ok</span><br />          nTemp:= n1+n2<br />          <span style="color: #00C800;">If</span> nTemp > <span style="color: #000000;">90</span><br />            nTemp:= ntemp<span style="color: #000000;">-90</span>      <span style="color: #B900B9;">//el exterior 90</span><br />          <span style="color: #00C800;">Endif</span><br />       <span style="color: #00C800;">case</span> nTipo= <span style="color: #000000;">2</span> <span style="color: #B900B9;">//distancia ciclométrica    ok</span><br />          <span style="color: #00C800;">IF</span> n2>n1<br />             nTemp:= n2-n1<br />          <span style="color: #00C800;">else</span><br />             nTemp:= n1-n2<br />          <span style="color: #00C800;">Endif</span><br />          <span style="color: #00C800;">If</span> nTemp > <span style="color: #000000;">45</span>          <span style="color: #B900B9;">//   el exterior 45</span><br />             nTemp:= <span style="color: #000000;">90</span>-nTemp<br />          <span style="color: #00C800;">Endif</span><br />       <span style="color: #00C800;">Case</span> nTipo= <span style="color: #000000;">3</span>  <span style="color: #B900B9;">//suma matemática        ok</span><br />          nTemp:= n1+n2<br /><br />       <span style="color: #00C800;">case</span> ntipo = <span style="color: #000000;">4</span> <span style="color: #B900B9;">// distancia matemática     ok</span><br />            <span style="color: #00C800;">IF</span> n2>n1<br />             nTemp:= n2-n1<br />          <span style="color: #00C800;">else</span><br />             nTemp:= n1-n2<br />          <span style="color: #00C800;">Endif</span><br /><br />     <span style="color: #00C800;">Endcase</span><br />     nNum := ntemp<br />     <span style="color: #00C800;">return</span> nNum<br /><br /><br /> </div>[/code:1kvsbn1z] for the three-dimensional array I find it difficult to find the numbers to associate I explain you 1) I speak of two numbers because in the Italian lottery two numbers are equal to both 2) I speak of three numbers because in the Italian lottery three numbers are equal to three the calculations are: 1) [b:1kvsbn1z]cyclometric sum[/b:1kvsbn1z] 2) [b:1kvsbn1z]cyclometric distance[/b:1kvsbn1z] 3) [b:1kvsbn1z]math addition[/b:1kvsbn1z] 4) [b:1kvsbn1z]mathematical distance[/b:1kvsbn1z] for the cyclometric sum it is always necessary to subtract 90 if the sum exceeds 90 The cyclometric distance between two numbers is obtained by calculating the arithmetic difference (major minus minor); if the result exceeds "the limit" 45, the latter is subtracted from the 90 set. The mathematical distance between two numbers is obtained by calculating the arithmetic difference (major minus minor); if the result exceeds "the limit" 90, the latter is subtracted from the 90 set. for[b:1kvsbn1z] l'array with three numbers[/b:1kvsbn1z] to create this cycle [code=fw:1kvsbn1z]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />         <span style="color: #00C800;">For</span> k= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />            <span style="color: #00C800;">For</span> j= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">90</span><br />              nTotale  :=      Calc_Terni_Sum_dist<span style="color: #000000;">&#40;</span>n,k,j,ntipo<span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">If</span>  nTotale=nvalore<br />                 nAt := AScan<span style="color: #000000;">&#40;</span> aTmp, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = n .and. a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = n .or.;<br />                                           a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = n .and. a<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> = n<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                    <span style="color: #00C800;">If</span> nAt == <span style="color: #000000;">0</span><br />                       aadd<span style="color: #000000;">&#40;</span>aTmp,<span style="color: #000000;">&#123;</span>n,k,j<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />                    <span style="color: #00C800;">Endif</span><br />                  <span style="color: #00C800;">Endif</span><br />            <span style="color: #00C800;">next</span><br />         <span style="color: #00C800;">next</span><br />      <span style="color: #00C800;">next</span></div>[/code:1kvsbn1z] and created this other function for the calculation but it is wrong [code=fw:1kvsbn1z]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">Function</span> Calc_Terni_Sum_dist<span style="color: #000000;">&#40;</span>n1,n2,n3,nTipo<span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//---------------------------------------</span><br />   <span style="color: #00C800;">local</span> nNum:=<span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> nTemp:=<span style="color: #000000;">0</span><br />   <span style="color: #00C800;">Do</span> <span style="color: #00C800;">case</span><br />      <span style="color: #00C800;">case</span> nTipo= <span style="color: #000000;">1</span> <span style="color: #B900B9;">// suma ciclométrica      ok</span><br />         nTemp:= n1+n2+n3<br /><br />          <span style="color: #00C800;">If</span> nTemp > <span style="color: #000000;">90</span><br />            nTemp:= ntemp<span style="color: #000000;">-90</span>      <span style="color: #B900B9;">//el exterior 90</span><br />         <span style="color: #00C800;">Endif</span><br /><br />       <span style="color: #00C800;">case</span> nTipo= <span style="color: #000000;">2</span> <span style="color: #B900B9;">//distancia ciclométrica    ok</span><br /><br />          <span style="color: #00C800;">IF</span> n1 > n2  .or. n1 >n3<br />            nTemp:= n1-n2-n3<br />          elseif n2 > n1  .or. n2 >n3<br />            nTemp:= n2-n3-n1<br />          elseif n3 > n1  .or. n3 > n2<br />            nTemp:= n3-n1-n2<br />          <span style="color: #00C800;">Endif</span><br /><br /><br /><br />          <span style="color: #00C800;">If</span> nTemp > <span style="color: #000000;">45</span>          <span style="color: #B900B9;">//   el exterior 45</span><br />             nTemp:= <span style="color: #000000;">90</span>-nTemp<br />          <span style="color: #00C800;">Endif</span><br /><br />       <span style="color: #00C800;">Case</span> nTipo= <span style="color: #000000;">3</span>  <span style="color: #B900B9;">//suma matemática        ok</span><br />          nTemp:= n1+n2<br /><br />       <span style="color: #00C800;">case</span> ntipo = <span style="color: #000000;">4</span> <span style="color: #B900B9;">// distancia matemática     ok</span><br />             <span style="color: #00C800;">IF</span> n1 > n2  .or. n1 >n3<br />            nTemp:= n1-n2-n3<br />          elseif n2 > n1  .or. n2 >n3<br />            nTemp:= n2-n3-n1<br />          elseif n3 > n1  .or. n3 > n2<br />            nTemp:= n3-n1-n2<br />          <span style="color: #00C800;">Endif</span><br /><br />     <span style="color: #00C800;">Endcase</span><br />     nNum := ntemp<br /> <span style="color: #00C800;">return</span> nNum</div>[/code:1kvsbn1z] how could i solve?
interceptar X de DIALOG
Hola, Me gustaría interceptar la X de un REDEFINE DIALOG para llamar a una función, pero no he visto el codeblock. Muchas gracias por adelantado. Saludos
interceptar X de DIALOG
ACTIVATE VALID() OU bValid
interceptar X de DIALOG
Muchas gracias, pero me temo que no funciona. Aquí he preparado un ejemplo: [code=fw:1bro277s]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Our first DialogBox sample</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #00C800;">local</span> oWnd<br />&nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test "</span> + FWVERSION <span style="color: #0000ff;">from</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">pixel</span><br /><br />&nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">init</span> dlg<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><span style="color: #00C800;">function</span> dlg<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oIco, cTest := <span style="color: #ff0000;">"Hello world! &nbsp; "</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRet := .f.<br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIco FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\i</span>cons<span style="color: #000000;">\f</span>ivewin.ico"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"I am a DialogBox"</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"W+/B"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ICON</span> oIco<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">1</span>, <span style="color: #000000;">3</span> <span style="color: #0000ff;">GET</span> cTest<br /><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">3</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Any action here!"</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">DEFAULT</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">3</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">XBROWSE</span><span style="color: #000000;">&#40;</span>ODLG<span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"AA"</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br />?nret<br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1bro277s]
interceptar X de DIALOG
[code=fw:m0cc4pbi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">STATIC</span> oWnd, lSalida := .F.<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test "</span> + FWVERSION <span style="color: #0000ff;">from</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">pixel</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">&#40;</span> Dlg_Salida<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Dlg_Salida<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oIco, cTest := <span style="color: #ff0000;">"Hello world! &nbsp; "</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIco FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\i</span>cons<span style="color: #000000;">\f</span>ivewin.ico"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"I am a DialogBox"</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"W+/B"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ICON</span> oIco<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">1</span>, <span style="color: #000000;">3</span> <span style="color: #0000ff;">GET</span> cTest<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">3</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> lSalida := .T., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">DEFAULT</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">3</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">12</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> lSalida := .F., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> CANCEL<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">VALID</span><span style="color: #000000;">&#40;</span> lSalida <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;lSalida := .F.<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:m0cc4pbi] Regards, saludos.
interceptar X de DIALOG
Muchas gracias, pero no me sirve, porque al pinchar en la x antes de cerrar el diálogo, o incluso después, tengo que llamar a una función.
interceptar X de DIALOG
Usas Resource?
interceptar X de DIALOG
Usando Recurso/Resource: [code=fw:vsliremv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// TESTE.PRG</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oWnd<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oMenu<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// MenuItem "From Code" action FromCode( oWnd )</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MenuItem</span> <span style="color: #ff0000;">"From Resource"</span> <span style="color: #0000ff;">action</span> FromrES<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">endmenu</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Test Button Get Transparent"</span> <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #0000ff;">pixel</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> oWnd<br /><br /><span style="color: #00C800;">FUNCTION</span> FromRes<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oDlg<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oGet1, oGet2, oGet3, oGet4<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cVar1, cVar2, cVar3, cVar4<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> lActive := .F., oSalida<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;cVar1 := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;cVar2 := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;cVar3 := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;cVar4 := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"fromres"</span> <span style="color: #0000ff;">of</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">var</span> cVar1 <span style="color: #0000ff;">id</span> <span style="color: #000000;">100</span> bitmap <span style="color: #ff0000;">"on"</span> <span style="color: #0000ff;">action</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"With Transparent"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">of</span> oDlg<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">GET</span> oGet2 <span style="color: #0000ff;">var</span> cVar2 <span style="color: #0000ff;">id</span> <span style="color: #000000;">101</span> bitmap <span style="color: #ff0000;">"on"</span> <span style="color: #0000ff;">action</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Without Transparent"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">of</span> oDlg<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">GET</span> oGet3 <span style="color: #0000ff;">var</span> cVar3 <span style="color: #0000ff;">id</span> <span style="color: #000000;">102</span> bitmap <span style="color: #ff0000;">"chkyes"</span> <span style="color: #0000ff;">action</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"With Adjust-Transparent"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">COLOR</span> CLR_BLACK, CLR_CYAN <span style="color: #0000ff;">of</span> oDlg<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">GET</span> oGet4 <span style="color: #0000ff;">var</span> cVar4 <span style="color: #0000ff;">id</span> <span style="color: #000000;">103</span> bitmap <span style="color: #ff0000;">"chkyes"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">action</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> lActive,oGet3:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oGet3:<span style="color: #000000;">enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, lActive := !lActive, oDlg:<span style="color: #0000ff;">update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">of</span> oDlg<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oGet1:<span style="color: #000000;">lBtnTransparent</span> := .T. &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// transparent button get oGet1</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oGet3:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oGet3:<span style="color: #000000;">lBtnTransparent</span> := .T. &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// transparent button get oGet3</span><br />&nbsp; &nbsp;oGet3:<span style="color: #000000;">lAdjustBtn</span> &nbsp; &nbsp; &nbsp;:= .T. &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Button Get Adjust Witdh oGet3</span><br />&nbsp; &nbsp;oGet3:<span style="color: #000000;">lDisColors</span> &nbsp; &nbsp; &nbsp;:= .F. &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Deactive disable color</span><br />&nbsp; &nbsp;oGet3:<span style="color: #000000;">nClrTextDis</span> &nbsp; &nbsp; := CLR_WHITE <span style="color: #B900B9;">// Color text disable status</span><br />&nbsp; &nbsp;oGet3:<span style="color: #000000;">nClrPaneDis</span> &nbsp; &nbsp; := CLR_BLUE &nbsp;<span style="color: #B900B9;">// Color Pane disable status</span><br /><br />&nbsp; &nbsp;oGet4:<span style="color: #000000;">lAdjustBtn</span> := .T.<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oSalida &nbsp; <span style="color: #0000ff;">ID</span> <span style="color: #000000;">301</span> &nbsp; <span style="color: #0000ff;">OF</span> oDlg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> lActive := .T., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> CANCEL<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">centered</span><br />&nbsp;<br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">// TESTE.RC</span><br /><span style="color: #B900B9;">/*<br />#ifndef __64__<br />&nbsp; 1 24 "winxp\WindowsXP.Manifest" <br />#endif<br /><br />#ifdef __64__<br />&nbsp; 1 24 "winxp\WindowsXP.Manifest64"<br />#endif<br /><br />FROMRES DIALOG 231, 77, 150, 150<br />STYLE DS_ABSALIGN | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION<br />CAPTION "Dialog"<br />FONT 8, "MS Sans Serif"<br />{<br />&nbsp;EDITTEXT 100, 11, 10, 80, 15, ES_AUTOHSCROLL<br />&nbsp;EDITTEXT 101, 10, 40, 80, 15, ES_AUTOHSCROLL<br />&nbsp;EDITTEXT 102, 9, 70, 129, 17, ES_AUTOHSCROLL<br />&nbsp;EDITTEXT 103, 10, 100, 130, 14, ES_AUTOHSCROLL<br />&nbsp;PUSHBUTTON "&Salida", 301, 50, 131, 50, 14<br />}<br /><br />ON BITMAP "..\bitmaps\on.bmp"<br /><br />CHKYES BITMAP "..\bitmaps\chkyes.bmp"<br />*/</span> <br />&nbsp;</div>[/code:vsliremv] Saludos.
interceptar X de DIALOG
Hola, No me he explicado bien, necesito que al hacer click sobre la X del diálogo llamar a una función, como sucede si pinchamos en ?. Gracias por intentarlo.
interceptar X de DIALOG
Intenta asì: [code=fw:hrgx1n0e]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> MYFUNC<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> MYFUNC<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; ? <span style="color: #ff0000;">"MYFUNC()"</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> .T.</div>[/code:hrgx1n0e] EMG
interceptar X de DIALOG
¡Muchas gracias Enrico!
interesting book on Windows programming and its ""internals""
Hope it helps: <!-- m --><a class="postlink" href="https://wetransfer.com/downloads/79c93ba242661592465d06542a9b421320200518141126/960d7da67fb020e4c2efb381891b924d20200518141151/156889">https://wetransfer.com/downloads/79c93b ... 151/156889</a><!-- m --> Regards
intermittent color
how can I create an intermittent color for a btnbmp [img:x29gt1ug]https&#58;//i&#46;postimg&#46;cc/t424NxKG/cerca&#46;png[/img:x29gt1ug] See the image ? now the btnbmp has the color yellow with :SetColor(CLR_RED,CLR_YELLOW) but I would like to flash for a few seconds in different colors to make it display and say to the end user "I am here" how can I do it?
intermittent color
Silvio, [quote:ifn39rcj]but I would like to flash for a few seconds in different colors to make it display and say to the end user "I am here" [/quote:ifn39rcj] what do You think about painting only a colored border with a defined pensize and transparent-level instead of changing the buttoncolor I think that looks better. [img:ifn39rcj]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/BBorder1&#46;jpg[/img:ifn39rcj] regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
intermittent color
no I wish simulate the old clipper comand * do you remember ?
intermittent color
Uwe, Please try this test [code=fw:ivhb1hk4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oFont, aBtn<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><br />   <span style="color: #00C800;">local</span> nRow, nCol, n<br /><br />   <span style="color: #00C800;">local</span> ntype:=<span style="color: #ff0000;">"01"</span><br />   <span style="color: #00C800;">local</span> date1 :=date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> date2 :=date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cImage1:= <span style="color: #ff0000;">"c:<span style="color: #000000;">\w</span>ork<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\a</span>lphabmp<span style="color: #000000;">\w</span>orld.bmp"</span><br />   <span style="color: #00C800;">local</span> cImage2:= <span style="color: #ff0000;">"c:<span style="color: #000000;">\w</span>ork<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\a</span>lphabmp<span style="color: #000000;">\t</span>ask.bmp"</span><br /><br />   aData:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />   nRow  := <span style="color: #000000;">50</span><br />   nCol  := <span style="color: #000000;">30</span><br /><br />   <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">3</span><br />      @ nRow, nCol <span style="color: #0000ff;">BTNBMP</span> aBtn<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">RESOURCE</span> cImage1 ;<br />         <span style="color: #0000ff;">PROMPT</span> LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" "</span> ;<br />         <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">64</span>,<span style="color: #000000;">64</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT TOP  NOBORDER<br /><br />        <br />      nCol  += <span style="color: #000000;">80</span><br />   <span style="color: #00C800;">next</span> n<br /><br /><br />  <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span>;<br />                                        <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> Lamp<span style="color: #000000;">&#40;</span> aBtn<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> Lamp<span style="color: #000000;">&#40;</span>oBtn<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> n<br />       <span style="color: #00C800;">For</span> n=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">10</span><br />         oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span>CLR_RED,CLR_YELLOW<span style="color: #000000;">&#41;</span><br />        syswait<span style="color: #000000;">&#40;</span><span style="color: #000000;">0.08</span><span style="color: #000000;">&#41;</span><br />        oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span>CLR_RED,CLR_GREEN<span style="color: #000000;">&#41;</span><br />         syswait<span style="color: #000000;">&#40;</span><span style="color: #000000;">0.08</span><span style="color: #000000;">&#41;</span><br />        oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span>CLR_RED,CLR_YELLOW<span style="color: #000000;">&#41;</span><br />        n++<br />      <span style="color: #00C800;">next</span><br />      <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------//</span></div>[/code:ivhb1hk4] I wish change the background color of btnbmp many times for simulate the intermittet color as to create a blink How I can resolve ?
intermittent color
Silvio, try this [code=fw:3f9wsv1l]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #B900B9;">// now the btnbmp has the color yellow with :SetColor(CLR_RED,CLR_YELLOW)</span><br /><span style="color: #B900B9;">// but I would like to flash for a few seconds in different colors </span><br /><span style="color: #B900B9;">// to make it display and say to the end user "I am here" </span><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oDlg, oFont, aBtn<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">local</span> nRow, nCol, n<br /><br /><span style="color: #00C800;">local</span> ntype:=<span style="color: #ff0000;">"01"</span><br /><span style="color: #00C800;">local</span> date1 :=date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> date2 :=date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">local</span> cImage1:= <span style="color: #ff0000;">".<span style="color: #000000;">\B</span>itmaps<span style="color: #000000;">\w</span>orld.bmp"</span><br /><span style="color: #00C800;">local</span> cImage2:= <span style="color: #ff0000;">".<span style="color: #000000;">\B</span>itmaps<span style="color: #000000;">\t</span>ask.bmp"</span><br /><br />aData:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />nRow  := <span style="color: #000000;">50</span><br />nCol  := <span style="color: #000000;">30</span><br /><br /><span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">3</span><br />      @ nRow, nCol <span style="color: #0000ff;">BTNBMP</span> aBtn<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">RESOURCE</span> cImage1 ;<br />           <span style="color: #0000ff;">PROMPT</span> LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" "</span> ;<br />           <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">64</span>,<span style="color: #000000;">64</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT TOP  NOBORDER<br />      nCol  += <span style="color: #000000;">80</span><br /><span style="color: #00C800;">NEXT</span> n<br /><br />oDlg:<span style="color: #000000;">bPainted</span> := < |hDC|<br />    Lamp<span style="color: #000000;">&#40;</span> aBtn<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// don't use ON INIT !</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> LAMP<span style="color: #000000;">&#40;</span>oBtn<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> n, lChange := .F.<br /><br /><span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">9</span> <span style="color: #B900B9;">// lastcolor = yellow</span><br />    <span style="color: #00C800;">IF</span> lChange = .F.<br />         oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span>CLR_RED,CLR_YELLOW<span style="color: #000000;">&#41;</span><br />         lChange := .T.<br />    <span style="color: #00C800;">ELSE</span><br />         oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span>CLR_RED,CLR_GREEN<span style="color: #000000;">&#41;</span><br />         lChange := .F.<br />    <span style="color: #00C800;">ENDIF</span><br />    oBtn:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    syswait<span style="color: #000000;">&#40;</span><span style="color: #000000;">0.1</span><span style="color: #000000;">&#41;</span><br />    n++<br /><span style="color: #00C800;">NEXT</span><br />oBtn:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// shows yellow</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> </div>[/code:3f9wsv1l] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
intermittent color
[size=200:2qkuppo6]yes good [/size:2qkuppo6] I knew you would find the right solution, as far as graphics are concerned you are good for image Umbrella run good for another services not run but this depends on the image which is too large and does not have a defined outline I was what I have been looking for for a long time: the user searches for a customer for example "Falconi", the procedure searches for the customer (in that date range), creates an array, if the len of the array is one it shows the flashing otherwise it opens a dialog with the list of services occupied by the customer during that period, then the end user can select which service to show by flashing
internet IP (plz translate)
Following is Visual Foxpro code to get internet IP. Anyone can help to translate it to FWH plz :- loExplorer = CreateObject("InternetExplorer.Application") loExplorer.Navigate2("www.whatismyip.com") DO WHILE loExplorer.readystate <> 4 ENDDO loDoc = loExplorer.Document cIp = UPPER(loDoc.Body.Innertext)
internet IP (plz translate)
This is a working sample in pure xHarbour: [code:3qulls64]FUNCTION MAIN&#40;&#41; LOCAL oExplorer &#58;= CREATEOBJECT&#40; "InternetExplorer&#46;Application" &#41; oExplorer&#58;Navigate2&#40; "www&#46;whatismyip&#46;com" &#41; WHILE oExplorer&#58;ReadyState <> 4 HB_IDLESLEEP&#40; 1 &#41; ENDDO ? UPPER&#40; oExplorer&#58;Document&#58;Body&#58;InnerText &#41; oExplorer&#58;Quit&#40;&#41; INKEY&#40; 0 &#41; RETURN NIL[/code:3qulls64] EMG
internet IP (plz translate)
Thanks. Can get Harbour version ?
internet IP (plz translate)
Here it is (please note that you need of hbole.lib): [code:na9iabtr]FUNCTION MAIN&#40;&#41; LOCAL oExplorer &#58;= TOleAuto&#40;&#41;&#58;New&#40; "InternetExplorer&#46;Application" &#41; oExplorer&#58;Navigate2&#40; "www&#46;whatismyip&#46;com" &#41; WHILE oExplorer&#58;ReadyState <> 4 HB_IDLESLEEP&#40; 1 &#41; ENDDO ? UPPER&#40; oExplorer&#58;Document&#58;Body&#58;InnerText &#41; oExplorer&#58;Quit&#40;&#41; INKEY&#40; 0 &#41; RETURN NIL[/code:na9iabtr] EMG
internet IP (plz translate)
where can I download hbole.lib ?
internet IP (plz translate)
Sent to your private email. EMG
internet IP (plz translate)
Thanks, got it. But after link got this error when running BUILDH.BAT : Error: Unresolved external '_hb_vmMessage' referenced from HBOLE.LIB|ole2
internet IP (plz translate)
Sorry, it seems that your Harbour version is too old and I have no way to build a hbole.lib compatible with it. EMG
internet consultation embed in my application
Hi FiveWinners. Add to my application I require an internet consultation, but consultation should be displayed in a window or dialog in my application and not as a separate internet consultation. Anyone know the trick? regards
internet consultation embed in my application
fwh\samples\webexp.prg fwh\samples\webexp2.prg fwh\samples\webexp3.prg <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
internet explorer remote desktop
Hello, Is the way internet explorer works similar to remote desktop. Can we say that internet explorer is kind of remote desktop client or is this completely wrong. Best regards, Otto
internet explorer remote desktop
I don´t think so. Internet explorer "asks a question" to the server and waits for the answer. Once connected RD has kind of its own life.
internet ip address
Hello Is there an esay way to know the INTERNET ip address from a computer ? I think Enrico published solething on it some time ago, i did a search but did not find, if anyone has a sample, thanks for the help PS : I was previously using tip functions from xharbour but they do not work anymore, i plan to replace them with fwh functions, Thanks for help, Richard
internet ip address
[code:3ldq7ue1]#include "FiveWin&#46;ch" function Main&#40;&#41; local oSocket &#58;= TSocket&#40;&#41;&#58;New&#40; 2000 &#41; local cIp &#58;= oSocket&#58;cIPAddr ?cIp oSocket&#58;End&#40;&#41; return NIL[/code:3ldq7ue1]
internet ip address
Richard, This may help: <!-- m --><a class="postlink" href="http://www.paulsadowski.com/sadowski/currentip.htm">http://www.paulsadowski.com/sadowski/currentip.htm</a><!-- m --> Silvio, Your code returns the local IP not the public IP on Internet
internet ip address
Antonio, sorry I not read good the text of Richard , sorry
internet ip address
[code:2lt688sr]FUNCTION MAIN&#40;&#41; LOCAL aHosts INETINIT&#40;&#41; aHosts = INETGETHOSTS&#40; NETNAME&#40;&#41; &#41; INETCLEANUP&#40;&#41; ? aHosts&#91; 2 &#93; RETURN NIL[/code:2lt688sr] EMG
internet ip address
Enrico, I get this error: [code:nrbpzs9r] Error description&#58; Error BASE/1132 Bound error&#58; array access Args&#58; &#91; 1&#93; = A &#123; &#46;&#46;&#46; &#125; &#91; 2&#93; = N 2 [/code:nrbpzs9r] Using [ 1 ] then I get the local IP
internet ip address
Works fine here. Are you using Harbour or xHarbour? EMG
internet ip address
Enrico, xHarbour, as Harbour does not provide those functions afaik
internet ip address
Hello, I use like this: [code:17x3t6ej] #include "fivewin&#46;ch" function MAIN msgstop&#40; getip&#40;&#41; &#41; return NIL Function GetIP&#40;&#41; Local cVar1 WsaStartUp&#40;&#41; cVar1 &#58;= GetHostByName&#40; GetHostName&#40;&#41; &#41; WsaCleanUp&#40;&#41; return cVar1 [/code:17x3t6ej] ...or like this: [code:17x3t6ej] FUNCTION MAIN&#40;&#41; LOCAL aHosts INETINIT&#40;&#41; aHosts = INETGETHOSTS&#40; NETNAME&#40;&#41; &#41; INETCLEANUP&#40;&#41; * ? aHosts&#91; 2 &#93; ? valtoprg&#40; aHosts &#41; [/code:17x3t6ej] Regards, Rossine.
internet ip address
I tried the several possibilities. By using the example of Enrico, I got the same error as Antonio. The first example of Rossine returns my local IP. The second example returns something like this : [quote:19ee5nlc]M->__ValToPrg_Array := Array(1) M->__ValToPrg_Array[1] := "192.168.1.101" [/quote:19ee5nlc] which is my local IP too.
internet ip address
[quote="driessen":yte5jksr]By using the example of Enrico, I got the same error as Antonio.[/quote:yte5jksr] I don't understand. Do you want my EXE to test it there? EMG
internet ip address
[quote="EnricoMaria":328obop1][quote="driessen":328obop1]By using the example of Enrico, I got the same error as Antonio.[/quote:328obop1] I don't understand. Do you want my EXE to test it there? EMG[/quote:328obop1] [code:328obop1] FUNCTION MAIN&#40;&#41; LOCAL aHosts INETINIT&#40;&#41; aHosts = INETGETHOSTS&#40; NETNAME&#40;&#41; &#41; INETCLEANUP&#40;&#41; MsgInfo&#40; aHosts&#91; 2 &#93; &#41; <<<< aqui el cambio RETURN NIL[/code:328obop1] Enrico I prove your sample and change ? with MsgInfo and then it works perfectly
internet ip address
José, [code:1qhan3wl] Error description&#58; Error BASE/1132 Bound error&#58; array access Args&#58; &#91; 1&#93; = A &#123; &#46;&#46;&#46; &#125; &#91; 2&#93; = N 2 [/code:1qhan3wl]
internet ip address
Antonio, Unfortunately all the samples above retreive the Local ip code not the internet one I have a function that retreives a html page and reads it, the problem it is not a 100% secure function as the page might change.... This is why i was looking for a replacement, here is the function anyway, function getmyip() LOCAL aEol := { Chr(13) + Chr(10), Chr(10) }, ; ctr := 0, ; lok := .f., ; myip := space(80), ; sLine,cfile cfile := CURDRIVE() + ":\" + CURDIR() + "\myip.txt" IF FILE(CFILE) ERASE (CFILE) ENDIF oUrl := tURL():New( "http://www.adresseip.com/" ) IF Empty( OUrl ) MSGINFO("URL NOT FOUND") RETURN NIL ENDIF oclient:=tipclienthttp():new(oUrl) IF Empty( oClient ) MSGINFO("Invalid url ") RETURN NIL ENDIF oClient:nConnTimeout := 20000 IF oClient:Open( oUrl ) IF ! oClient:ReadToFile( cFile ) MSGINFO("Generic error in writing." + cFile) ENDIF oClient:Close() endif IF FILE(CFILE) hFile := FOPEN(CFILE) WHILE HB_FReadLine( hFile, @sLine, aEol ) == 0 ctr++ IF subs(ALLTRIM(sLine),1,8) == "<SPAN ID" // ip is next line ctr := 1 lok := .t. ENDIF IF CTR = 2 .AND. lok myip := sline ENDIF END fclose(hFile) erase (cfile) ENDIF return ALLTRIM(myip) Richard
internet ip address
func GetMyIP( cURL ) #include "tip.ch" local cMyIP := "" local oUrl, oClient cURL := if( empty(cURL), "http://www.whatismyip.org/", cURL ) oUrl := tURL():New( cURL ) if !empty( oUrl ) oClient := tIPclient():new( oUrl ) if !empty( oClient ) oClient:nConnTimeOut := 20000 if oClient:Open( oUrl ) cMyIP := oClient:Read(80) oClient:Close() endif endif endif return cMyIP
internet ip address
[quote="Antonio Linares":t46fej02]José, [code:t46fej02] Error description&#58; Error BASE/1132 Bound error&#58; array access Args&#58; &#91; 1&#93; = A &#123; &#46;&#46;&#46; &#125; &#91; 2&#93; = N 2 [/code:t46fej02][/quote:t46fej02] Antonio, Verdaderamente, no entiendo, yo lo pruebo en mi equipo y me devuelve la IP pública, lo he verificado con "MyIP.es" y el resultado es el mismo. Quisieras por favor probar el exe que te envío junto con el código fuente correspondiente? <!-- m --><a class="postlink" href="http://www.mediafire.com/?5wd1bu19cdk">http://www.mediafire.com/?5wd1bu19cdk</a><!-- m --> Gracias desde ya.
internet ip address
Jose, Probado tu EXE y el mismo error <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> En Vista 32
internet ip address
[quote="Antonio Linares":2tgr0rep]Jose, Probado tu EXE y el mismo error <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> En Vista 32[/quote:2tgr0rep] En XP el resultado es este: [url=http&#58;//img145&#46;imageshack&#46;us/my&#46;php?image=dibujozz9&#46;jpg:2tgr0rep][img:2tgr0rep]http&#58;//img145&#46;imageshack&#46;us/img145/4299/dibujozz9&#46;th&#46;jpg[/img:2tgr0rep][/url:2tgr0rep] Serán diferencias entre sistemas operativos?
internet ip address
Posiblemente...
internet ip address
[quote="Richard Chidiak":2roav306]Antonio, Unfortunately all the samples above retreive the Local ip code not the internet one[/quote:2roav306] No, my sample retrieve the public IP. EMG
internet ip address
Enrico, Do you use a router ?
internet ip address
No, just a modem. Anyway, maybe the difference is XP vs. Vista. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
internet ip address
Enrico, >No, just a modem. Anyway, maybe the difference is XP vs. Vista. I am using XP Pro and a router. aHosts has a length of 1 and aHosts[1] returns my local IP address not my interent IP address. It must be that your function only works without a router. James
internet ip address
Probably. EMG
internet ip address
Yes, thats my guess, that the function is only valid with a modem, not with a router
internet ip address
[quote="Antonio Linares":3oc1sxqe]Yes, thats my guess, that the function is only valid with a modem, not with a router[/quote:3oc1sxqe] Probably that is the reason becouse I use a modem too.
internet ip address
[quote="Antonio Linares":2izddldw]Yes, thats my guess, that the function is only valid with a modem, not with a router[/quote:2izddldw] Antonio and all fws, I use a router and Vista business. The Enrico's function return 3 addresses: 1) my local ip address 192.168.2.100 2) my local ip address 192.168.147.1 3) my local ip address 192.168.172.1 Only the Otto's function return the external IP With the router, i think that is not present the external ip on the computer.
internet ip address
[quote="Ugo":1fv0pdxb]Only the Otto's function return the external IP[/quote:1fv0pdxb] Where is the Otto's function? I can't find it in this thread. EMG
internet ip address
I tested Mr. EMG's code. When my pc has two ip addresses, which i can see with ipconfig /all, the funtion returns two element array with two ip addresses. when ipconfig /all shows only one ip address it returns one element array only
internet ip address
[quote="EnricoMaria":2oo8cppo][quote="Ugo":2oo8cppo]Only the Otto's function return the external IP[/quote:2oo8cppo] Where is the Otto's function? I can't find it in this thread.[/quote:2oo8cppo] I'm sorry, I was wrong is the function of Richard Chidiak
internet ip address
Ok, but I don't like a function that relies on a specific web address. EMG