topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
txbrowse refresh() | Dear Marc & James,I am using FWH 8.08 and I confirm a refresh problem with the above provided sample.Try to add more records using the button, you will find that sometimes the xBrowse is not refreshed properly to display whole data, you will need to move thru records either thru mouse scroll wheel or keyboard to view some of the data. RegardsAnser |
txbrowse refresh() | Anser and Marc,>Try to add more records using the button, you will find that sometimes the xBrowse is not refreshed properly to display whole data, you will need to move thru records either thru mouse scroll wheel or keyboard to view some of the data. I have retested it and I still do not see a problem. I added 30 or 40 new records and never saw a problem.What do you mean by the "whole data?"I am wondering if you mean that sometimes the entire browse window is not filled with data? If this is what you mean, it is not a bug. The currently highlighted record is where the new record will be displayed. Sometimes if the new record is near the end of the file there will not be enough trailing records to fill the browse.For example, if the currently hightlighted record is the 2nd row in the browse, and you add a new record that becomes the 3rd to the last record in the index, then only 4 records will be displayed (regardless of how many more there are in the file), one record before and two records after.If you want a full screen of data, then you will have to program this into the append record routine. You will have to figure out how close to the end of the index the new record is, and move to the appropriate record needed to fill the browse. You will also have to figure out which row the new record is, and change the browse pointer to that row (this is oBrw:nAt, I think). And you will have to figure out how to do this if the file doesn't contain enough records to fill the browse. And you have to figure out if neither of the above applies and then do nothing.Personally, I think the current behavior is acceptable.Regards,James |
txbrowse refresh() | JamesI use txbrowse intensively in my app and refresh is very buggy when you use keyboard or mousewheel, top line of the browse is displayed often twice. In the above sample, once you added few records, try to move the keyboard arrow up or mousewheeli confirm the bad refresh behaviour,Richard |
txbrowse refresh() | What would help is if someone would modify the example so that it added a fixed sequence of numbers so that the same record values are added each time in order. Then you can describe how to recreate the problem step by step, e.g."Press the Add button 7 times, then scroll up to the top and one more past the top and you will see..."A few screenshots would also help.Otherwise I am having a difficult time seeing what others are saying is wrong.Regards,James |
txbrowse refresh() | James,Here is an AVI-file of the txbrowse problem.[url:1p48el07]http://www.vms.be/FWTest/txbrowse.avi[/url:1p48el07]Regards,Marc |
txbrowse refresh() | Marc,I looked at the video and I see the problem, however, I am not able to recreate that here. If you will send me your email address, I will send you my exe and you can see if it works or not there.Regards,James |
txbrowse totals and edit modes | Hi all.
Perhaps some FW users remember me.
My former name was Detlef Hoefner. After marriage my name has changed.
I am already retiree and reactivated my FWH version 10.2 with hobby purpose.
My problem is a txBrowse which doesn't show column totals and neither accepts edited values.
I can edit values but whe i leave the cells the former content remains visible.
Here my code :
[code=fw:3uobsnn1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrwPos <span style="color: #0000ff;">ID</span> <span style="color: #000000;">50</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"pos"</span> FOOTERS <span style="color: #0000ff;">COLOR</span> CLR_INK, CLR_PAPER FASTEDIT LINES<br /> oBrwPos:<span style="color: #000000;">AddColumn</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">" Datum "</span>, <span style="color: #000000;">{</span>|| pos->datum <span style="color: #000000;">}</span>, , , , <span style="color: #ff0000;">"CENTER"</span>, <span style="color: #000000;">86</span>, .F., .F., .t., , , , , .F., , , , , .F., , , <span style="color: #000000;">)</span><br /> oBrwPos:<span style="color: #000000;">AddColumn</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">" Leistung "</span>, <span style="color: #000000;">{</span>|| pos->leistung <span style="color: #000000;">}</span>, , , , <span style="color: #ff0000;">"LEFT"</span>, <span style="color: #000000;">430</span>, .F., .F., .t., , , , , .F., , , , , .F., , , <span style="color: #000000;">)</span><br /> oBrwPos:<span style="color: #000000;">AddColumn</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">" Anzahl "</span>, <span style="color: #000000;">{</span>|| pos->dauer <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"999"</span> , , , <span style="color: #ff0000;">"RIGH"</span>, <span style="color: #000000;">63</span>, .F., .F., .t., , , , , .F., , , , , .F., , , <span style="color: #000000;">)</span><br /> oBrwPos:<span style="color: #000000;">AddColumn</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">" Einheit "</span>, <span style="color: #000000;">{</span>|| pos->einheit <span style="color: #000000;">}</span>, , , , <span style="color: #ff0000;">"CENTER"</span>, <span style="color: #000000;">70</span>, .F., .F., .t., , , , , .F., , , , , .F., , , <span style="color: #000000;">)</span><br /> oBrwPos:<span style="color: #000000;">AddColumn</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">" Summe "</span>, <span style="color: #000000;">{</span>|| pos->summe <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"@E 99,999.99"</span> , , , <span style="color: #ff0000;">"RIGHT"</span>, <span style="color: #000000;">92</span>, .F., .F., .t., , , , , .F., , , , , .F., , , <span style="color: #000000;">)</span><br /> oBrwPos:<span style="color: #000000;">AddColumn</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">" MwSt-Satz "</span>, <span style="color: #000000;">{</span>|| pos->mwstsatz <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"@E 99.99"</span> , , , <span style="color: #ff0000;">"RIGHT"</span>, <span style="color: #000000;">66</span>, .F., .F., .t., , , , , .F., , , , , .F., , , <span style="color: #000000;">)</span><br /><br /> WITH OBJECT oBrwPos<br /> :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> :<span style="color: #000000;">nRowDividerStyle</span> := <span style="color: #000000;">1</span><br /> :<span style="color: #000000;">nColDividerStyle</span> := <span style="color: #000000;">3</span><br /> :<span style="color: #000000;">lHScroll</span> := .f.<br /> :<span style="color: #000000;">nDataLines</span> := <span style="color: #000000;">1</span><br /> :<span style="color: #000000;">lFastEdit</span> := .f.<br /> :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br /> :<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> CLR_BLACK, CLR_NO_FOCUS <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_DATE<br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_LISTBOX<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aEditListBound</span> := ;<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aEditListTxt</span> := aPosCfg<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_LISTBOX<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aEditListTxt</span> := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Std."</span>, <span style="color: #ff0000;">"Min."</span>, <span style="color: #ff0000;">"km"</span>, <span style="color: #ff0000;">"UE"</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@ €99,999.99'</span><br /> END<br /><br /> </div>[/code:3uobsnn1]
I'd be glad for any help.
Detlef |
txbrowse totals and edit modes | For a better description i put this screenshot here:
[img:14qsk92t]https://i.postimg.cc/jdCKwWbc/scr-shot.jpg[/img:14qsk92t]
I think that my problem is not a fault of my FWHX Version.
I believe it's caused by my missing FW-practice for over eight years <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
Therefore i appreciate any advice |
txbrowse totals and edit modes | Hola!
Cambia [code=fw:38leeoyb]<div class="fw" id="{CB}" style="font-family: monospace;"> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL</div>[/code:38leeoyb] por [code=fw:38leeoyb]<div class="fw" id="{CB}" style="font-family: monospace;"> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nFooterType</span> := AGGR_SUM</div>[/code:38leeoyb] y prueba
Y a la columna 5 define que es editable [code=fw:38leeoyb]<div class="fw" id="{CB}" style="font-family: monospace;">:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET</div>[/code:38leeoyb] |
txbrowse totals and edit modes | [code=fw:16lfm8dp]<div class="fw" id="{CB}" style="font-family: monospace;">FWNumFormat<span style="color: #000000;">(</span> <span style="color: #ff0000;">"E"</span>, <span style="color: #ff0000;">","</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrwPos <span style="color: #0000ff;">ID</span> <span style="color: #000000;">50</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"pos"</span> FOOTERS <span style="color: #0000ff;">COLOR</span> CLR_INK, CLR_PAPER FASTEDIT CELL LINES;<br /> COLUMNS <span style="color: #ff0000;">"Datum"</span>, <span style="color: #ff0000;">"Leistung"</span>. <span style="color: #ff0000;">"dauer"</span>, <span style="color: #ff0000;">"Einheit"</span>,<span style="color: #ff0000;">"Summe"</span>,<span style="color: #ff0000;">"mwstsatz"</span> ;<br /> HEADERS <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"Anzahl"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"MwSt-Satz"</span><br /><br /> WITH OBJECT oBrwPos<br /> <span style="color: #B900B9;">//:nMarqueeStyle := MARQSTYLE_HIGHLROW</span><br /> :<span style="color: #000000;">nRowDividerStyle</span> := <span style="color: #000000;">1</span><br /> :<span style="color: #000000;">nColDividerStyle</span> := <span style="color: #000000;">3</span><br /> :<span style="color: #000000;">lHScroll</span> := .f.<br /> :<span style="color: #000000;">nDataLines</span> := <span style="color: #000000;">1</span><br /> :<span style="color: #000000;">lFastEdit</span> := .f.<br /> :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br /> :<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> CLR_BLACK, CLR_NO_FOCUS <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">// :MakeTotals() // NOT HERE</span><br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_DATE<br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_LISTBOX<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aEditListBound</span> := ;<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aEditListTxt</span> := aPosCfg<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_LISTBOX<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aEditListTxt</span> := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Std."</span>, <span style="color: #ff0000;">"Min."</span>, <span style="color: #ff0000;">"km"</span>, <span style="color: #ff0000;">"UE"</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@ €99,999.99'</span><br /> <br /> :<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// Now xbrowse knows which columns to total</span><br />END<br /><br /> </div>[/code:16lfm8dp] |
txbrowse totals and edit modes | Many thanks to Cesar and Mr. Rao.
Your advices look very helpful.
I'll give them a try when I’m back home on Sunday.
Does anyone still have a clue why selected items from the browse selectboxes are not written into the dbf fields?
Thanks again |
txbrowse totals and edit modes | [quote:2uaazpie]Does anyone still have a clue why selected items from the browse selectboxes are not written into the dbf fields?
[/quote:2uaazpie]
We know very well.
The codebocks you have used in AddColumn() methods are readonly. They can not be used to assign values.
That is the reason We (FWH Team) recommends use of COLUMNS clause. In that case, xbrowse itself internally generate the correct codeblocks.
Please implement our recommendation (this is official recommendation of FWH) using COLUMNS clause as shown in my previous post. |
txbrowse totals and edit modes | Many thanks, Mr. Rao.
I'll follow your recommendations. |
txbrowse/twbrowse support 2 bytes language word /char ? | Hi,
How could xbrowse/twbrowse suport 2 bytes language word as 1 char ?
I know lfastedit:=.t., method keychar() can transmit a 1 byte char as 0-9,a-Z into tget . How could transmit 2 bytes word input into tget?
Thanks !
Shuming Wang |
txbrowse/twbrowse support 2 bytes language word /char ? | On DOS,we can use :
while nextkey()>0
cstr+=char(nextkey())
inkey()
end
keyboard cstr
To get the keyboard buffer, and transport into current oget.
Now, on windows , nextkey() not work.
Is there any function to get the keyboard buffer ?
<!-- m --><a class="postlink" href="http://docs.mandragor.org/files/Common_libs_documentation/allegro/index006.html">http://docs.mandragor.org/files/Common_ ... ex006.html</a><!-- m -->
Might offer a way.
Thanks !
Shuming Wang |
txbrowse/twbrowse support 2 bytes language word /char ? | Shuming,
RE: keyboard buffer
There are lots of answers to your question. What exactly are you trying to do?
James |
txbrowse/twbrowse support 2 bytes language word /char ? | James
I want xbrowse/wbrowse/txbrowse edit as excel and support Chinese 2 bytes word.
browse--keychar()--col:edit()
For example:
browse as
name descrip tel
Bob computer 920888888
张三 [color=blue:3ilzkmyr]程序员 [/color:3ilzkmyr] 023999999
李四 系统分析师 139999999
When browse cursor at row 2,col3 , and type 9, then browse call keychar() method ,then call oCol:Edit( nKey ) and create tget and the pre typed chr(9) will become the first char on the get as 9
when browser cursor at row 2 ,col2, and type Chinese words 程序员,then oget should display 程序员,but oCol:Edit( nKey ) only transport the first char, a Chinse word contianed 2 bytes, sometimes many bytes.
If we can get the keyboard buffer and do a keybord command , then transport all the words into the oget .
Regards !
Shuming Wang |
txbrowse/twbrowse support 2 bytes language word /char ? | Shuming,
>If we can get the keyboard buffer and do a keybord command , then transport all the words into the oget .
I am guessing that it is a whole lot more complicated than that.
I have no experience with Chinese (or any language other than English) so I can't offer much help. There is a data, nLastKey, that contains the last keystroke typed, but I don't know if that will help. nLastkey is part of the TWindow class so all controls inherit it.
I don't quite understand when you say a Chinese word 3 characters long is entered, but only the first character ends up in the Get. Do you mean that three keystrokes are used to create this word, or?
Perhaps someone with other language experience can help.
James |
txbrowse/twbrowse support 2 bytes language word /char ? | [quote="James Bott":6072ds56]I don't quite understand when you say a Chinese word 3 characters long is entered, but only the first character ends up in the Get. Do you mean that three keystrokes are used to create this word, or?[/quote:6072ds56]
James,
I have the same problem!
see:
<!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?p=28186#28186">http://fivetechsoft.com/forums/viewtopi ... 8186#28186</a><!-- m -->
do you remember?
Shuming,
can you test the sample and report here?
Is the same problem?
Sorry for my bad english! |
txbrowse/twbrowse support 2 bytes language word /char ? | Ugo,James,
Yes! the click, copy,paste,Ctrl+V of tget now works well.
Chinse input might be some words at the same time , can take as some chars at the same time .
Thanks!
Shuming Wang |
txbrowse/twbrowse support 2 bytes language word /char ? | [quote="ShumingWang":2dt55din]Yes! the click, copy,paste,Ctrl+V of tget now works well. [/quote:2dt55din]
Shuming,
have you tested my sample?
You can find the sample at
<!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=6251&start=0">http://fivetechsoft.com/forums/viewtopi ... 51&start=0</a><!-- m -->
I Tested now and do not work!!
I can see the special characters after Ctrl+V but when exit from the control the char change in "?"
in the case of use the clipboard the paste button, insert directly the "?" char(s).
Now I use FWHX 7.04, xHarbour 0.99.71 from CVS and Vista Business.
The new version of FWH change this situation? |
txbrowse/twbrowse support 2 bytes language word /char ? | Ugo,
Mine's is fwh2.5 .
Shuming Wang |
txtfile | some have a sample with txtfile ?
i wish write a message... live it's possible ? |
txtfile | Look
..\samples\redefine.prg
..\samples\srcview.prg
..\samples\testfile.prg |
txtfile | Why not using :
FCreate()
FWrite()
FClose() |
txtfile | Driessen,cnavarro,
I have this problem I create txtfile and show each lines into xbrowse on a dialog . On anothe function I use the function scrivitrace() to add text on txtfile class
when I refresh the xbrowse it make error
Local oBrwTesto
Local oText:=TTxtFile():New( "TimeTrace.txt" )
.....
DEFINE DIALOG oDlgCicloMater
// box trace
cTitle:= "Ciclo operazioni"
@ 100, 05 XBROWSE oBrwTesto OF oDlgCicloMater ;
SIZE 220,80 PIXEL ;
COLUMNS "cLine";
OBJECT oText;
FOOTERS NOBORDER
WITH OBJECT oBrwTesto:cLine
:bFooter:= {|| "Linea = " + LTrim( Str( oText:RecNo() ) ) + " / " + LTrim( Str( oText:RecCount() ) )}
:cHeader:= cTitle
END
WITH OBJECT oBrwTesto
:nfreeze := 1
:nMarqueeStyle:= 7
:nStretchCol := 1
:nRowHeight := 20
:lRecordSelector := .f.
:lHScroll:=.f.
END
oBrwTesto:CreateFromCode()
oDlgCicloMater:bStart := { || SysRefresh(), start(oDlgCicloMater,nGiri,oBrwTesto,oText) }
ACTIVATE DIALOG oDlgCicloMater center
return nil
on start function i use
Scrivitrace(oText,"bla bla bla ",oBrwTesto)
....
return nil
Function Scrivitrace(oText,ctesto,oBrwTesto)
if oText:Open()
oText:Add( ctesto )
oText:Close()
endif
oBrwTesto:refresh() <------------------------error
return nil
how I can resolve it ? |
uCharToVal | On this topic [url]uCharToVal( "Monday, 04 March 2019", "D" )[/url] Nages sad
[quote:2qhs5f90]uCharToVal( "Monday, 04 March 2019", "D" )
works well with English only.
From FWH1904 onwards, it will work with other codepage languages.[/quote:2qhs5f90]
I tried today and it not run ( I tested with FiveWin for Harbour ver. Jannuary 2020)
[b:2qhs5f90]My test[/b:2qhs5f90]
[code=fw:2qhs5f90]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />request hb_lang_it<br />request hb_codepage_itwin<br /><br /><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> dtoday<br /><span style="color: #00C800;">Local</span> cText_date<br /><br /> HB_LANGSELECT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"IT"</span> <span style="color: #000000;">)</span><br /> HB_SETCODEPAGE<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ITWIN"</span> <span style="color: #000000;">)</span><br /><br /> dtoday:=date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> cText_date:=date2txt<span style="color: #000000;">(</span>dToday<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>cText_date<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span> uCharToVal<span style="color: #000000;">(</span> cText_date, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Date2Txt<span style="color: #000000;">(</span>dTemp<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> f, m, cMese, dFech,dDay,d<br /> <span style="color: #00C800;">Local</span> i,c<br /> <span style="color: #00C800;">local</span> aMesi<span style="color: #000000;">[</span> <span style="color: #000000;">12</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">local</span> aWeek<span style="color: #000000;">[</span> <span style="color: #000000;">7</span> <span style="color: #000000;">]</span><br /><br /> AEval<span style="color: #000000;">(</span> aMesi, <span style="color: #000000;">{</span> |c,i| aMesi<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := NToCMonth<span style="color: #000000;">(</span> i <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> AEval<span style="color: #000000;">(</span> aWeek, <span style="color: #000000;">{</span> |c,i| aWeek<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := NToCDOW<span style="color: #000000;">(</span> i <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> f:=DTOS <span style="color: #000000;">(</span>dTemp<span style="color: #000000;">)</span><br /> m:=MONTH<span style="color: #000000;">(</span>dTemp<span style="color: #000000;">)</span><br /> d:=dow<span style="color: #000000;">(</span>dtemp<span style="color: #000000;">)</span><br /><br /> cMese:=<span style="color: #0000ff;">LEFT</span><span style="color: #000000;">(</span><span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>m<><span style="color: #000000;">0</span>, aMesi<span style="color: #000000;">[</span>m<span style="color: #000000;">]</span> ,<span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">3</span><span style="color: #000000;">)</span><br /> dday :=<span style="color: #0000ff;">LEFT</span><span style="color: #000000;">(</span><span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>d<><span style="color: #000000;">0</span>, oemtoansi<span style="color: #000000;">(</span>aWeek<span style="color: #000000;">[</span>d<span style="color: #000000;">]</span><span style="color: #000000;">)</span> ,<span style="color: #ff0000;">""</span><span style="color: #000000;">)</span>,<span style="color: #000000;">3</span><span style="color: #000000;">)</span><br /><br /> dFech:=<span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>m<><span style="color: #000000;">0</span>,dday+<span style="color: #ff0000;">", "</span>+ <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span>f,<span style="color: #000000;">7</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">' '</span>+cMese+<span style="color: #ff0000;">' '</span>+<span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span>f,<span style="color: #000000;">1</span>,<span style="color: #000000;">4</span><span style="color: #000000;">)</span>,<span style="color: #ff0000;">''</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span>dFech<span style="color: #000000;">)</span></div>[/code:2qhs5f90]
Any solution ? |
uCharToVal | [code=fw:3lv6hb0w]<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 />REQUEST hb_lang_it<br />REQUEST hb_codepage_itwin<br /><br /><span style="color: #00C800;">FUNCTION</span> Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> dtoday, dDate<br /> <span style="color: #00C800;">LOCAL</span> cText_Date<br /><br /> SET DATE BRITISH<br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /><br /> HB_LANGSELECT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"IT"</span> <span style="color: #000000;">)</span><br /> HB_SETCODEPAGE<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ITWIN"</span> <span style="color: #000000;">)</span><br /><br /> dToday := Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> dDate := uCharToVal<span style="color: #000000;">(</span> dToday, <span style="color: #ff0000;">'D'</span> <span style="color: #000000;">)</span><br /> cText_date := Date2txt<span style="color: #000000;">(</span> dDate <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> cText_Date <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span> dDate <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Date2Txt<span style="color: #000000;">(</span> dTemp <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> f, m, cMese, dFech, dDay, d, d1<br /> <span style="color: #00C800;">LOCAL</span> i, c<br /> <span style="color: #00C800;">LOCAL</span> aMesi<span style="color: #000000;">[</span> <span style="color: #000000;">12</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">LOCAL</span> aWeek<span style="color: #000000;">[</span> <span style="color: #000000;">7</span> <span style="color: #000000;">]</span><br /><br /> AEval<span style="color: #000000;">(</span> aMesi, <span style="color: #000000;">{</span> |c, i| aMesi<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := NToCMonth<span style="color: #000000;">(</span> i <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> AEval<span style="color: #000000;">(</span> aWeek, <span style="color: #000000;">{</span> |c, i| aWeek<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := NToCDOW<span style="color: #000000;">(</span> i <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> f := DTOS <span style="color: #000000;">(</span> Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> m := MONTH<span style="color: #000000;">(</span> Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> d := DAY<span style="color: #000000;">(</span> Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> d1 := Dow<span style="color: #000000;">(</span> Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> cMese := <span style="color: #0000ff;">LEFT</span><span style="color: #000000;">(</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> m <> <span style="color: #000000;">0</span>, aMesi<span style="color: #000000;">[</span>m<span style="color: #000000;">]</span> ,<span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /><br /> dday := <span style="color: #0000ff;">LEFT</span><span style="color: #000000;">(</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> d <> <span style="color: #000000;">0</span>, OemToAnsi<span style="color: #000000;">(</span>aWeek<span style="color: #000000;">[</span>d<span style="color: #000000;">]</span> <span style="color: #000000;">)</span> ,<span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /><br /> dFech := <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> m <> <span style="color: #000000;">0</span>, dday + <span style="color: #ff0000;">", "</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> f,<span style="color: #000000;">7</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">' '</span> + cMese + <span style="color: #ff0000;">' '</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> f,<span style="color: #000000;">1</span>,<span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span> dFech <span style="color: #000000;">)</span><br /> </div>[/code:3lv6hb0w] |
uCharToVal | [size=200:2hqdcc6d][b:2hqdcc6d]???????????????[/b:2hqdcc6d][/size:2hqdcc6d]
I wish converte the string [b:2hqdcc6d]"Mar, 07, Apr 2020 "[/b:2hqdcc6d] into date format [b:2hqdcc6d]07/04/2020 [/b:2hqdcc6d]
[b:2hqdcc6d] your test is wrong [/b:2hqdcc6d]
it is logic ( on you test) Msginfo( dDate ) show the date [b:2hqdcc6d]07/04/2020 [/b:2hqdcc6d]
if you read Nages sentence you can understood another question
On English Language if you make
[code=fw:2hqdcc6d]<div class="fw" id="{CB}" style="font-family: monospace;"> cText_date := Date2txt<span style="color: #000000;">(</span> dDate <span style="color: #000000;">)</span><br /><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span> uCharToVal<span style="color: #000000;">(</span> cText_date, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:2hqdcc6d]
it return the right date
on Italian language not run ok |
uCharToVal | [code=fw:3mbr6jt2]<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 />REQUEST HB_Lang_IT<br />REQUEST HB_CODEPAGE_ITWIN<br /><br /><span style="color: #00C800;">STATIC</span> nLanguage<br /><br /><span style="color: #00C800;">FUNCTION</span> Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> dtoday, dDate, dItalia<br /> <span style="color: #00C800;">LOCAL</span> cText_Date<br /><br /> <span style="color: #00C800;">DEFAULT</span> nLanguage := FWSetLanguage<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> SET DATE ITALIAN<br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /> SET DATE FORMAT <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"dd-mm-yyyy"</span><br /><br /> HB_LANGSELECT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"IT"</span> <span style="color: #000000;">)</span><br /> HB_SETCODEPAGE<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ITWIN"</span> <span style="color: #000000;">)</span><br /><br /> FWSetLanguage<span style="color: #000000;">(</span> <span style="color: #000000;">6</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Italian language</span><br /><br /> dToday := Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> dDate := uCharToVal<span style="color: #000000;">(</span> dToday, <span style="color: #ff0000;">'D'</span> <span style="color: #000000;">)</span><br /> dItalia := dDate<br /><br /> cText_date := Date2txt<span style="color: #000000;">(</span> dDate <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> cText_Date <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span> dItalia <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Date2Txt<span style="color: #000000;">(</span> dItalia <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> f, m, cMese, dFech, dDay, d, d1<br /> <span style="color: #00C800;">LOCAL</span> i, c<br /> <span style="color: #00C800;">LOCAL</span> aMesi<span style="color: #000000;">[</span> <span style="color: #000000;">12</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">LOCAL</span> aWeek<span style="color: #000000;">[</span> <span style="color: #000000;">7</span> <span style="color: #000000;">]</span><br /><br /> AEval<span style="color: #000000;">(</span> aMesi, <span style="color: #000000;">{</span> |c, i| aMesi<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := NToCMonth<span style="color: #000000;">(</span> i <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> AEval<span style="color: #000000;">(</span> aWeek, <span style="color: #000000;">{</span> |c, i| aWeek<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := NToCDOW<span style="color: #000000;">(</span> i <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> f := DTOS <span style="color: #000000;">(</span> Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> m := MONTH<span style="color: #000000;">(</span> Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> d := DAY<span style="color: #000000;">(</span> Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> d1 := Dow<span style="color: #000000;">(</span> Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> cMese := <span style="color: #0000ff;">LEFT</span><span style="color: #000000;">(</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> m <> <span style="color: #000000;">0</span>, aMesi<span style="color: #000000;">[</span>m<span style="color: #000000;">]</span> ,<span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /><br /> dday := <span style="color: #0000ff;">LEFT</span><span style="color: #000000;">(</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> d1 <> <span style="color: #000000;">0</span>, OemToAnsi<span style="color: #000000;">(</span>aWeek<span style="color: #000000;">[</span>d1<span style="color: #000000;">]</span> <span style="color: #000000;">)</span> ,<span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /><br /> dFech := <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> m <> <span style="color: #000000;">0</span>, dday + <span style="color: #ff0000;">", "</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> f,<span style="color: #000000;">7</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">' '</span> + cMese + <span style="color: #ff0000;">' '</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> f,<span style="color: #000000;">1</span>,<span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">)</span><br /> <br /> dItalia := dFech<br /><br /> <span style="color: #B900B9;">// ? dItalia, dFech</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> dItalia <span style="color: #000000;">)</span><br /> </div>[/code:3mbr6jt2] |
uCharToVal | First thing:
You do not need to write such long and tedious functions to convert date into text.
Instead, you can use FW_TRANSFORM()
Please try this:
[quote:3ir9zmy1] dDate := Date()
? FW_TRANSFORM( dDate--, "ddd, dd mmm yyyy" ), FW_TRANSFORM( dDate--, "dddd, dd mmmm yyyy" ), ;
FW_TRANSFORM( dDate--, "ddd, dd-mmm-yyyy" ), FW_TRANSFORM( dDate--, "dddd, dd-mmmm-yyyy" )
[/quote:3ir9zmy1]
[url=https://imageshack.com/i/plaAW650p:3ir9zmy1][img:3ir9zmy1]https://imagizer.imageshack.com/v2/xq90/921/aAW650.png[/img:3ir9zmy1][/url:3ir9zmy1] |
uCharToVal | Text to Date:
Please try this program:
[code=fw:1ocyrwog]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST HB_LANG_IT<br />REQUEST HB_CODEPAGE_ITWIN<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> dDate := Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cDate<br /><br /> HB_LANGSELECT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"IT"</span> <span style="color: #000000;">)</span><br /> HB_SETCODEPAGE<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ITWIN"</span> <span style="color: #000000;">)</span><br /><br /> SET DATE ITALIAN<br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /><br /> ? cDate := FW_TRANSFORM<span style="color: #000000;">(</span> --dDate, <span style="color: #ff0000;">"ddd, dd mmm yyyy"</span> <span style="color: #000000;">)</span>, uCharToVal<span style="color: #000000;">(</span> cDate, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">)</span>, ;<br /> cDate := FW_TRANSFORM<span style="color: #000000;">(</span> --dDate, <span style="color: #ff0000;">"dddd, dd mmmm yyyy"</span> <span style="color: #000000;">)</span>, uCharToVal<span style="color: #000000;">(</span> cDate, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1ocyrwog]
[url=https://imageshack.com/i/poQrzYlDp:1ocyrwog][img:1ocyrwog]https://imagizer.imageshack.com/v2/xq90/924/QrzYlD.png[/img:1ocyrwog][/url:1ocyrwog] |
uCharToVal | [quote:78x18mqk]I tried today and it not run ( I tested with FiveWin for Harbour ver. Jannuary 2020)
[/quote:78x18mqk]
Mr. Silvio
You are right. There is a bug. Conversion of text to date is working when and only when the month name is at the beginning of the text or is preceded by a space character but not any character like "-" or "/".
Thanks for pointing out this.
We are fixing this in the next version.
We suggest this fix for now.
\fwh\source\valtostr.prg.
static function dAlphaToDate( cDate )
Please locate these lines:
[code=fw:78x18mqk]<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;">12</span><br /> <span style="color: #00C800;">if</span> FW_AT<span style="color: #000000;">(</span> <span style="color: #ff0000;">" "</span> + <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> NTOCMonth<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">" "</span> + cDate <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> m := n<br /> exit<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span> n<br /> </div>[/code:78x18mqk]
Please replace these lines with this revised code:
[code=fw:78x18mqk]<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;">12</span><br /> c := NTOCMonth<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> FW_At<span style="color: #000000;">(</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> c, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, cDate, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .t. <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> .or. FW_At<span style="color: #000000;">(</span> c, cDate, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .t. <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> m := n<br /> EXIT<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> </div>[/code:78x18mqk]
This should solve the issue raised by Mr. Silvio. |
uCharToVal | [b:3o82jsv5]Nages Now run ok ...[/b:3o82jsv5]
I use it on my application where I have the date as "Merc, 8 Apr 2020" for a sample on gets
[img:3o82jsv5]https://i.postimg.cc/yxGcscyk/dta.png[/img:3o82jsv5]
As you can see here I use get and you XbrGetDate func because on dtpicker I cannot set a calendar limit
then I have procedures and many function need the format 8/04/2020 and so I need to recovert the cdate from "Merc, 8 Apr 2020" string
Now these solutions are good |
uCharToVal | [quote:hmkmd268]Now these solutions are good
[/quote:hmkmd268]
So is your problem solved now?
For your information, we can set range for normal dtpicker also from the next release. This will be useful to you and many others. |
uCharToVal | yes the problem is solved
i am trying to understand how to insert in my source.
Nice idea to implement date limits in datepick even if I really like your calendar created with xbrowse |
uCharToVal returns ""01/01/2020"" as 20/09/0090 | Hi Rao,
Is my usage of uCharToVal() wrong?
[code=fw:3w2b88c7]<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 />proc main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> set century <span style="color: #0000ff;">on</span><br /> set date british<br /><br /> ? uCharToVal<span style="color: #000000;">(</span><span style="color: #ff0000;">"01/01/2020"</span>, <span style="color: #ff0000;">"D"</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span><br /> </div>[/code:3w2b88c7]
The above snippet gave result as 20/09/0090.
Compiled with Harbour+FWH1912
TIA |
uCharToVal returns ""01/01/2020"" as 20/09/0090 | ? DToS( CToD( "01/01/2020" ) ) |
uCharToVal returns ""01/01/2020"" as 20/09/0090 | We will look into the function. |
uCharToVal returns ""01/01/2020"" as 20/09/0090 | The bug is fixed in version FWH2005 to be released.
You can make this correction and test.
In the module \fwh\source\function\valtostr.prg:
please replace the existing
static function dCharToDate( cDate )
with the following revised function:
[code=fw:1eveht3r]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> dCharToDate<span style="color: #000000;">(</span> cDate <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cFormat, cc, cfmt<br /> <span style="color: #00C800;">local</span> dDate<br /><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> cc := Upper<span style="color: #000000;">(</span> cDate <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != Lower<span style="color: #000000;">(</span> cDate <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> dAlphaToDate<span style="color: #000000;">(</span> cc <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> Len<span style="color: #000000;">(</span> cDate <span style="color: #000000;">)</span> >= <span style="color: #000000;">8</span> .and. IsDigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. IsDigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> dDate := SToD<span style="color: #000000;">(</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> dDate<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> Len<span style="color: #000000;">(</span> cDate <span style="color: #000000;">)</span> >= <span style="color: #000000;">10</span> .and. IsDigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. !IsDigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. ;<br /> !IsDigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> dDate := StoD<span style="color: #000000;">(</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">9</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> dDate<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #B900B9;">// check for single digit date/month</span><br /> <span style="color: #00C800;">if</span> !IsDigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cDate := <span style="color: #ff0000;">"0"</span> + cDate<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> !IsDigit<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cDate := <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"0"</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cDate, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #B900B9;">//</span><br /><br /> cFormat := Lower<span style="color: #000000;">(</span> Set<span style="color: #000000;">(</span> _SET_DATEFORMAT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> dDate := CToD<span style="color: #000000;">(</span> cDate <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> dDate <span style="color: #000000;">)</span><br /> cc := <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> cFormat, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">for</span> each cFmt in <span style="color: #000000;">{</span> <span style="color: #ff0000;">"dd/mm/yy"</span>, <span style="color: #ff0000;">"mm/dd/yy"</span>, <span style="color: #ff0000;">"yy/mm/dd"</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">if</span> !<span style="color: #000000;">(</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> cFmt, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> == cc <span style="color: #000000;">)</span><br /> SET<span style="color: #000000;">(</span> _SET_DATEFORMAT, cFmt <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span> dDate := CTOD<span style="color: #000000;">(</span> cDate <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> EXIT<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><br /> <span style="color: #00C800;">endif</span><br /> Set<span style="color: #000000;">(</span> _SET_DATEFORMAT, cFormat <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> dDate<br /> </div>[/code:1eveht3r]
We'll be glad if you can test and let us have your feedback. |
uCharToVal returns ""01/01/2020"" as 20/09/0090 | Hi Rao,
Yes I got the expected result with the fixed version.
Thank you |
uHTTPD. Servidor WEB en Harbour | Buenas
En \harbour3\contrib\hbhttpd tenemos un servidor Web.
Llevo 1 hora, y estoy enamorado de este servidor web, aunque me gustaría tener más información si alguien lo esta usando.
¿ Alguien lo usa ? ¿ Algún tipo de limitación ?
Es increíble, puedes dotar a tu aplicación de un servidor web, que acceda a tus dbfs, y devolver esa información al cliente,
sin instalar ni apaches , php, etc... |
uHTTPD. Servidor WEB en Harbour | [quote="thefull":233khvqv]
Es increíble, puedes dotar a tu aplicación de un servidor web, que acceda a tus dbfs, y devolver esa información al cliente,
sin instalar ni apaches , php, etc...[/quote:233khvqv]
Has visto el de Lorenzo Fiorini, anunciado en la lista harbour ? <!-- m --><a class="postlink" href="https://github.com/lfiorini/hisbay">https://github.com/lfiorini/hisbay</a><!-- m --> |
uHTTPD. Servidor WEB en Harbour | Gracias, le echaré un vistazo.
Por cierto, si quieren enviar XML en vez de HTML como respuesta;
[code=fw:19yvp1gk]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> xml_test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> cXml := <span style="color: #000000;">[</span> <PETICION <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"ADD_SALIDA"</span>><span style="color: #000000;">]</span>+;<br /> <span style="color: #000000;">[</span> <LPARAMS><span style="color: #000000;">]</span>+;<br /> <span style="color: #000000;">[</span> <PARAM <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"CODIGO"</span> tipo=<span style="color: #ff0000;">"string"</span> valor=<span style="color: #ff0000;">"001"</span>/><span style="color: #000000;">]</span>+;<br /> <span style="color: #000000;">[</span> <PARAM <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"SALIDAS"</span>/><span style="color: #000000;">]</span>+;<br /> <span style="color: #000000;">[</span> <prueba>test</prueba><span style="color: #000000;">]</span>+;<br /> <span style="color: #000000;">[</span> </LPARAMS><span style="color: #000000;">]</span>+;<br /> <span style="color: #000000;">[</span> </PETICION><span style="color: #000000;">]</span><br /><br /> UAddHeader<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Content-Type"</span>, <span style="color: #ff0000;">"text/xml;charset=ISO-8859-1"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> UWrite<span style="color: #000000;">(</span> cXml <span style="color: #000000;">)</span></div>[/code:19yvp1gk]
saludos |
uHTTPD. Servidor WEB en Harbour | Rafa,
gracias por comentárnoslo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
uHTTPD. Servidor WEB en Harbour | [quote="thefull":2mvygh9e]...En [b:2mvygh9e][color=#FF0000:2mvygh9e]\harbour3\contrib\hbhttpd[/color:2mvygh9e][/b:2mvygh9e] tenemos un servidor Web...[/quote:2mvygh9e]
Y donde consigo ese servidor. |
uHTTPD. Servidor WEB en Harbour | [quote="JmGarcia":3lu2g423][quote="thefull":3lu2g423]...En [b:3lu2g423][color=#FF0000:3lu2g423]\harbour3\contrib\hbhttpd[/color:3lu2g423][/b:3lu2g423] tenemos un servidor Web...[/quote:3lu2g423]
Y donde consigo ese servidor.[/quote:3lu2g423]
Jm, esta en la carpeta contrib del código fuente del Harbour
Un saludo |
uHTTPD. Servidor WEB en Harbour | [quote="cnavarro":15wwkc15]..esta en la carpeta contrib del código fuente del Harbour...[/quote:15wwkc15]
Perdona mi ignorancia y como consigo el codigo fuente de Harbour.
Solo encuentro el de xHarbour <!-- m --><a class="postlink" href="http://downloads.sourceforge.net/xharbour/xharbour-1.2.1.src.zip">http://downloads.sourceforge.net/xharbo ... .1.src.zip</a><!-- m --> y aquí no viene.
Aqui <!-- m --><a class="postlink" href="http://sourceforge.net/projects/harbour-project/files/source/3.0.0/harbour-3.0.0-src.zip/download">http://sourceforge.net/projects/harbour ... p/download</a><!-- m --> he encontrado el directorio [b:15wwkc15]\harbour-3.0.0\examples\httpsrv[/b:15wwkc15]y no se si es este.
En un fichero readme.txt dice:
[code=fw:15wwkc15]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br /> * $Id: readme.txt 13467 2010-01-04 17:42:28Z vszakats $<br /> */</span><br /><br />uHTTPD micro web <span style="color: #00C800;">server</span><br /><br />Build it without GD: <span style="color: #000000;">hbmk2</span> uhttpd.hbp modules.hbp<br />Build it with GD: <span style="color: #000000;">hbmk2</span> uhttpdgd.hbp modulesg.hbp<br /> <span style="color: #000000;">[</span> This one needs bgd.dll. Please download it <span style="color: #0000ff;">from</span>:<br /> http:<span style="color: #B900B9;">//www.libgd.org/releases/gd-latest-win32.zip ]</span><br /><br /><span style="color: #0000ff;">To</span> see accepted parameters run: <span style="color: #000000;">uhttpd</span> -?<br />Parameters can also be defined using uhttpd.ini file.<br /><br />Once started connect <span style="color: #0000ff;">to</span> uhttpd using:<br /><span style="color: #000000;">http</span>:<span style="color: #B900B9;">//localhost:8082</span><br /><span style="color: #0000ff;">to</span> see <span style="color: #00C800;">default</span> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">page</span>.<br /><br />Francesco</div>[/code:15wwkc15]
¿ Es este ? |
uHTTPD. Servidor WEB en Harbour | [quote="JmGarcia":2m0sz8zz][quote="cnavarro":2m0sz8zz]..esta en la carpeta contrib del código fuente del Harbour...[/quote:2m0sz8zz]
Perdona mi ignorancia y como consigo el codigo fuente de Harbour.
Solo encuentro el de xHarbour <!-- m --><a class="postlink" href="http://downloads.sourceforge.net/xharbour/xharbour-1.2.1.src.zip">http://downloads.sourceforge.net/xharbo ... .1.src.zip</a><!-- m --> y aquí no viene.
Aqui <!-- m --><a class="postlink" href="http://sourceforge.net/projects/harbour-project/files/source/3.0.0/harbour-3.0.0-src.zip/download">http://sourceforge.net/projects/harbour ... p/download</a><!-- m --> he encontrado el directorio [b:2m0sz8zz]\harbour-3.0.0\examples\httpsrv[/b:2m0sz8zz]y no se si es este.
En un fichero readme.txt dice:
[code=fw:2m0sz8zz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br /> * $Id: readme.txt 13467 2010-01-04 17:42:28Z vszakats $<br /> */</span><br /><br />uHTTPD micro web <span style="color: #00C800;">server</span><br /><br />Build it without GD: <span style="color: #000000;">hbmk2</span> uhttpd.hbp modules.hbp<br />Build it with GD: <span style="color: #000000;">hbmk2</span> uhttpdgd.hbp modulesg.hbp<br /> <span style="color: #000000;">[</span> This one needs bgd.dll. Please download it <span style="color: #0000ff;">from</span>:<br /> http:<span style="color: #B900B9;">//www.libgd.org/releases/gd-latest-win32.zip ]</span><br /><br /><span style="color: #0000ff;">To</span> see accepted parameters run: <span style="color: #000000;">uhttpd</span> -?<br />Parameters can also be defined using uhttpd.ini file.<br /><br />Once started connect <span style="color: #0000ff;">to</span> uhttpd using:<br /><span style="color: #000000;">http</span>:<span style="color: #B900B9;">//localhost:8082</span><br /><span style="color: #0000ff;">to</span> see <span style="color: #00C800;">default</span> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">page</span>.<br /><br />Francesco</div>[/code:2m0sz8zz]
¿ Es este ?[/quote:2m0sz8zz]
Mira aqui
[url:2m0sz8zz]https://github.com/harbour/core/tree/master/contrib/hbhttpd[/url:2m0sz8zz] |
uLoadObject y Blinker 6.0 | Tengo un problema con Blinker 6.0 que no tenía con el 4.0
Normalmente guardo diversos arreglos con lSaveObject, pero cuando intento recuperarlos con uLoadObject, con Blinker 6.0, no dá error, pero no recupera los datos guardados.
¿Como puede ser, si con Blinker 4.0 sí los lee?
Algún parámetro de Blinker 6.0 debe de ser el culpable, pero ¿Cúal? |
uLoadObject y Blinker 6.0 | Manuel,
has probado a comparar los ficheros salvados en disco para ver si son iguales ó existe alguna diferencia ? |
uLoadObject y Blinker 6.0 | Tengo varios programas corriendo. Todos utilizan ficheros salvados con lSaveObject y todos funcionan con Blinker 4.0, y todos fallan con Blinker 6.0 o Blinker 7.0. El caso es que no dan error de lectura, simplemente no cargan los datos.
Y lo unico que falla es uLoadObject, porque los crea bien con lSaveObject, pero esos mismo ficheros, después no lo lee.
Yo creo que pueda ser alguna variable de entorno del Blinker, pero no se cúal. Con Blinker 4.0 va bien, pero me gustaría linklar con alguna version más moderna porque supongo que gestionará mejor los recursos de memoria del ordenador. Y sino pués nada. |
uLoadObject y Blinker 6.0 | Manuel,
¿ Que tamaño tienen los ficheros salvados en disco ?
Tambien podrias poner algunas trazas en el código fuente de uLoadObject() y ver en donde exactamente está la diferencia.
¿ Puedes proporcionarnos un ejemplo para probarlo aqui ? gracias. |
uLoadObject y Blinker 6.0 | ES MUY EXTRTAÑO. PARA PROBAR, HE ESCRITO AL PRINCIPIO DEL PROGRAMA LO SIGUIENTE:
LOCAL aDat := { "Banco1","Banco2","Banco3" }
LOCAL aBanc := {}
MsgAlert(LEN(aDat))
MsgAlert(LEN(aBanc))
lSaveObject(aDat,".\Datos\Prueba.Dat")
SysRefresh()
aBanc := uLoadObject(".\Datos\Prueba.Dat")
MsgAlert(LEN(aBanc))
ME DEVUELVE EL SIGUIENTE RESULTADO:
3
0
3
O SEA TODO BIEN, ME LO HA ABIERTO. SIN EMBARGO EN OTRO PUNTO DEL PROGRAMA, DENTRO DE UNA FUNCION, HE HECHO:
LOCAL aBanc := {}
aBanc := uLoadObject(".\Datos\Prueba.Dat")
SysRefresh()
MsgAlert(LEN(aBanc))
Y ME HA DADO ERROR DEL "LEN" AL EJECUTAR EL MsgAlert. COMO SI aBanc FUERA NIL.
CON "LOCAL abanc" A SECAS O CON
LOCAL aBanc := uLoadObject(".\Datos\Prueba.Dat")
TAMPOCO VA.
PERO SOLO SI LO ENLAZO CON BLINKER 6.0 O BLINKER 7.0
CON BLINKER 4.0 VA BIEN
PUEDE SER ALGUN TIPO DE PROBLEMA DE ALOCACION DE LA MEMORIA |
uTILIZAR OCX | Colegas,
Necesito utilizar un control OCX para una impresora fiscal, y necesito un ejemplo para su utilización. |
uTILIZAR OCX | Juan,
Revisa FWH\samples\WebExp.prg, Flash.prg, Pdf.prg, etc.
Busca por ACTIVEX en *.prg en los ejemplos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
uTILIZAR OCX | Antonio muchas gracias,
El fichero OCX es para una impresora fiscal y necesito asignarle valores, llamar funciones y leer resultados de la misma forma que un DLL, estos ejemplos estan muy buenos pero no veo la forma de utilizar las propiedades antes descritas. |
uTILIZAR OCX | Juan,
Las propiedades se cambian asi:
[b:1yv90g1m]oActiveX:SetProp( "NombrePropiedad", uValor )[/b:1yv90g1m]
Las propiedades se comprueban asi:
[b:1yv90g1m]uValor := oActiveX:GetProp( "NombrePropiedad" )[/b:1yv90g1m]
Los metodos se llaman asi:
[b:1yv90g1m]uResultado = oActiveX:Do( "NombreMetodo", uParametros, ... )[/b:1yv90g1m]
Los eventos se controlan asi:
[b:1yv90g1m]oActiveX:bOnEvent = { | cEventNombre, aParametrosRecibidos, pParams | ... }[/b:1yv90g1m]
En FWH\samples\webexp.prg tienes un ejemplo del uso de cada una de ellos. |
uTILIZAR OCX | Antonio,
Muchas gracias,
Es obligatorio asignar una Ventana ?
Cuando utilizo el OCX, el sistema se sale y no emite ningun error.
Sabes algún programa para abrir este fichero y saber si funciona bien.
oActiveX = TActiveX():New( oWnd, "TMFISCAL.ocx" ) |
uTILIZAR OCX | Juan,
Puedes inspeccionarlo y probarlo desde VBA usando Word, ó Excel.
O desde Visual Basic, si lo tienes instalado. |
uan con GET ... VALID | Buenas tardes,
Como hago para que en un control GET no me valide si su valor no lo cambia el usuario.
Anexo el codigo que he probado.
[code=fw:qu4pgvfh]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />....<br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> h<span style="color: #000000;">[</span><span style="color: #ff0000;">"Factura"</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999999999"</span>;<br /> <span style="color: #0000ff;">VALID</span> ValidaNumeroFactura<span style="color: #000000;">(</span> oGet<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, h<span style="color: #000000;">[</span><span style="color: #ff0000;">"Factura"</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// ON CHANGE ( msginfo("cambio el valor") )</span><br /><br /><br /><br />....<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">Function</span> ValidaNumeroFactura<span style="color: #000000;">(</span> oGet, nFactura <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// Local cFactura:= StrZero(nFactura, 12)</span><br /> <br /> ? oGet:<span style="color: #000000;">value</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> oGet:<span style="color: #000000;">Assign</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> ? oGet:<span style="color: #000000;">value</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oGet:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">changed</span><br /> <br /> <span style="color: #B900B9;">// ? ( oGet:varget() <> oGet:oGet:original )</span><br /> <span style="color: #B900B9;">/*<br /> if ExisteFacturaVenta( cFactura )<br /> MsgStop("Factura "+cFactura+" Existe", ovarsis:Empresa)<br /> Return FALSE<br /> endif <br /> */</span><br /> <br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">TRUE</span> <br /> </div>[/code:qu4pgvfh]
Usando la clausula ON CHANGE no me sirve porque al oprimir la primera tecla ( imagino que activa el :bKeychar ) solo me toma ese caracter.
saludos, |
uan con GET ... VALID | Comprueba en la funcion de validacion o en el codeblock de validacion los valores a ver si sirve
[quote:2eo41g1s]
if ::cCaption == ::oGet:Buffer
[/quote:2eo41g1s] |
uan con GET ... VALID | Cristobal, gracias por reponder.
probe en la funcion que valida asi :
[code=fw:3mcpmiy3]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">Function</span> ValidaNumeroFactura<span style="color: #000000;">(</span> oGet, nFactura <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// Local cFactura:= StrZero(nFactura, 12)</span><br /><br /> ? oGet:<span style="color: #000000;">cCaption</span>, oGet:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Buffer</span>, <span style="color: #000000;">(</span> oGet:<span style="color: #000000;">cCaption</span> == oGet:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Buffer</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #B900B9;">/*<br /> if ExisteFacturaVenta( cFactura )<br /> MsgStop("Factura "+cFactura+" Existe", ovarsis:Empresa)<br /> Return FALSE<br /> endif <br /> */</span><br /> <br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">TRUE</span> <br /> </div>[/code:3mcpmiy3]
Muestra lo siguiente :
oGet:cCaption = "vacio" ... el valor es numerico pero no muestra nada
oGet:oGet:Buffer = "vacio" ... el valor es numerico pero no muestra nada
( oGet:cCaption == oGet:oGet:Buffer ) = ".T." .. muestra .T.
Esto lo hace auque tipee '0' o cualquier otro valor numerico.
<!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> |
uan con GET ... VALID | Compara lo siguiente:
[code=fw:1wobngxf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> oGet:<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span>, <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span> oGet:<span style="color: #000000;">cText</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:1wobngxf]
modifica el valor |
uan con GET ... VALID | Cristobal,
[quote:2719shdl]
MsgInfo( oGet:cCaption ) // = "nil"
Msginfo( oGet:cText() ) // ="muestra el valor tipeado"
[/quote:2719shdl] |
uan con GET ... VALID | Hola,
Yo lo solucioné modificando en la clase TGet.
[code=fw:1cw9o8bn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">DATA</span> xValorOriginal<br /><span style="color: #00C800;">METHOD</span> lOriginal<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// En metodo GotFocus() añade:</span><br />::<span style="color: #000000;">xValorOriginal</span>:= ::<span style="color: #000000;">VarGet</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// Este metodo solo tiene sentido usarlo durante la edicion, especialmente en el VALID.</span><br /><span style="color: #00C800;">METHOD</span> lOriginal<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> ::<span style="color: #000000;">xValorOriginal</span> == ::<span style="color: #000000;">VarGet</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:1cw9o8bn]
Luego en el valid sólo tienes que preguntar por oGet:lOriginal(). Lo uso muchísimo en mis programas.
Salu2 |
uan con GET ... VALID | Ejecuta un VALID de un Dialogo "sin permiso"
Activo varios Dialogos NOWAIT, dentro de la Ventana oWndIva
Se presentan todos correctamente PERO al final se activa un[color=#FF0000:1f13k72e] VALID OBRA() [/color:1f13k72e]del Dialogo oDDAbmLin
que llamo desde la Funcion Lineas() [color=#FF0000:1f13k72e]que no he llamado AUN[/color:1f13k72e]
Ya he probado a simplificar el problema es decir no llamar a todos para ver si hay "interferencias"
el valid de Obra lo he simplificado y solo saca un mensaje por pantalla , y SI lo hace pero NO debería
hasta que se le pase el control
Acabo de ver que lo activa el oLbx ¿?, ya que si comento la llamada A Lineas() FUNCIONA
por si acaso he eliminado e ON CHANGE con el mismo resultado,
No alcanzo a ver que sucede
---------------------------
DEFINE Window oWndIva From 0,0 to MaxRow(),MaxCol();
ICON oIconAbm;
COLOR "N/W+";
TITLE OemToAnsi("Apuntes con Iva");
BORDER NONE NOSYSMENU NOMINIMIZE NOMAXIMIZE
Barra()
Cfactura()
Dfactura()
Barra2()
[color=#FF0000:1f13k72e]Linea()[/color:1f13k72e]
Lineas()
DbSelectArea("civa")
oDCObra:Enable()
oBtnRas:SetFocus()
DEFINE MSGBAR PROMPT "Obras 32, (c) Go & Go Software 2016" ;
OF oWndIva KEYBOARD DATE
ACTIVATE Window oWndIva MAXIMIZED;
ON INIT (oWnd:Disable());
VALID(Cerrar(),oWnd:Enable())
----
Static Function Linea()
DEFINE DIALOG oDDAbmLin OF oWndIva RESOURCE "IVA_LIN"
[color=#FF0000:1f13k72e] REDEFINE GET oObra VAR cObra ID 100 OF oDDAbmLin VALID Obra()[/color:1f13k72e]
REDEFINE GET oFechal VAR dFechal ID 102 OF oDDAbmLin ReadOnly
REDEFINE GET oCuenta VAR cCuenta ID 103 OF oDDAbmLin ReadOnly
REDEFINE GET oConcep VAR cConcep ID 104 OF oDDAbmLin VALID Concepto()
REDEFINE GET oDescri VAR cDescri ID 105 OF oDDAbmLin
REDEFINE GET oImport VAR nImport PICTURE "@E 999,999,999.99" ID 106 OF oDDAbmLin VALID Importe()
REDEFINE GET oTipo VAR nTipo PICTURE "@E 99.99" ID 107 OF oDDAbmLin VALID (G_Linea(),.t.)
REDEFINE GET oNumasi VAR cNumasi ID 101 OF oDDAbmLin ReadOnly
REDEFINE BUTTON oBtnObr ID 109 OF oDDAbmLin ACTION (If(HelpObr(),VolHObra(.t.),VolHObra(.f.)),.t.)
REDEFINE BUTTON oBtnCto1 ID 112 OF oDDAbmLin ACTION (If(Helpcon(),VolHcon(.t.),VolHcon(.f.)),.t.)
ACTIVATE DIALOG oDDAbmLin NOWAIT;
Valid (oWndIva:End())
oDDAbmLin:Disable()
----
Static Function [color=#FF0000:1f13k72e]Lineas()[/color:1f13k72e]
DEFINE DIALOG oDDAbmLins OF oWndIva RESOURCE "IVA_LINS"
REDEFINE [color=#FF0000:1f13k72e]LISTBOX oLbx;[/color:1f13k72e]
FIELDS bliva->Obra,bliva->Asiento,;
dtoc(bliva->fecha),;
bliva->Cuenta,bliva->Concepto,;
bliva->Descrip,;
Transform(bliva->Base,"@E 999,999,999.99"),;
Transform(bliva->Tipo,"@E 99.99");
HEADERS "N.Obra","Asiento",;
xPadc("Fecha",75),xPadc("Cuenta",60),"Cpto.",;
xPadc("Descripcion",210),;
xpadc("Base",90),"Tipo";
FIELDSIZES 55,55,70,60,50,210,90,40;
ALIAS "BLIVA";
[color=#008040:1f13k72e]ON CHANGE Toma_Lin();
[/color:1f13k72e] ID 110 OF oDDAbmlins
ACTIVATE DIALOG oDDAbmLins NOWAIT;
// on init (oDDAbmLins:Disable());
// Valid (.T.);
// oDDAbmLins:Disable()
return nil
-----
Static Function Obra()
Local lVuelta:=.f.
msginfo('obra')
Return lVuelta |
uan con GET ... VALID | Buenos días, intentaré reproducirlo a la tarde, aunque no "pillo" muy bien como hacerlo
de todas formas si opto por esta solución, habría que cambiar todos los GET con VALID ¿?
Muchas gracias |
uan con GET ... VALID | Prueba a hacer esto:
REDEFINE GET oObra VAR cObra ID 100 OF oDDAbmLin VALID If( oObra:lFocused, Obra(), .T. )
si no lo soluciona, prueba asi:
REDEFINE GET oObra VAR cObra ID 100 OF oDDAbmLin VALID If( oDDAbmLin:lFocused, Obra(), .T. )
Esto sucede porque el diálogo pierde el foco. Despues de activarlo puedes hacer asi:
oDDAbmLin:SetFocus() |
uan con GET ... VALID | Muchas gracias Antonio,
funciono perfectamente la primera opción,
voy viendo la Luz, <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
uan de wbrowse... | Hola Foro,
como puedo combinar imagen y texto en un header?
Gracias,
Paco <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
uan de wbrowse... | Paco,
No está implementado como tal, pero si revisas source\classes\wbrowse.prg verás la función wBrwLine que es la encargada de dibujar cada línea del browse.
No sería muy complicado modificarla para que dibuje una imagen en una determinada columna de la cabecera. |
uan de wbrowse... | [quote="Francisco Horta":2lvh0ts5]Hola Foro,
como puedo combinar imagen y texto en un header?
Gracias,
Paco <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->[/quote:2lvh0ts5]
Tal como dice Antonio, no seria muy dificil modificar codigo, aunque no es para todo el mundo <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->. !!!
Respecto a la TW Version 18 (soon que la tengo en beta) puedes hacerlo desde un bloque de codigo nuevo, ejecutado desde C, para no retardar tanto el pintado de las cabeceras, y puedes ejecutar 2 cosas.
[code:2lvh0ts5]
Los bloques se ejecutan por celda al momento de pintado. Dichas variables son ::bPrevPaint y ::bNextPaint. El primero se usa para
poder escribir en la celda en forma personalizada ANTES del pintado estandard de la celda, y ::bNextPaint se ejecuta DESPUES del pintado normal. Esto le da FLEXIBILIDAD TOTAL a la clase. Valores que puede devolver el bloque ::bPrevPaint;
>---> <0> El pintado por defecto NO se hara, por lo tanto es su resposabilidad cubrir el area total de la celda
>---> <1> El pintado por defecto SI se hara EXCEPTO el Texto, por lo tanto es su resposabilidad pintar un texto especifico en la celda.
>---> <Otro valor distino> Indicara que SI debe hacerse el pintado por defecto de la celda.
Los bloques reciben los siguientes parametros:
{|nRow,nCol,nStyle,hDC,cChar,nTop,nLeft,nBottom,nRight| <su codigo> }
[/code:2lvh0ts5]
Entre otras cosas, tendremos como novedades headers nativas sobre 32bit opcional, con correcta implementacion pudiendo en tiempo de ejecucion cambiar a viejas o nuevas, posibilidad de freezear el browse permitiendo que no se refresque ni se muevan punteros de ningun tipo en el pintado, algo asi como sacar una foto y dejarlo asi hasta que uno decida, mejoras de velocidad, doble buffer opcional y sin doble buffer tambien el browse no produce parpadeos practicamente, algunas nuevas implementaciones, posiblidad ejecutar manejo de keychar y keydown definidos por el usuario, etc,etc,etc. estas seran algunas de las cosas nuevas. Pronto en las bateas <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Una MINI implementacion un beta tester:, como vemos usa los nuevos bloques y usa los bColor, alineaciones especiales y solo pinta caracteres en el cotextor de dispositivo. No usa imagenes pero podria haberlo hecho <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
[img:2lvh0ts5]http://img66.imageshack.us/img66/3056/twbeta186bl.jpg[/img:2lvh0ts5] |
uan de wbrowse... | Hernán lo que se ve parece muy bueno.
Muchas gracias desde ya...
Saludos
Ruben Fernandez |
uan de wbrowse... | UUUPPPPPSSS Hernan; Fabulosa !!! Grandiosa !!!
100% comentario aceptado, no todos tenemos la capacidad de mover fuentes !!, jejeje puede ser mi caso, pero voy a ver que saco.
Esperamos (de seguro todo el foro) ansiosos tu version 18
Suerte !!
Salu2
Paco |
uan de wbrowse... | Hernan, lo que describes es una maravilla ! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Las celdas personalizadas abren nuevos horizontes, y desde ya estoy pensando como disfrutar este nuevo browser.
Felicidades por este excelente trabajo !
Un saludo |
uan de wbrowse... | [quote="Yannis":qtbmsv7d]Hernan, lo que describes es una maravilla ! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Las celdas personalizadas abren nuevos horizontes, y desde ya estoy pensando como disfrutar este nuevo browser.
Felicidades por este excelente trabajo !
Un saludo[/quote:qtbmsv7d]
Exacto, si bien las celdas personalizadas hacen a la flexibilidad, NO hay que abusar de los tiempos de pintado, entonces ahi juega un papel muy importante cuan optimizado sea ese codigo. Si la funcion esta hecha en lenguaje C seria todo mas rapido, en PRG tambien seria posible, pero bueno, dependera de cuan complicada sea. Las pruebas hechas sobre PRG han sido satisfactorias realmente y comviene mucho usar el doble buffer en estos casos, casi obligatoriamente.
Salu2 |
uan de wbrowse... | Hernan,
Entiendo lo que dices sobre la optimizacion del codigo. Es evidente que los .prg seran mucho mas lentos. Un trabajo mas para uno como yo que del lenguaje C no entiende un....
Pero, este browser ya es un paso gigante en adelante !!!.
Muchas gracias por tu tiempo !
Un saludo, |
uan de wbrowse... | En efecto, no entiendo nada de .c asi que mejor ahi le dejo, no se me da, <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
Gracias a ambos Antonio y Hernan
Salu2
Paco |
uan de wbrowse... | Hernan,
Esta nueva version 18, esta super!!, algun dia se liberará o sera de paga?
si es asi, para cuando tendriamos noticias del precio y una liberacion?
salu2
paco |
uan de wbrowse... | [quote="Francisco Horta":13o174uw]Hola Foro,
como puedo combinar imagen y texto en un header?
Gracias,
Paco <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->[/quote:13o174uw]
Algo como esto ????:
[img:13o174uw]http://www.google.d2g.com/objeto/browse1.png[/img:13o174uw]
Esta hecho con el browse de Hernan. |
uan de wbrowse... | Sinceramente desde que conocí el "Browse de Hernán" lo hice mi browse, por su simplicidad y rapidez.
Gracias Hernán por el tiempo que dedicas a esta herramienta y sobre todo por compartirla con la comunidad.
Tu trabajo es admirable. |
uan de wbrowse... | Efectivamente rene, tambien uso el browse de hernan, aqui mi duda viene en que yo no he podido mezclar, texto+imagen en las cabeceras, y en el sample que publica hdc utiliza los headers nativos, y en la version 17 no los tiene implementados.
Asi como jose yo tambien uso wbrowse desde que la use la primera vez, ya le he metido mano en algunos detalles y pues me he atrevido a subirla al foro sin consultar a hdc, esto para compartirlo con todos, gracias hdc por tu aporte.
salu2
Paco |
uan de wbrowse... | [quote="RF":c6kte60j][quote="Francisco Horta":c6kte60j]Hola Foro,
como puedo combinar imagen y texto en un header?
Gracias,
Paco <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->[/quote:c6kte60j]
Algo como esto ????:
[img:c6kte60j]http://www.google.d2g.com/objeto/browse1.png[/img:c6kte60j]
Esta hecho con el browse de Hernan.[/quote:c6kte60j]
Hola maestro Rene, como esta corazon pues, me llamo Susy y me interesa la clase de Hernan y el ejemplo que muestras con la imagen y celdas con sus totales, es de paga o podria aportar gratuito a los demas usuarios y si me podria enviar un claro ejemplo que muestras en la imagen, gracias y se lo agradecere eternamente maestro, besos y abrazos desde michoacan , su amiga Susy <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> |
uan de wbrowse... | Ok, para todos ustedes, este es el secreto:
Como todo en FiveWin, son "efectos especiales", y en realidad, nada es lo que parece.
1) Necesitamos el Browse de Hernan, cualquier versión, (el truco funciona tambén con xBrowse) para mayor información sobre los browses de FW, les recomiendo que lean mi articulo "Browse VS Browse"
2) Es raro que el titulo de una cabecera cambie, asi que en realidad, lo que están viendo mis queridos amigos, es un bitmap que incluye el texto y la imagen, en realidad son 4 bitmap, 2 incluyen la imagen "habilitada" y 2 la imagen "deshabilitada":
[img:bepsp7uu]http://www.google.d2g.com/objeto/headers.jpg[/img:bepsp7uu]
El color del fondo es lo de menos, recuerden que FW utiliza el byte 1,1 para definir el color de la transparencia
3) Antes de definir el browse, cargamos los bitmaps en la memoria:
[code:bepsp7uu]hBmp1 := LoadBitmap(GETRESOURCES(),"HEADER1"))
hBmp2 := LoadBitmap(GETRESOURCES(),"HEADER2"))
hBmp3 := LoadBitmap(GETRESOURCES(),"HEADER3"))
hBmp4 := LoadBitmap(GETRESOURCES(),"HEADER4"))
[/code:bepsp7uu]
4) Definimos el browse como se hace normalmente:
[code:bepsp7uu] @ 0,205 LISTBOX oBrw FIELDS ....[/code:bepsp7uu]
5) Definimos sus headers:
[code:bepsp7uu] oBrw:aHeaders := {" ",hBmp1,hBmp3,"Tipo","SubTipo","Naturaleza"}[/code:bepsp7uu]
6) y luego para cambiar dinamicamente los headers con su respectivo bitmap en tiempo de ejecucion:
[code:bepsp7uu]oBrw:aActions :={{|| NIL},{|x| CamHeader(x,1)},{|x| CamHeader(x,2)}}[/code:bepsp7uu]
7) la función CamHeader(<oBrw>,<nOrden>):
[code:bepsp7uu]
FUNCTION CamHeader(oBrw,nIndex)
IF nIndex == 1
(oBrw:cAlias)->(OrdSetFocus('numcuenta'))
//aqui viene la magia, volvemos apintar el header completo, cambiando los bmps del header
oBrw:aHeaders := {" ",hBmp1,hBmp3,'Tipo','SubTipo','Naturaleza'}
ELSE
(oBrw:cAlias)->(OrdSetFocus('nomcta'))
oBrw:aHeaders := {" ",hBmp2,hBmp4,'Tipo','SubTipo','Naturaleza'}
ENDIF
oBrw:Refresh()
RETURN (.T.)
[/code:bepsp7uu]
Y eso es todo. |
uan de wbrowse... | [quote="RF":lyuizp3u]Ok, para todos ustedes, este es el secreto:
Como todo en FiveWin, son "efectos especiales", y en realidad, nada es lo que parece.
1) Necesitamos el Browse de Hernan, cualquier versión, (el truco funciona tambén con xBrowse) para mayor información sobre los browses de FW, les recomiendo que lean mi articulo "Browse VS Browse" en <!-- w --><a class="postlink" href="http://www.google.blogspot.com">www.google.blogspot.com</a><!-- w -->.
2) Es raro que el titulo de una cabecera cambie, asi que en realidad, lo que están viendo mis queridos amigos, es un bitmap que incluye el texto y la imagen, en realidad son 4 bitmap, 2 incluyen la imagen "habilitada" y 2 la imagen "deshabilitada":
[img:lyuizp3u]http://www.google.d2g.com/objeto/headers.jpg[/img:lyuizp3u]
El color del fondo es lo de menos, recuerden que FW utiliza el byte 1,1 para definir el color de la transparencia
3) Antes de definir el browse, cargamos los bitmaps en la memoria:
[code:lyuizp3u]hBmp1 := LoadBitmap(GETRESOURCES(),"HEADER1"))
hBmp2 := LoadBitmap(GETRESOURCES(),"HEADER2"))
hBmp3 := LoadBitmap(GETRESOURCES(),"HEADER3"))
hBmp4 := LoadBitmap(GETRESOURCES(),"HEADER4"))
[/code:lyuizp3u]
4) Definimos el browse como se hace normalmente:
[code:lyuizp3u] @ 0,205 LISTBOX oBrw FIELDS ....[/code:lyuizp3u]
5) Definimos sus headers:
[code:lyuizp3u] oBrw:aHeaders := {" ",hBmp1,hBmp3,"Tipo","SubTipo","Naturaleza"}[/code:lyuizp3u]
6) y luego para cambiar dinamicamente los headers con su respectivo bitmap en tiempo de ejecucion:
[code:lyuizp3u]oBrw:aActions :={{|| NIL},{|x| CamHeader(x,1)},{|x| CamHeader(x,2)}}[/code:lyuizp3u]
7) la función CamHeader(<oBrw>,<nOrden>):
[code:lyuizp3u]
FUNCTION CamHeader(oBrw,nIndex)
IF nIndex == 1
(oBrw:cAlias)->(OrdSetFocus('numcuenta'))
//aqui viene la magia, volvemos apintar el header completo, cambiando los bmps del header
oBrw:aHeaders := {" ",hBmp1,hBmp3,'Tipo','SubTipo','Naturaleza'}
ELSE
(oBrw:cAlias)->(OrdSetFocus('nomcta'))
oBrw:aHeaders := {" ",hBmp2,hBmp4,'Tipo','SubTipo','Naturaleza'}
ENDIF
oBrw:Refresh()
RETURN (.T.)
[/code:lyuizp3u]
Y eso es todo.[/quote:lyuizp3u]
Muchas gracias René por compartir tus ideas y técnicas con nosotros, en particular para mí, esto es una obra de arte y es bueno saber que se puede contar con ti generosidad para compartira con los miembros de esta comunidad. |
uan de wbrowse... | Gracias rene, mas que bien, como simpre la solucion.
salu2
paco |
ubicar texto | AntonioHago una busqueda en un archivo de texto con AT() y OKPara reubicar el texto encontrado en el primer renglon de un Get multilinea se puede hacer mediante la manipulacion del VSCROLL?Como lo podria lograr, no encuentro la forma de controlar el SCROLLGracias de antemanoJairo Barbosa Cali Colombia |
ubicar texto | Amigo no se si es lo qu estes buscando....Pero creo que lo que necesitas es lo siguiente:[code:mr0kcx5l]
oGet:GoToLine( nLine )
oGet:GoTo( nLine )
[/code:mr0kcx5l]No las he provado, pero en teoria deberia funcionar. Mas tarde cuando este en la casa hago una prueba. |
ubicarse posicion registro determinado xbrowse - SOLUCIONADO | Amigos del foro tengan buen día....
Como dice el encabezado necesito ubicarme en una fila especifica del xbrowse..despues de actualizar un recorset por ejemplo
[code=fw:1sfp89el]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Registro:=oLamcla:<span style="color: #000000;">oRsBodega</span>:<span style="color: #000000;">AbsolutePosition</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />Consec:=oLamcla:<span style="color: #000000;">oRsBodega</span>:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"oo_itemci"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span><br /><br /><span style="color: #00C800;">IF</span> valtype<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>=<span style="color: #ff0000;">"C"</span><br /> vOpc := val<span style="color: #000000;">(</span>subs<span style="color: #000000;">(</span>xVal,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br />ELSEIF valtype<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>=<span style="color: #ff0000;">"N"</span><br /> vOpc := xVal<br /><span style="color: #00C800;">ENDIF</span><br /><br />vConsCB:=<span style="color: #ff0000;">"UPDATE "</span>+oLamcla:<span style="color: #000000;">tCier</span>+<span style="color: #ff0000;">" SET oo_cierr='"</span>+<span style="color: #00C800;">if</span><span style="color: #000000;">(</span>xVal=<span style="color: #000000;">1</span>,<span style="color: #ff0000;">"OK"</span>,<span style="color: #ff0000;">"HA"</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">"',usuari='"</span>+uCou+<span style="color: #ff0000;">"',ufecha='"</span>+uFe2+<span style="color: #ff0000;">"',uhoras='"</span>+uTim+<span style="color: #ff0000;">"' WHERE oo_itemci="</span>+alltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>Consec<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span>vConsCB<span style="color: #000000;">)</span><br /><span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span>registro<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">/*<br />TRY<br /> oLamcla:oServer:Execute(vConsCB)<br />CATCH oError<br /> MsgInfo(oLamcla:mRegi,oLamcla:mDato)<br />END*/</span><br /><br />oLamcla:<span style="color: #000000;">oRsBodega</span>:<span style="color: #000000;">Requery</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oLamcla:<span style="color: #000000;">oBrwBode</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:1sfp89el]
Con esta función yo le digo al xbrowse que vaya al tope
xbrow:GoTop()
Con esta que vaya al final
xbrow:GoBottom()
[color=#FF0000:1sfp89el]Con cual función le digo que vaya a un registro especifico?[/color:1sfp89el]
Espero haberme hecho entender.. |
ubicarse posicion registro determinado xbrowse - SOLUCIONADO | Leandro
oBrw:Gotop()
oBrw:Skip(nFila)
Saludos,
Adhemar |
ubicarse posicion registro determinado xbrowse - SOLUCIONADO | Amigo acuellar, primero que todo gracias por responder..
Intente de la manera que tu me indicas pero no me funciona correctamente...
Buscando en la clase del xbrowse encontré esta función
[code=fw:3n1583jo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">setpos</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:3n1583jo]
Pero tampoco funciona.... He intentando volver al registro que actualizo después de hacer el requery()..Pero nada
Alguien tiene otra idea..
de antemano gracias. |
ubicarse posicion registro determinado xbrowse - SOLUCIONADO | oBrw:nColSel := 2
oBrw:nRowSel := nRen
saludos.. |
ubicarse posicion registro determinado xbrowse - SOLUCIONADO | Esto funciona para mi, oBrw : nArrayAt := nRecno. Espero te sirva
Saludos |
ubicarse posicion registro determinado xbrowse - SOLUCIONADO | IF MsgGet( "Mover","Nº Registro: ",@cMoveIt )
IF cMoveIt>0
Goto cMoveIt
ENDIF
ENDIF |
ubicarse posicion registro determinado xbrowse - SOLUCIONADO | Buenos días para todos y muchas gracias por responder...
Finalmente encontré la solución a mi problema, y el problema no era que tenia
que retornar la posición en el xbrowse si no en el recorset para luego si actualizar el
xbrowse...
el código me quedo de la siguiente manera:
grabo en numero del registro recorset
[code=fw:2assba73]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Registro:=oLamcla:<span style="color: #000000;">oRsBodega</span>:<span style="color: #000000;">AbsolutePosition</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:2assba73]
Luego me posiciono en el registro recorset y actualizo el xbrowse.
[code=fw:2assba73]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oLamcla:<span style="color: #000000;">oRsBodega</span>:<span style="color: #000000;">Requery</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oLamcla:<span style="color: #000000;">oRsBodega</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span>Registro<span style="color: #000000;">-1</span><span style="color: #000000;">)</span><br />oLamcla:<span style="color: #000000;">oBrwBode</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oLamcla:<span style="color: #000000;">oBrwBode</span>:<span style="color: #000000;">setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:2assba73]
Gracias a todos por la ayuda |
uestudio OT | Hello
I am trying to configure out UESTUDIO
I have used the provided (from Ken) xharbour config file.
I am testing with a hello world project, very simple program.
Compile and link are OK, no errors but nothing shows at run time. I am using "release mode"
I am sure i am missing some library ... but i am not able to find which one.
Any one had succeeded in using oestudio can share the xharbour.config application file ?
Thanks in advance.
Richard
I join my config file, if anyone can help ....
# ----- xHarbour-FiveWin Compiler configuration ----
# --- general --------------------------------------
# $P - project name
# $Pp - path to project directory
# $Pn - project name
# --- compile --------------------------------------
# $I - input full name
# $Ip - input path
# $In - input name
# $Ie - input extension
# $O - output file
# $Op - path to output file
# $On - output filename (without path)
# $Oe - output extension
# $R - release/debug setting for compiler
# --- build ----------------------------------------
# $T - target full name
# $Tp - target path
# $Tn - target name
# $O - output file
# $Op - path to output file
# $On - output filename (without path)
# $Oe - output extension
# $R - release/debug setting for linker
[Settings]
Target =
Category&01 = DEFAULT RUN CONFIGURATION
Working Directory =.
Command Line Arguments =
Category&02 = xHarbour Options
GUI = FWH
Automatic Memvar Declaration = yes|no
Variables Are Assumed = yes|no
Generate Preprocessed Output = no|yes
Exit Severity = 0|1|2
Use xHarbour Dll = no|yes
Use MT Library = no|yes
Use AdvantageRDD = no|yes
User Include Path =
User Defines =
Compiler Options =
Linker Options =
[SettingsInfo]
Target = Provides a space for you to specify an output file and location of the program that the linker creates.
Working Directory = Provides a space for you to specify the directory in which executing occurs. If you do not specify a directory, executing occurs in the directory where the executable is located.
Command Line Arguments = Provides a space for you to specify command-line arguments you want to pass to the program at startup.
Compiler Options = Provides a space for you to specify an additional compiler options.
User Defines = Shows the switches the tool will use to build. Use ';' as delimiter.
Use MT Library = Set this if you want to use Multi threaded libraries
Linker Options = Provides a space for you to specify an additional linker options.
[SettingsReps]
User Defines = @[;|/D%s]
Automatic Memvar Declaration = no=|yes=/a
Variables Are Assumed = no=|yes=/v
Exit Severity = @/es%s
Generate Preprocessed Output = no=|yes=/p
Use xHarbour Dll = no=|yes=harbour.lib
Use Multi Thread Library = no|yes
Use AdvantageRDD = no=|yes = ace32.lib rddads.lib
User Include Path = ^^@[;|;%s]
User Include Path&1 = ^^@[;| /i%s]
[Variables]
FWH = C:\FWH
CPATH = C:\xHarbour
BPATH = C:\BCC55\CBUILDER5
FWHI = $(FWH)\include
FWHL = $(FWH)\lib
GUII = {[$(GUI)=][none=][FWH=;$(FWHI)]}
GUIL = {[$(GUI)=][none=][FWH=;$(FWHL)]}
GUII&1 = {[$(GUI)=][none=][FWH=/i$(FWHI)]}
COPT = /i$(CPATH)\INCLUDE $(User Include Path&1) $(GUII&1) /n $(Automatic Memvar Declaration) $(Variables Are Assumed) $(Exit Severity) $(User Defines) $(Compiler Options) $(Generate Preprocessed Output)
BOPT = -c -D__EXPORT__ -I$(CPATH)\INCLUDE;$(BPATH)\INCLUDE$(User Include Path)$(GUII)
LOPT = -L$(BPATH)\LIB\OBJ;$(BPATH)\LIB;$(CPATH)\LIB$(GUIL) -Gn -M -m -s -Tpe -x $(GLnk) $(Linker Options)
LIB1 = lang.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib dbffpt.lib common.lib codepage.lib ct.lib tip.lib pcrepos.lib hsx.lib hbsix.lib import32.lib cw32.lib
LIBM = lang.lib vmmt.lib rtlmt.lib rddmt.lib macromt.lib ppmt.lib dbfntxmt.lib dbfcdxmt.lib dbffptmt.lib common.lib codepage.lib ctmt.lib tipmt.lib pcrepos.lib hsxmt.lib hbsixmt.lib import32.lib cw32mt.lib
LIBX = {[$(Use MT Library)=][no=$(LIB1)][yes=$(LIBM)]}
GLIB = {[$(GUI)=][none=gtwin.lib][FWH=fivehx.lib fivehc.lib gtgui.lib gtgui.lib]}
LIBS = $(Use xHarbour Dll) {[$(BuildMode)=][Debug=debug.lib]} $(GLIB) $(LIBX) $(Use AdvantageRDD)
GLnk = {[$(GUI)=][none=-ap][FWH=-aa]}
DCon = {[$(GUI)=][none=1][FWH=0]}
LinkWith = {[$(GUI)=][none=C:\BCC55\CBUILDER5\lib\c0x32.obj][FWH=C:\BCC55\CBUILDER5\lib\c0w32.obj]}
[Environment]
PATH = $(CPATH)\BIN;$(BPATH)\BIN;%PATH%
INCLUDE = $(CPATH)\INCLUDE;$(BPATH)\INCLUDE$(User Include Path);$(GUII)
LIB = $(CPATH)\LIB;$(BPATH)\LIB;$(GUIL)
OBJ = $(CPATH)\OBJ;
BuildMode = %UESMode%
[General]
TargetExt = .EXE
ReleaseOut = Release
DebugOut = Debug
UseFullPaths = 1
UseDosNames = 1
Excludes = $(Excluded Files)
[MakeCommands]
run = Execute Application
makef = Show Makefile
[Execute Application]
Title = Execute $T
Cmd0 = $(Command Line Arguments)
Depends = $T
ShowWindow = 1
DisplayConsole = $(DCon)
[Show Makefile]
Title=Show makefile
Cmd0=uestudio makefile
ShowWindow=1
DisplayConsole=0
[InsertFiles]
[FileGroups]
FGO = .obj;
FGR = .res;
FGL = .lib;
FGD = .def;
[GroupFormats]
FGO = %s
FGR = %s
FGL = %s
[Build]
Out = $T
Depends = $FGO $FGR
DebugFlag =
ReleaseFlag =
Cmd0 = ILINK32 $(LOPT) $R $(LinkWith) $FGO,$On,,$(LIBS) $FGL,$FGD,$FGR
[.PRG]
Out = $In.c
DebugFlag = /b
ReleaseFlag = /l
Cmd0 = harbour $I $(COPT) $R /o$O
IncFiles = 1
CaseSensitive = 0
IncDirs = .;$(INCLUDE);
IncKeyWords = #include;
Comments = /*.*/.//.eol.
[.C]
Out = $In.obj
Cmd0 = bcc32 $(BOPT) -o$O $I
[.RC]
Out = $In.res
Cmd0 = brcc32 -r -32 -fo$O $I
IncFiles = 1
CaseSensitive = 0
IncDirs = .;$(INCLUDE);
IncKeyWords = #include;
Comments = /*.*/.//.eol. |
uestudio OT | Richard,
Ok, we are at the same stage as you. The EXE is created but it does not run. We are checking it... |
uestudio OT | Richard,
Seems to be a bug in the way UEStudio manages groups of files.
Add another PRG to your project and the resulting EXE will be ok. It was not working as the main PRG was not being linked in. |
uestudio OT | [url=http://imageshack.us:3d9wnsn7][img:3d9wnsn7]http://img137.imageshack.us/img137/7785/uestudio2jo1.png[/img:3d9wnsn7][/url:3d9wnsn7] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.