topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
Application security and Code review
|
Cristobol
I agree .. I have had a 15 year relationship with my Client and he is getting ready to retire .. his Supervisor is an xx$$@@@ and has recently put in a cloud based Dispatch system that costs 1000.00 a month per driver x 4 drivers = 4k per month equaling 48k per year in re-occurring costs knowing full well I have a better in-house integrated solution that resides on his local Sql Server .. so who owns his data in the cloud ? .. who would go out and purchase another 3rd party system when my very elegant solution works and stores its data on my clients own Sql Server ..
The logic escapes me!
Rick Lipkin
|
Application security and Code review
|
Rick
Let me explain, if they are concerned that this information can be accessed:
1) They must provide the means for such information not to be externally accessible. Just like your software can do it, another can do it too
2) Why is your software less secure than the one they use to validate that information?
|
Application security and Code review
|
I'm used to having system administrators blame third-party software, and they wash their hands, and forget their real job
|
Application security and Code review
|
Cristobol
I don't know .. LDAP has been around for a long time and during my discussions with the IT person he does understand what I am doing ... however wants to bring in a Security Company to test my software for any possible penetration vulnerability or objectionable behavior .. as I mentioned in an earlier post . I told the IT person "Bring it On" .. however my client asked me to just take out the LDAP module because he did not want to have to submit the security review cost to his XX##@@@ Supervisor who probably wouldn't pay for it.
I guess it is time to move on to another Client.
Rick Lipkin
|
Application security and Code review
|
Rick,
This seems to be all political.
I am not sure, but it sounds like you are saying that they have already decided to replace your software with a cloud based system?
If that is the case, then perhaps this supervisor is involved with the cloud company. Maybe he is getting a kickback, maybe his family works there, or maybe he has just done business with them before. Or, he already knows that software and he doesn't want to learn yours. It still sounds like he is looking for a reason to get rid of your software. Perhaps he perceives you to be a threat, as I expect you are way more experienced than he is.
I feel for you, as I have lost clients for similar reasons in the past. Politics is rampant everywhere, and logic has nothing to do with it.
Cristobol seems to know what I am talking about--from experience I expect.
James
|
Application security and Code review
|
James
You are probably correct .. the part that stings the most ... my X State employer ( because they liked my software so much over 15 years ago ) agreed to give it to any other large State Agency for free and made the promise to support the product if I every left.... and I did leave several years ago, and they failed on their promise to continue support for my Vehicle Fleet Managers application.
Since that code is my intellectual property .. I decided to honor the original promise to continue the 'free' support for the last 10 years or so up thru today.... How about that for integrity?
If there is one lesson I have learned :
"There is no perceived VALUE for any Software or Service that is Free"
Rick Lipkin
|
Application security and Code review
|
Rick,
[quote:1q5gs9ij]"There is no perceived VALUE for any Software or Service that is Free" [/quote:1q5gs9ij]
You are right about that. Consider that a valuable lesson you learned.
Early on in my consulting career, I read a book about consulting in which he had a chapter on fees. He said, never charge too little, and never, ever, lower your rate when they request it or complain about how much you are charging. To do so makes them think you aren't worth it. I have stuck with this advise and never lost a client because of that. When I give them an estimate and they ask to lower my rate, I tell them no, I have more work than I can handle now at my current rate, why would I lower my rate? I can however reduce the scope of the project by cutting out features.
If they tell me they found another programmer that will do it for a lower rate, then I say, you get what you pay for. Just because they charge less per hour doesn't mean they can do as much in an hour. I have 30 plus years of code in my library, and I can plug in a lot of it to create your code. A younger programmer cannot do that. I also have 30 plus years of experience in solving business problems with software.
I could go on about this, but I expect you get my point.
James
|
Application security and Code review
|
Rick,
Over the years I've seen, and learned, a lot about behaviors of "managers". I am amazed at how little research owners of companies will invest into these decisions. I've seen some get severely harmed when falling for sales pitches. A few examples:
1) A business running my software had a problem that I knew was hardware related. I explained this to the owner but a sales person convinced him otherwise. They bought a whole new system from a competitor, and the problem went away. Why ? Because the other company insisted on installing all new hardware also.
2) One business hired a new manager who insisted they needed to use a different software. ( Yeah, he got cash in his pocket for that one ). He hooked the owner on that, and several other promises. They were out of business less than a year later.
3) Often a "new employee" comes in, and convinces the owner to go in a different direction because they don't want to learn something new ( to them ).
The payoffs are rampant by companies trying to sell their products. The bottom line is your blood pressure does a whole lot better when you walk away from it.
Tim
|
Application security and Code review
|
Hi Rick!,
If your software has LDAP integration this is an added value. Maybe there are companies that want or do not want to activate it, but in any case it's a plus in security. I've been using LDAP connections for some time and I even put examples of how to do it here -> <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=26995&p=149999&hilit=ldap#p149999">viewtopic.php?f=3&t=26995&p=149999&hilit=ldap#p149999</a><!-- l -->
This really sounds like an excuse for them to justify their inversion in the cloud.
I hope I was wrong... <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
|
Application security and Code review
|
Carles
The Garage staff have been using my software for over 10 years and about 2 years ago I took out a 5k contract to migrate their app to a secure Sql Server and I went thru the program and added nice visual elements like gradients to include all data entry screens and included incremental searches\filters and the staff enjoy the program.
I am just going to let things take their course and let the politics play out .. As I mentioned above .. "There is no perceived VALUE for any Software or Service that is Free" .. during the migration I should have changed the licensing to SaaS ( software as a Service ) and engage them in a re-occurring contract where they have ownership .. by continuing to give them free updates to continue my former State Agency's gift... all I have done is put myself out of business with that Customer.
Rick Lipkin
|
Application security and Code review
|
La estrategia de muchas nuevas gerencias es clara: declarar, casi a modo de político, sin contrastar con la realidad, que hay un programa que cumple mejor los requisitos que el que se tiene y por ello se hará un cambio total, no ya de software, sino de todo el hardware. Las preguntas serían:
¿ Ha mirado la nueva gerencia como funciona el programa que actualmente tiene la empresa ?
¿ Qué relacion hay entre la nueva gerencia y los proveedores de software y hardware ?
¿ Se ha preguntado a otros miembros del staff sobre las necesidades REALES del software ?
Comprar nuevo software puede ser una manera sibilina de defraudar a la empresa.
|
Application slow down/Memory Leak
|
Hi,
One of my customers have been experiencing a performance drop in our application and after a few tests, we have noticed that the slow down occurs when the Mem Usage (reported by task manager) reaches a certain figure.
I noticed that I could open a simple dialog box and close it and the memory would increase and would never be recovered. The dialog box opened is very simple - One Say and a button - no fonts or bitmaps used.
Uwe sent me a memory application that when run, my users said that it seemed to help with performance, so I have tried to create my own version of the application withing my application:
The code for this is:
[code=fw:yfmxw194]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">FUNCTION</span> MemoryFlush <br /> SetProcess<span style="color: #000000;">(</span> <span style="color: #000000;">-1</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">-1</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />DLL32 <span style="color: #00C800;">Function</span> SetProcess<span style="color: #000000;">(</span> ;<br /> hWnd As LONG, nMinWorkingSpace As LONG, nMaxWorkingSpace As LONG <span style="color: #000000;">)</span> ;<br /> As LONG PASCAL <span style="color: #0000ff;">From</span> <span style="color: #ff0000;">"SetProcessWorkingSetSize"</span> Lib <span style="color: #ff0000;">"Kernel32.dll"</span><br /><br /> </div>[/code:yfmxw194]
I then call MemoryFlush() within a common routine (in my app, the routine that reads my text data dictionary)
So far, we have tested tmy app in a test environment with a single user and it seems to work quite well - I noticed that the mem usage value was being clawed back.
We are now testing my app in a live environment, so I will let you all know if we have any success.
If this is successful, I would like to change my memoryflush routine to only run if the memory usage is over a set value - does anyone know how get the mem usage value of your application?
Regards,
Pete
|
Application slow down/Memory Leak
|
Thanks Peter...
|
Application slow down/Memory Leak
|
Hi Pete.
Thanks for share it.
>does anyone know how get the mem usage value of your application?
Please review: \harbour\tests\memtst.prg
Toninho.
|
Application slow down/Memory Leak
|
Peter,
What is the reason of the memory high use?.
Have you checked with Checkres() if there are any memory leaks?.
Thank you for your important point.
|
Application slow down/Memory Leak
|
Hello PeterHarmes,
In their tests in a real environment, you have succeeded in using the function: memoryflush?
Thanks
|
Application slow down/Memory Leak
|
one of problems are resources specialy on windows seven systems
to resolve this leak problems I not use resources
only for bitmaps but If I can i save the bitmaps on a folder and call them when I use them
I rewrite also rpreview dialogs into @x,y source
I use only freeimage.dll calls
|
Application slow down/Memory Leak
|
thanks
|
ApplicationVS para UEstudio
|
Estimados
Me sale éste error con Visual Studio 2019
[code=fw:3rlgqh4y]<div class="fw" id="{CB}" style="font-family: monospace;"><br />--------------------Configuración: <span style="color: #000000;">ACR</span> - Release--------------------<br />Harbour <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">(</span>r1904111533<span style="color: #000000;">)</span><br />Copyright <span style="color: #000000;">(</span>c<span style="color: #000000;">)</span> <span style="color: #000000;">1999</span><span style="color: #000000;">-2019</span>, https:<span style="color: #B900B9;">//harbour.github.io/</span><br />Microsoft <span style="color: #000000;">(</span>R<span style="color: #000000;">)</span> C/C++ Optimizing Compiler Version <span style="color: #000000;">19.29</span><span style="color: #000000;">.30133</span> <span style="color: #00C800;">for</span> x86<br />Copyright <span style="color: #000000;">(</span>C<span style="color: #000000;">)</span> Microsoft Corporation. All rights reserved.<br />ACR.c<br />El sistema no puede encontrar la ruta especificada.<br />LINK : <span style="color: #000000;">fatal</span> error LNK1181: <span style="color: #000000;">cannot</span> open input file <span style="color: #ff0000;">'ACR.res'</span><br />ACR.EXE - <span style="color: #000000;">1</span> error<span style="color: #000000;">(</span>es<span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> advertencia<span style="color: #000000;">(</span>s<span style="color: #000000;">)</span><br /> </div>[/code:3rlgqh4y]
éste es Application
[code=fw:3rlgqh4y]<div class="fw" id="{CB}" style="font-family: monospace;"><br /># --------- Harbour y FWH configuration --------<br /># --- general --------------------------------------<br /># $P - project <span style="color: #0000ff;">name</span><br /># $Pp - path <span style="color: #0000ff;">to</span> project directory<br /># $Pn - project <span style="color: #0000ff;">name</span><br /># --- compile --------------------------------------<br /># $I - input full <span style="color: #0000ff;">name</span><br /># $Ip - input path<br /># $In - input <span style="color: #0000ff;">name</span><br /># $Ie - input extension<br /># $O - output file<br /># $Op - path <span style="color: #0000ff;">to</span> output file<br /># $On - output filename <span style="color: #000000;">(</span>without path<span style="color: #000000;">)</span><br /># $Oe - output extension<br /># $R - <span style="color: #0000ff;">release</span>/debug <span style="color: #0000ff;">setting</span> <span style="color: #00C800;">for</span> compiler<br /># --- build ----------------------------------------<br /># $T - target full <span style="color: #0000ff;">name</span><br /># $Tp - target path<br /># $Tn - target <span style="color: #0000ff;">name</span><br /># $O - output file<br /># $Op - path <span style="color: #0000ff;">to</span> output file<br /># $On - output filename <span style="color: #000000;">(</span>without path<span style="color: #000000;">)</span><br /># $Oe - output extension<br /># $R - <span style="color: #0000ff;">release</span>/debug <span style="color: #0000ff;">setting</span> <span style="color: #00C800;">for</span> linker<br /><br /><span style="color: #000000;">[</span>Settings<span style="color: #000000;">]</span><br />Target = <br />Category&<span style="color: #000000;">01</span> = <span style="color: #00C800;">DEFAULT</span> RUN CONFIGURATION<br />Working Directory =.<br />Command Line Arguments =<br /><br />Category&<span style="color: #000000;">02</span> = Harbour Options<br />Automatic Memvar Declaration = no|yes<br />Variables Are Assumed = no|yes<br />Generate Preprocessed Output = no|yes<br />Warning Level = <span style="color: #000000;">1</span>|<span style="color: #000000;">2</span>|<span style="color: #000000;">3</span>|<span style="color: #000000;">4</span>|<span style="color: #000000;">0</span><br />User Include Path =<br />User Defines =<br /><br />Compiler Options =<br />Linker Options =<br /><br />Excluded Files = Excludes<br /><br /><span style="color: #000000;">[</span>SettingsInfo<span style="color: #000000;">]</span><br />Target = Provides a space <span style="color: #00C800;">for</span> you <span style="color: #0000ff;">to</span> specify an output file and location <span style="color: #0000ff;">of</span> the program that the linker creates.<br />Working Directory = Provides a space <span style="color: #00C800;">for</span> you <span style="color: #0000ff;">to</span> specify the directory in which executing occurs. <span style="color: #00C800;">If</span> you <span style="color: #00C800;">do</span> not specify a directory, executing occurs in the directory <span style="color: #0000ff;">where</span> the executable is located.<br />Command Line Arguments = Provides a space <span style="color: #00C800;">for</span> you <span style="color: #0000ff;">to</span> specify command-line arguments you want <span style="color: #0000ff;">to</span> pass <span style="color: #0000ff;">to</span> the program <span style="color: #00C800;">at</span> startup.<br />Compiler Options = Provides a space <span style="color: #00C800;">for</span> you <span style="color: #0000ff;">to</span> specify an additional compiler options.<br />User Defines = Shows the switches the tool will use <span style="color: #0000ff;">to</span> build. Use <span style="color: #ff0000;">';'</span> as delimiter.<br />Linker Options = Provides a space <span style="color: #00C800;">for</span> you <span style="color: #0000ff;">to</span> specify an additional linker options.<br />Excluded Files = This will exclude the file<span style="color: #000000;">(</span>s<span style="color: #000000;">)</span> included in this UE project group <span style="color: #0000ff;">from</span> the build.<br /><br /><span style="color: #000000;">[</span>SettingsReps<span style="color: #000000;">]</span><br />User Defines = @<span style="color: #000000;">[</span>;|-D%s<span style="color: #000000;">]</span><br />Automatic Memvar Declaration = no=|yes=/a<br />Variables Are Assumed = no=|yes=/v<br />Generate Preprocessed Output = no=|yes=/p<br />User Include Path = ^^@<span style="color: #000000;">[</span>;|;%s<span style="color: #000000;">]</span><br />User Include Path&<span style="color: #000000;">1</span> = ^^@<span style="color: #000000;">[</span>;| /i%s<span style="color: #000000;">]</span><br />Use Multi Thread <span style="color: #0000ff;">Library</span> = no|yes<br />Warning Level = @/w%s<br /><br /><span style="color: #000000;">[</span>Variables<span style="color: #000000;">]</span><br />FWH = D:\SISTEMAS\COMPILER\FWH<br />HPATH = D:\SISTEMAS\COMPILER\HarbourVS<br />VSPATH = D:\Sistemas\Compiler\VS2019<br /><br />HPATHL = $<span style="color: #000000;">(</span>HPATH<span style="color: #000000;">)</span>\LIB<br />VSPATHL = $<span style="color: #000000;">(</span>VSPATH<span style="color: #000000;">)</span>\LIB<br /><br />HOPT = /n /gc0 /q $<span style="color: #000000;">(</span>Compiler Options<span style="color: #000000;">)</span> /i$<span style="color: #000000;">(</span>HPATH<span style="color: #000000;">)</span>\INCLUDE $<span style="color: #000000;">(</span>User Include Path&<span style="color: #000000;">1</span><span style="color: #000000;">)</span> $<span style="color: #000000;">(</span>User Defines<span style="color: #000000;">)</span> $<span style="color: #000000;">(</span>Automatic Memvar Declaration<span style="color: #000000;">)</span> $<span style="color: #000000;">(</span>Variables Are Assumed<span style="color: #000000;">)</span> $<span style="color: #000000;">(</span>Generate Preprocessed Output<span style="color: #000000;">)</span> $<span style="color: #000000;">(</span>Warning Level<span style="color: #000000;">)</span><br />COPT = -TP -W3 -c -I$<span style="color: #000000;">(</span>HPATH<span style="color: #000000;">)</span>\INCLUDE<br />LOPT = /nologo /subsystem:<span style="color: #000000;">windows</span> /force:<span style="color: #000000;">multiple</span> /NODEFAULTLIB:<span style="color: #000000;">libc</span><br /><br />LIBS1 = $<span style="color: #000000;">(</span>FWH<span style="color: #000000;">)</span>\LIB\FiveH32.lib $<span style="color: #000000;">(</span>FWH<span style="color: #000000;">)</span>\LIB\FiveHC32.lib <br />LIBS2 = $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbrtl.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbvm.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\gtgui.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hblang.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbmacro.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbrdd.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\rddntx.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\rddcdx.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\rddfpt.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbsix.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbdebug.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbcommon.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbpp.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\xhb.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\png.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbzlib.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbcpage.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbwin.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbct.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbcplr.lib $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>\hbpcre.lib<br />LIBS3 = $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\kernel32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\user32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\gdi32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\winspool.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\comctl32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\comdlg32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\advapi32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\shell32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\ole32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\oleaut32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\uuid.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\odbc32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\odbccp32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\iphlpapi.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\mpr.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\version.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\wsock32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\msimg32.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\oledlg.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\psapi.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\gdiplus.lib $<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>\winmm.lib<br />LIBS = $<span style="color: #000000;">(</span>LIBS1<span style="color: #000000;">)</span> $<span style="color: #000000;">(</span>LIBS2<span style="color: #000000;">)</span> $<span style="color: #000000;">(</span>LIBS3<span style="color: #000000;">)</span><br /><br /><span style="color: #000000;">[</span>Environment<span style="color: #000000;">]</span><br />PATH = $<span style="color: #000000;">(</span>HPATH<span style="color: #000000;">)</span>\BIN;$<span style="color: #000000;">(</span>VSPATH<span style="color: #000000;">)</span>\BIN;%PATH%<br />INCLUDE = $<span style="color: #000000;">(</span>FWH<span style="color: #000000;">)</span>\INCLUDE;$<span style="color: #000000;">(</span>HPATH<span style="color: #000000;">)</span>\INCLUDE;$<span style="color: #000000;">(</span>VSPATH<span style="color: #000000;">)</span>\INCLUDE<br />LIB = $<span style="color: #000000;">(</span>HPATHL<span style="color: #000000;">)</span>;$<span style="color: #000000;">(</span>VSPATHL<span style="color: #000000;">)</span>;$<span style="color: #000000;">(</span>FWH<span style="color: #000000;">)</span>\LIB<br />BuildMode = %UESMode%<br /><br /><span style="color: #000000;">[</span>General<span style="color: #000000;">]</span><br />TargetExt = .EXE<br />ReleaseOut = <span style="color: #0000ff;">Release</span><br />DebugOut = Debug<br />UseFullPaths = <span style="color: #000000;">1</span><br />UseDosNames = <span style="color: #000000;">0</span><br />Excludes = $<span style="color: #000000;">(</span>Excluded Files<span style="color: #000000;">)</span><br />GenerateEDGroup=$<span style="color: #000000;">(</span>External Dependencies<span style="color: #000000;">)</span><br />.CPP = .C<br /><br /><span style="color: #000000;">[</span>MakeCommands<span style="color: #000000;">]</span><br />run = Execute Application<br />makef = Show Makefile<br /><br /><span style="color: #000000;">[</span>Execute Application<span style="color: #000000;">]</span><br /><span style="color: #0000ff;">Title</span> = Execute $T<br />Cmd0 = $<span style="color: #000000;">(</span>Command Line Arguments<span style="color: #000000;">)</span><br />Depends = $T<br />ShowWindow = <span style="color: #000000;">1</span><br />DisplayConsole = <span style="color: #000000;">0</span><br /><br /><span style="color: #000000;">[</span>Show Makefile<span style="color: #000000;">]</span><br /><span style="color: #0000ff;">Title</span>=Show makefile<br />Cmd0=uestudio makefile<br />ShowWindow=<span style="color: #000000;">1</span><br />DisplayConsole=<span style="color: #000000;">0</span><br /><br /><span style="color: #000000;">[</span>InsertFiles<span style="color: #000000;">]</span><br /><br /><span style="color: #000000;">[</span>FileGroups<span style="color: #000000;">]</span><br />FGO = .obj;<br />FGR = .res;<br />FGL = .lib;<br />FGD = .def;<br /><br /><span style="color: #000000;">[</span>GroupFormats<span style="color: #000000;">]</span><br />FGO = %s<br />FGR = %s<br />FGL = %s<br /><br /><span style="color: #000000;">[</span>Build<span style="color: #000000;">]</span><br />Out = $T<br />Depends = $FGO $FGR<br />DebugFlag = <br />ReleaseFlag = <br />Cmd0 = $<span style="color: #000000;">(</span>VSPATH<span style="color: #000000;">)</span>\BIN\LINK $<span style="color: #000000;">(</span>LOPT<span style="color: #000000;">)</span> $FGO $FGR $<span style="color: #000000;">(</span>LIBS1<span style="color: #000000;">)</span> $<span style="color: #000000;">(</span>LIBS2<span style="color: #000000;">)</span> <span style="color: #ff0000;">"$(VSPATHL)"</span>\kernel32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\user32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\gdi32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\winspool.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\comctl32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\comdlg32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\advapi32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\advapi32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\shell32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\ole32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\oleaut32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\uuid.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\odbc32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\odbccp32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\iphlpapi.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\mpr.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\version.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\wsock32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\msimg32.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\oledlg.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\psapi.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\gdiplus.lib <span style="color: #ff0000;">"$(VSPATHL)"</span>\winmm.lib <br /><span style="color: #000000;">[</span>.PRG<span style="color: #000000;">]</span><br />Out = $In.c<br />DebugFlag = /b<br />ReleaseFlag = <br />Cmd0 = $<span style="color: #000000;">(</span>HPATH<span style="color: #000000;">)</span>\BIN\harbour $I $<span style="color: #000000;">(</span>HOPT<span style="color: #000000;">)</span> $R /o$O<br /><br />IncFiles = <span style="color: #000000;">1</span><br />CaseSensitive = <span style="color: #000000;">0</span><br />IncDirs = .;$<span style="color: #000000;">(</span>INCLUDE<span style="color: #000000;">)</span>;<br />IncKeyWords = <span style="color: #00D7D7;">#include</span>;<br />Comments = <span style="color: #B900B9;">/*.*/</span>.<span style="color: #B900B9;">//.eol.</span><br /><br /><span style="color: #000000;">[</span>.C<span style="color: #000000;">]</span><br />Out = $In.obj<br />Cmd0 = $<span style="color: #000000;">(</span>VSPATH<span style="color: #000000;">)</span>\BIN\cl.exe $<span style="color: #000000;">(</span>COPT<span style="color: #000000;">)</span> $I<br /><br /><span style="color: #000000;">[</span>.RC<span style="color: #000000;">]</span><br />Out = $In.res<br />Cmd0 = $<span style="color: #000000;">(</span>SDKPATH<span style="color: #000000;">)</span>\bin\rc -r -fo$O $I<br /><br />IncFiles = <span style="color: #000000;">1</span><br />CaseSensitive = <span style="color: #000000;">0</span><br />IncDirs = .;$<span style="color: #000000;">(</span>INCLUDE<span style="color: #000000;">)</span>;<br />IncKeyWords = <span style="color: #00D7D7;">#include</span>;<br />Comments = <span style="color: #B900B9;">/*.*/</span>.<span style="color: #B900B9;">//.eol.</span><br /> </div>[/code:3rlgqh4y]
Con BCC compila bien, También con GO.BAT
[code=fw:3rlgqh4y]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> @ECHO OFF<br />CLS<br /><br /><span style="color: #00C800;">if</span> A%<span style="color: #000000;">1</span> == A GOTO :<span style="color: #000000;">SINTAX</span><br /><span style="color: #00C800;">if</span> NOT EXIST %<span style="color: #000000;">1</span>.prg GOTO :<span style="color: #000000;">NOEXIST</span><br /><br /><span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%FWDIR%"</span> == <span style="color: #ff0000;">""</span> set FWDIR=D:\Sistemas\Compiler\FWH<br /><span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%HBDIR%"</span> == <span style="color: #ff0000;">""</span> set HBDIR=D:\Sistemas\Compiler\HarbourVS<br /><br />set GT=gtgui<br /><br />set HDIRLIB=%HBDIR%\lib<br />set VCDIR=D:\Sistemas\Compiler\VS2022<br />set VCDIRBIN=%VCDIR%\bin<br />set VCDIRLIB=%VCDIR%\lib<br /><br />ECHO Compiling...<br /><br />%HBDIR%\bin\harbour %<span style="color: #000000;">1</span> /n /w /p /i%FWDIR%\include;%HBDIR%\include /d__FLAT__ %<span style="color: #000000;">2</span> %<span style="color: #000000;">3</span> > comp.log <span style="color: #000000;">2</span>> warnings.log<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO COMPILEERROR<br />@type comp.log<br />@type warnings.log<br />Echo Pasa<br />%VCDIRBIN%\cl.exe -nologo -TC -W3 -c /GS- /I%VCDIR%\include /I%HBDIR%\include /GA %<span style="color: #000000;">1</span>.c<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO COMPILEERROR<br /><br /><span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.rc %VCDIRBIN%\rc -nologo -r -d__FLAT__ -I%VCDIR%\include %<span style="color: #000000;">1</span><br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO RESOURCESERROR<br /><br />echo %<span style="color: #000000;">1</span>.obj > msvc.tmp<br /><br />echo %FWDIR%\lib\fiveh32.lib %FWDIR%\lib\fivehc32.lib >> msvc.tmp<br />echo %HDIRLIB%\hbrtl.lib >> msvc.tmp<br />echo %HDIRLIB%\hbvm.lib >> msvc.tmp<br />echo %HDIRLIB%\%GT%.lib >> msvc.tmp<br />echo %HDIRLIB%\hblang.lib >> msvc.tmp<br />echo %HDIRLIB%\hbmacro.lib >> msvc.tmp<br />echo %HDIRLIB%\hbrdd.lib >> msvc.tmp<br />echo %HDIRLIB%\rddntx.lib >> msvc.tmp<br />echo %HDIRLIB%\rddcdx.lib >> msvc.tmp<br />echo %HDIRLIB%\rddfpt.lib >> msvc.tmp<br />echo %HDIRLIB%\hbsix.lib >> msvc.tmp<br />echo %HDIRLIB%\hbdebug.lib >> msvc.tmp<br />echo %HDIRLIB%\hbcommon.lib >> msvc.tmp<br />echo %HDIRLIB%\hbpp.lib >> msvc.tmp<br />echo %HDIRLIB%\hbcpage.lib >> msvc.tmp<br />echo %HDIRLIB%\hbwin.lib >> msvc.tmp<br />echo %HDIRLIB%\hbcplr.lib >> msvc.tmp<br />echo %HDIRLIB%\hbpcre.lib >> msvc.tmp<br />echo %HDIRLIB%\hbct.lib >> msvc.tmp<br />echo %HDIRLIB%\xhb.lib >> msvc.tmp<br />echo %HDIRLIB%\png.lib >> msvc.tmp<br />echo %HDIRLIB%\hbzlib.lib >> msvc.tmp<br />echo %HDIRLIB%\hbziparc.lib >> msvc.tmp<br />echo %HDIRLIB%\hbmzip.lib >> msvc.tmp<br />echo %HDIRLIB%\minizip.lib >> msvc.tmp<br />echo %HDIRLIB%\hbtip.lib >> msvc.tmp<br />echo %HDIRLIB%\hbzebra.lib >> msvc.tmp<br />echo %HDIRLIB%\hbusrrdd.lib >> msvc.tmp<br /><br />rem Uncomment these two lines <span style="color: #0000ff;">to</span> use Advantage RDD<br />rem echo %HDIRLIB%\rddads.lib >> msvc.tmp<br />rem echo %HDIRLIB%\ace32.lib >> msvc.tmp<br /><br />rem echo %FWDIR%\lib\libmysql.lib >> msvc.tmp<br /><br />echo user32.lib >> msvc.tmp<br />echo gdi32.lib >> msvc.tmp<br />echo winspool.lib >> msvc.tmp<br />echo comctl32.lib >> msvc.tmp<br />echo comdlg32.lib >> msvc.tmp<br />echo advapi32.lib >> msvc.tmp<br />echo shell32.lib >> msvc.tmp<br />echo ole32.lib >> msvc.tmp<br />echo oleaut32.lib >> msvc.tmp<br />echo version.lib >> msvc.tmp<br />echo msimg32.lib >> msvc.tmp<br />echo oledlg.lib >> msvc.tmp<br />echo gdiplus.lib >> msvc.tmp<br />echo winmm.lib >> msvc.tmp<br />echo kernel32.lib >> msvc.tmp<br />echo uuid.lib >> msvc.tmp<br />echo odbc32.lib >> msvc.tmp<br />echo odbccp32.lib >> msvc.tmp<br />echo iphlpapi.lib >> msvc.tmp<br />echo mpr.lib >> msvc.tmp<br />echo wsock32.lib >> msvc.tmp<br />echo psapi.lib >> msvc.tmp<br />echo vfw32.lib >> msvc.tmp<br />echo runtimeobject.lib >> msvc.tmp<br />echo ws2_32.lib >> msvc.tmp<br />echo shlwapi.lib >> msvc.tmp<br />echo strmiids.lib >> msvc.tmp<br /><br /><span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.res echo %<span style="color: #000000;">1</span>.res >> msvc.tmp<br /><br />%VCDIRBIN%\link @msvc.tmp -nologo /SUBSYSTEM:<span style="color: #000000;">windows</span> /FORCE:<span style="color: #000000;">multiple</span> /NODEFAULTLIB:<span style="color: #000000;">msvcrt</span> /LIBPATH:%VCDIRLIB%<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO LINKERROR<br /><br />rem borrando archivos temporales y ejecutando aplicacion<br />ECHO * Delete temporal files *<br />@del %<span style="color: #000000;">1</span>.c<br />@del %<span style="color: #000000;">1</span>.obj<br />@del %<span style="color: #000000;">1</span>.ppo<br />@del warnings.log<br />@del comp.log<br />#@del msvc.tmp<br />ECHO * Application successfully built *<br />%<span style="color: #000000;">1</span><br />GOTO EXIT<br />ECHO<br /><br />:<span style="color: #000000;">COMPILEERROR</span><br />@type comp.log<br />@type warnings.log<br />ECHO * Compiling errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">RESOURCESERROR</span><br />ECHO * Resources errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">LINKERROR</span><br />ECHO * Linking errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">SINTAX</span><br />ECHO SYNTAX: <span style="color: #000000;">BuildH32</span> <span style="color: #000000;">[</span>Program<span style="color: #000000;">]</span> <span style="color: #000000;">{</span>-- No especifiques la extensión PRG<br />ECHO <span style="color: #000000;">{</span>-- Don<span style="color: #ff0000;">'t specify .PRG extension<br />GOTO EXIT<br /><br />:NOEXIST<br />ECHO The specified PRG %1 does not exist<br /><br />:EXIT<br /></span></div>[/code:3rlgqh4y]
Gracias por la ayuda
|
ApplicationVS para UEstudio
|
Estimado Antonio
Me puede compartir el ApplicationVS que funcione.
Muchas gracias.
|
Applications open a DOS box - why?
|
Hi,
Just curious, why do the sample applications which come with Fivewin/xHarbour open a DOS box when executed?
Thanks
George Trojan
|
Applications open a DOS box - why?
|
George,
What Harbour/xharbour versions/builds are you using ? And what Windows version are you using ?
With recent Harbour builds there was such error with Windows 98 only. It has been recently fixed.
Are you linking using the parameters that we specify at samples\buildh.bat ?
|
Applications open a DOS box - why?
|
xHarbour build 0.99.61, the buildx.bat supplied with FW2.7; however, the applications are built using Win'98. We use '98 as many of our customers still use '98 so we develop using a '98 computer.
Thanks
|
Applications open a DOS box - why?
|
George,
Please don't link GTWIN.lib and build your app again.
|
Applications open a DOS box - why?
|
The only problem with that is that you get all the unresolved external mouse functions referenced from RTL.LIB
Thanks
|
Applications open a DOS box - why?
|
George,
Please copy here the list of unresolved externals that you get.
Here we only get:
Unresolved external '_HB_FUN_HB_GT_WIN'
|
Applications open a DOS box - why?
|
I get the same with harbour, with xharbour I get the below:
Thanks
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_hb_gt_Init' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_GetScreenHeight' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_GetScreenWidth' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Exit' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_ExtendedKeySupport' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_ReadKey' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_AdjustPos' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Box' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_VertLine' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_HorizLine' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_PreExt' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_PostExt' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Row' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Col' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_SetPos' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_SetCursorStyle' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_IsColor' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_RectSize' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Replicate' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_GetBlink' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_SetBlink' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_SetMode' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Puts' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Scroll' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Tone' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Version' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_DispCount' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_DispEnd' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Suspend' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_Resume' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_DispBegin' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_SetClipboard' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_GetClipboardSize' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_ProcessMessages' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_GetClipboard' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_GetText' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_PutText' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_gt_SetAttribute' referenced from C:\XHARBOUR\LIB\RTL.LIB|gtapi
Error: Unresolved external '_hb_mouse_IsPresent' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_Show' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_Hide' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_Col' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_Row' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_SetPos' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_IsButtonPressed' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_CountButton' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_SetBounds' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_mouse_GetBounds' referenced from C:\XHARBOUR\LIB\RTL.LIB|mouseapi
Error: Unresolved external '_hb_gt_OutStd' referenced from C:\XHARBOUR\LIB\RTL.LIB|console
Error: Unresolved external '_hb_gt_OutErr' referenced from C:\XHARBOUR\LIB\RTL.LIB|console
|
Applications open a DOS box - why?
|
George,
This problem was fixed yesterday for Harbour and we expect to have a solution for xharbour today.
|
Applications open a DOS box - why?
|
George,
Please link GTNUL.lib instead GTWIN.lib and try it again. Thanks.
|
Applications open a DOS box - why?
|
Thanks for that. Searched my drive for GTNUL.LIB, don't seem to have one. Where can I source that library.
Thanks again.
|
Applications open a DOS box - why?
|
George,
What xharbour build do you use ?
|
Applications open a DOS box - why?
|
Antonio,
xHarbour build 0.99.61, downloaded with FW2.7 from your server.
Thanks
|
Applications open a DOS box - why?
|
George,
We are going to publish a new xharbour build this next week, with a GTGUI.lib to be used, that solves the console window issue.
Same for Harbour.
|
Applications open a DOS box - why?
|
Thanks
|
Applications open a DOS box - why?
|
[quote="George Trojan":f3wgmo3l]Thanks[/quote:f3wgmo3l]
Amigo,
Lo resolví de la siguiente manera.
Eliminé la LIB GTWIN y adicioné la GTNUL.LIB
Adicioné un PRG: gtnul.prg conteniendo lo siguiente:
[code:f3wgmo3l]REQUEST HB_GT_NUL
FUNCTION GTSYS
RETURN[/code:f3wgmo3l]
Funcionando sin problemas hasta ahora.
Si alguien conoce o sabe que hace la GTSYS, agradecería lo explicara.
Saludos
PD. Uso xHarbour (bajado del CVS 26-06-2006, 10:00pm) y FWH 2.7
|
Applications open a DOS box - why?
|
William,
Hay que usar GTGUI.lib que es la librería correcta para Windows. Con GTNUL.lib hay cosas que no funcionan, como por ejemplo Tone().
You should use GTGUI.lib which it is the right lib for Windows. With GTNUL.lib there are missing features, i.e. Tone().
|
Applications open a DOS box - why?
|
[quote="Antonio Linares":2j7oxz5t]William,
Hay que usar GTGUI.lib que es la librería correcta para Windows. Con GTNUL.lib hay cosas que no funcionan, como por ejemplo Tone().
You should use GTGUI.lib which it is the right lib for Windows. With GTNUL.lib there are missing features, i.e. Tone().[/quote:2j7oxz5t]
Gracias Antonio, pruebo y comento
saludos
|
Applications open a DOS box - why?
|
[quote="Antonio Linares":2fl06apa]William,
Hay que usar GTGUI.lib que es la librería correcta para Windows. Con GTNUL.lib hay cosas que no funcionan, como por ejemplo Tone().
You should use GTGUI.lib which it is the right lib for Windows. With GTNUL.lib there are missing features, i.e. Tone().[/quote:2fl06apa]
Antonio,
No encuentro la GTGUI.LIB, hay algun lugar para descargarla?
Saludos
|
Applications open a DOS box - why?
|
William,
Se supone que Przemek la iba a implementar en xharbour lo antes posible. Has probado a hacer un checkout por si está ya ?
|
Applications open a DOS box - why?
|
I just ran into this issue today as I loaded my new 32bit apps on Win 98 machines. Will there be a notification on when to download the new version of FWH when this is fixed?
Thanks,
Greg
|
Applications open a DOS box - why?
|
Greg,
It is not a FWH issue, it is a Harbour issue. We may publish a new Harbour build with the fix asap.
|
Applications open a DOS box - why?
|
We have just published a new Harbour for Borland build that works ok:
<!-- m --><a class="postlink" href="http://hyperupload.com/download/026ece0f78/harbour.EXE.html">http://hyperupload.com/download/026ece0 ... r.EXE.html</a><!-- m -->
Please remember to link GTGUI.lib instead of GTWIN.lib
You may also find it at these forums, whatsnew section, Harbour/xHarbour builds.
|
Applications open a DOS box - why?
|
Ive downloaded the new Harbour....I do not see a GTGUI in the library.
|
Applications open a DOS box - why?
|
Greg,
Our mistake, sorry. Please download it again:
<!-- m --><a class="postlink" href="http://hyperupload.com/download/026ece0f78/harbour.EXE.html">http://hyperupload.com/download/026ece0 ... r.EXE.html</a><!-- m -->
|
Applications open a DOS box - why?
|
[quote="Antonio Linares":ucv1nqe9]Greg,
Our mistake, sorry. Please download it again:
<!-- m --><a class="postlink" href="http://hyperupload.com/download/026ece0f78/harbour.EXE.html">http://hyperupload.com/download/026ece0 ... r.EXE.html</a><!-- m -->[/quote:ucv1nqe9]
Antonio,
encontré la los fuentes de GTGUI, la compilo y cuento al respecto.
Saludos
|
Applications open a DOS box - why?
|
William,
GTGUI.lib está funcionando correctamente. Hoy hemos publicado nuevos builds, con las modificaciones más recientes del CVS y probados por nosotros. Mira en la sección "whatsnew", "Harbour/xHarbour builds".
|
Applications open a DOS box - why?
|
[quote="Antonio Linares":2bq2q70d]William,
GTGUI.lib está funcionando correctamente. Hoy hemos publicado nuevos builds, con las modificaciones más recientes del CVS y probados por nosotros. Mira en la sección "whatsnew", "Harbour/xHarbour builds".[/quote:2bq2q70d]
Gracias, saludos
|
ApplyParams Tdatabase
|
I use this Nages function for search on a dbf ( with tdatabase)
[code=fw:2nhso6tk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">Function</span> IsFree<span style="color: #000000;">(</span>cCamera,dCheck_in,dCheck_out,cTypeRoom,oPrenotazioni<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> lFree<br /> <span style="color: #00C800;">local</span> cSearch<br /> <br /><br /> cSearch := oPrenotazioni:<span style="color: #000000;">ApplyParams</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ROOMS_ID == ? .AND. ALLTRIM(TYPE) == ? .AND. RECNO() != ? .AND. (CHECK_IN > ? .OR. CHECK_OUT < ? )"</span>, ;<br /> <span style="color: #000000;">{</span> cCamera, ALLTRIM<span style="color: #000000;">(</span> cTypeRoom <span style="color: #000000;">)</span>, oPrenotazioni:<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, dCheck_out, dCheck_in <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">if</span> oPrenotazioni:<span style="color: #000000;">LookUp</span><span style="color: #000000;">(</span> cSearch, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">{</span> || .T. <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> == .T.<br /><br /> lFree:=.t.<br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"room is available"</span>+CRLF+CRLF+;<br /> <span style="color: #ff0000;">"Room number : "</span>+cCamera+CRLF+;<br /> <span style="color: #ff0000;">"Room ctype : "</span>+cTypeRoom+CRLF+;<br /> <span style="color: #ff0000;">"Check in : "</span>+cf<span style="color: #000000;">(</span>dCheck_in<span style="color: #000000;">)</span>+CRLF+;<br /> <span style="color: #ff0000;">"Check out : "</span>+cf<span style="color: #000000;">(</span>dCheck_out<span style="color: #000000;">)</span>+CRLF+;<br /> <span style="color: #ff0000;">"No Record : "</span>+ltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>oPrenotazioni:<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">else</span><br /><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"room is not availble"</span>+CRLF+CRLF+;<br /> <span style="color: #ff0000;">"Room number : "</span>+cCamera+CRLF+;<br /> <span style="color: #ff0000;">"Room ctype : "</span>+cTypeRoom+CRLF+;<br /> <span style="color: #ff0000;">"Check in : "</span>+cf<span style="color: #000000;">(</span>dCheck_in<span style="color: #000000;">)</span>+CRLF+;<br /> <span style="color: #ff0000;">"Check out : "</span>+cf<span style="color: #000000;">(</span>dCheck_out<span style="color: #000000;">)</span>+CRLF+;<br /> <span style="color: #ff0000;">"No Record : "</span>+ltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>oPrenotazioni:<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> lFree:=.f.<br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> lFree</div>[/code:2nhso6tk]
however, I realized that if I call the function several times, it makes an error, that is, [b:2nhso6tk]it does not make a truthful search[/b:2nhso6tk]
making mistakes in the procedure
In edit procedure I must change the position continuously and look for the most appropriate for the client
when I change the position I mean the type of the item, the number and the date range for the reservation.
[img:2nhso6tk]https://i.postimg.cc/VNnWPh7d/ghj.png[/img:2nhso6tk]
the procedure should search the archive if the element (type) with the selected dates is free or busy and return me an info message
|
ApplyParams Tdatabase
|
Silvio,
I don't see why you are searching with so many criteria. And what does recno() have to do with finding an available room? It seems to me there are only three senarios:
1) Find any room available for the desired check_in and check_out dates. --Two criteria
2) Find any room available for a specific room type (or room ID), check_in, and check_out dates. -Three criteria
3) Find out if an existing room reservation can be lengthened and which way (add days for the front or back of the existing reservation). -Three criteria, room ID, length of extension (days), and which way (front or back of the existing reservation).
There is one scenario when you don't have to do any searching. That is shortening an existing reservation--you just do it.
You will obviously need to return the recno() for any results since you don't have a reservation ID. However, you don't need to search for the recno() to find an open reservation.
Using the recno() for an ID is risky since if a record gets deleted, then all the records after that recno() will get renumbered. That will be a mess. Thus you should always have a unique primary key in any database (with only a few rare exceptions). I highly recommend you switch to using a reservation ID.
|
ApplyParams Tdatabase
|
Silvio,
[quote:ifkbiacv]in fact you didn't understand anything about what I'm doing.[/quote:ifkbiacv]
Maybe not.
[quote:ifkbiacv]I already have a reservation number "RR2454456667" inserted ok?[/quote:ifkbiacv]
Hmm, well I didn't know because in the reservation database you sent me that field is named NUMPRE, and it is 18 digits long. The fieldname didn't sound like RESNO, RESID or similar, and I don't even know how big of a number is 18 digits long (1,000 trillion). Wow, that is a lot of reservations for only a 3 month period. Why such a huge field, maybe a government requirement? Also, it is traditional to have the ID field as the first field--and this also allows you to always use setOrder(1), to search the primary-key field in any database.
My ID fields are usually 6 digits, as that handles one less than a million numbers.
[quote:ifkbiacv]the recno is needed because I am in modification of that record and when I search for that information it should not be considered the tecord that I am modifying.[/quote:ifkbiacv]
I'm still not sure why you would need that. Aren't you looking for available records only? Since the one you are editing is not available for it's own date range it will not show as available anyway. If you are looking to shorten the length of stay, then you don't need to search at all.
[quote:ifkbiacv]But now customer James Bott thinks about it, the customer James Bott wants to change the period of stay and wants from 08/07/2021 to 29/07/2021
A day goes by and the customer James bott comes back to me and tells me that for family reasons he has to go back to America a week before that is to change the period from 08/07/2021 al 21/07/2021[/quote:ifkbiacv]
You can immediately just change the checkout date without any searching at all. Since you are going to free up a week (29/07/2021 is going to be changed to 21/07/2021). So you just change the 29 to 21 and save. No search needed.
Of course, if the customer wants to extend their stay, then you will have to search.
|
ApplyParams Tdatabase
|
in fact you didn't understand anything about what I'm doing.
I already have a reservation number "RR2454456667" inserted ok?
[b:227k26rq]From[/b:227k26rq] 08/07/2021 [b:227k26rq]to[/b:227k26rq] 28/07/2021
[b:227k26rq]Element[/b:227k26rq] type 01 ( umbrella)
[b:227k26rq]Number[/b:227k26rq] 0006
record number 6
Go to modification of this record.
BECAUSE now the customer has changed his mind and wants another number of umbrella, in another position or near the umbrella of a friend of his,
or he wants to change the period,
or instead of the normal umbrella (4 seats) he wants to take an umbrella hawayano (10 seats),
the recno is needed because I am in modification of that record and when I search for that information it should not be considered the tecord that I am modifying.
I don't understand what's difficult to understand.
[b:227k26rq]>1) Find any room available for the desired check_in and check_out dates. --Two criteria
>2) Find any room available for a specific room type (or room ID), check_in, and check_out dates. -Three criteria
>3) Find out if an existing room reservation can be lengthened and which way (add days for the front or back of the existing reservation). -Three criteria, room ID, length of extension (days), and which way (front or back of the existing reservation)[/b:227k26rq].
I don't have to do any of these three things as already explained above.
[b:227k26rq]I have entered a reservation[/b:227k26rq]
[b:227k26rq]order number[/b:227k26rq] RRxxxxxxxxxxx
[b:227k26rq]Period from[/b:227k26rq] 08/07/2021 to 27/07/2021
[b:227k26rq]Customer[/b:227k26rq] James Bott
[b:227k26rq]Type[/b:227k26rq] Parasol Element (01)
[b:227k26rq]Number[/b:227k26rq] 0006
the customer james bott has already paid or given a deposit
the customer James Bott comes to me because Antonio Linares has arrived at number 10 and wants to be close to his friend Antonio
so I have to look for an umbrella that is close to number 10 and that has the free period that the customer James Bott wants
But now customer James Bott thinks about it , the customer James Bott wants to change the period of stay and wants from 08/07/2021 to 29/07/2021
A day goes by and the customer James bott comes back to me and tells me that for family reasons he has to go back to america a week before that is to change the period from 08/07/2021 al 21/07/2021
I see his umbrella free for a week so it's free for other bookings
James, this is the hypothetical scenario that happens every day in the chalet
[b:227k26rq]>You will obviously need to return the recno() for any results since you don't have a reservation ID. However, you don't need to search for the recno() to find an open reservation.[/b:227k26rq]
I have a reservation id, I use a unique 13 character order or reservation number "RRxxxxxxxxxxx" that is created every time you make a new add
|
ApplyParams Tdatabase
|
Silvio,
[quote:2trsc1ad]In edit procedure I must change the position continuously and look for the most appropriate for the client
when I change the position I mean the type of the item, the number and the date range for the reservation.[/quote:2trsc1ad]
This could be automated. Just build a routine that looks for all free rooms for the customer's desired date range. Collect them all and present in a browse of available reservations for the user to select from. They could also be sorted by room and/or type.
James
|
ApplyParams Tdatabase
|
[quote="James Bott":3eh7ifpr]Hmm, well I didn't know because in the reservation database you sent me that field is named NUMPRE, and it is 18 digits long. The fieldname didn't sound like RESNO, RESID or similar, and I don't even know how big of a number is 18 digits long (1,000 trillion). Wow, that is a lot of reservations for only a 3 month period. Why such a huge field, maybe a government requirement? Also, it is traditional to have the ID field as the first field--and this also allows you to always use setOrder(1), to search the primary-key field in any database.
My ID fields are usually 6 digits, as that handles one less than a million numbers.[/quote:3eh7ifpr]
[b:3eh7ifpr]I honestly don't understand what your common thread is and what the reservation number has to do with it.[/b:3eh7ifpr]
No government requirements.
Do I have to explain on the public forum how I created the NUMPRE field or the INVOICE field?
Exactly, the field is 18 characters and is a string formed by an internal code RR (reservation "or SS" single receipt "or by another code that I would like not to explain in the public forum
and is formed by
Year
the current month
the current time including seconds
[b:3eh7ifpr]are you happy that I explained on public forum how that unique code was created?[/b:3eh7ifpr]
I thought of this code when [b:3eh7ifpr]* someone *[/b:3eh7ifpr] insisted telling me that [b:3eh7ifpr]with tdatabase (or tdata)[/b:3eh7ifpr]
I couldn't know the record number and adding +1 to the value because in ancient times the reservation number was made up of the record number - strzero (recno, 4) + 1 -
I would have liked not to publicly explain how the code is made, I don't see why this could affect the search I asked for, the order or reservation number must not be changed, it remains the same even when the record is in modification
>I'm still not sure why you would need that. Aren't you looking for available records only? Since the one you are editing is not available for it's own date range it will not show as available anyway. If you are looking to shorten the >length of stay, then you don't need to search at all.
>You can immediately just change the checkout date without any searching at all. Since you are going to free up a week (29/07/2021 is going to be changed to 21/07/2021). So you just change the 29 to 21 and save. No search >needed.
>Of course, if the customer wants to extend their stay, then you will have to search.
James,
[b:3eh7ifpr]Are you sure you have seen the archive correctly?[/b:3eh7ifpr]
[b:3eh7ifpr]this is the sample test I sent you [/b:3eh7ifpr]
[img:3eh7ifpr]https://i.postimg.cc/Hx6ss1xn/reserva.png[/img:3eh7ifpr]
I 'm edting the record number 6 where you found the NUMPRE or INVOICE NUMBER as [b:3eh7ifpr]"RR20062313371"[/b:3eh7ifpr] ( RRAAMMHHMMSS)
[b:3eh7ifpr]ROOMS_ID [/b:3eh7ifpr]0006
[b:3eh7ifpr]TYPE [/b:3eh7ifpr] 01
[b:3eh7ifpr]CHECK_IN[/b:3eh7ifpr] 08/07/2021
[b:3eh7ifpr]CHECK_OUT[/b:3eh7ifpr] 28/07/2021
the customer want another day [b:3eh7ifpr] until 29/07/2021[/b:3eh7ifpr]
[b:3eh7ifpr]I cannot automatically add a day I have to have the program search for it if it is free or busy[/b:3eh7ifpr]
[b:3eh7ifpr]in fact if you see well there is a record number 12 which is the same element (0006/01) and is occupied on the day 29/07/2021[/b:3eh7ifpr]
so I didn't understand your unhealthy idea of adding a day without doing the proper research
>This could be automated. Just build a routine that looks for all free rooms for the customer's desired date range.
> Collect them all and present in a browse of available reservations for the user to select from. They could also be >sorted by room and/or type.
yes of course, I must publish also this ?
[b:3eh7ifpr]good [/b:3eh7ifpr]
[img:3eh7ifpr]https://i.postimg.cc/Gpp0jYkN/near.jpg[/img:3eh7ifpr]
Naturally, the screen searches based on the search date and draws the beach section where the customer's (orange) umbrella is located
when the customer comes because he wants to be close to his friend or to change the umbrella I show him and choose with this screen
the OMB 11 on the picture is the record I 'am editing, the green boxes are free
[b:3eh7ifpr]but I had requested something else[/b:3eh7ifpr]
[b:3eh7ifpr]in the simulation I sent you there were specific searches[/b:3eh7ifpr]
[b:3eh7ifpr]and my question was another[/b:3eh7ifpr]
that is, calling the Isfree () function this does not work, or rather it works the first time and then flickers
that is, it does not always perform all searches correctly, returning an incorrect value
|
ApplyParams Tdatabase
|
[quote:1t2dqik5]>I honestly don't understand what your common thread is and what the reservation number has to do with it.
No government requirements.
Do I have to explain on the public forum how I created the NUMPRE field or the INVOICE field?
Exactly, the field is 18 characters and is a string formed by an internal code RR (reservation "or SS" single receipt "or by another code that I would like not to explain in the public forum
and is formed by
Year
the current month
the current time including seconds
are you happy that I explained on public forum how that unique code was created?[/quote:1t2dqik5]
Gee, Silvio, you sent me an email specifically requesting that I answer questions about this message thread on the forum, so that is what I did.
I just mentioned the ID since I didn't know there was an ID. If it was traditional (shorter and the first field) I would have assumed it was the ID. I must say you have come up with a unique way of generating a new ID--I have never seen anything like it before. As long as it works for you.
[quote:1t2dqik5]>I thought of this code when * someone * insisted telling me that with tdatabase (or tdata) I couldn't know the record number and adding +1 to the value because in ancient times the reservation number was made up of the record number - strzero (recno, 4) + 1 -[/quote:1t2dqik5]
Well, that is not a complete description of that situation. In a multi-user system, you cannot assign an ID before a record is even entered by the user, since multiple other users could get the same ID before any of the records were saved. Then you will end up with a database having multiple records with the same ID.
[quote:1t2dqik5]>I would have liked not to publicly explain how the code is made, I don't see why this could affect the search I asked for, the order or reservation number must not be changed, it remains the same even when the record is in modification.[/quote:1t2dqik5]
I was trying to simplify the search for you--I said nothing about changing a reservation number.
[quote:1t2dqik5]>the customer want another day until 29/07/2021
I cannot automatically add a day I have to have the program search for it if it is free or busy
in fact if you see well there is a record number 12 which is the same element (0006/01) and is occupied on the day 29/07/2021
so I didn't understand your unhealthy idea of adding a day without doing the proper research.[/quote:1t2dqik5]
If you re-read the paragraph you are referring to, I said that if you are REMOVING days from a reservation you don't need to do a search. And if you adding them, then you do need to do a search. My exact words were:
[i:1t2dqik5] Since you are going to free up a week (29/07/2021 is going to be changed to 21/07/2021). So you just change the 29 to 21 and save. No search needed. Of course, if the customer wants to extend their stay, then you will have to search.[/i:1t2dqik5]
James
|
ApplyParams Tdatabase
|
[quote="James Bott":2x2ke3zy][quote:2x2ke3zy]>I honestly don't understand what your common thread is and what the reservation number has to do with it.
No government requirements.
Do I have to explain on the public forum how I created the NUMPRE field or the INVOICE field?
Exactly, the field is 18 characters and is a string formed by an internal code RR (reservation "or SS" single receipt "or by another code that I would like not to explain in the public forum
and is formed by
Year
the current month
the current time including seconds
are you happy that I explained on public forum how that unique code was created?[/quote:2x2ke3zy]
Gee, Silvio, you sent me an email specifically requesting that I answer questions about this message thread on the forum, so that is what I did.
I just mentioned the ID since I didn't know there was an ID. If it was traditional (shorter and the first field) I would have assumed it was the ID. I must say you have come up with a unique way of coming up with a new ID--I have never seen anything like it before. As long as it works for you.
[quote:2x2ke3zy]>I thought of this code when * someone * insisted telling me that with tdatabase (or tdata)
I couldn't know the record number and adding +1 to the value because in ancient times the reservation number was made up of the record number - strzero (recno, 4) + 1 -[/quote:2x2ke3zy]
Well, that is not a complete description of that situation. In a multi-user system, you cannot just assign an ID before a record is even entered by the user, since multiple other people could get the same ID before any of the records were saved. Then you will end up with a database having multiple records with the same ID.
[quote:2x2ke3zy]>I would have liked not to publicly explain how the code is made, I don't see why this could affect the search I asked for, the order or reservation number must not be changed, it remains the same even when the record is in modification.[/quote:2x2ke3zy]
I was trying to simplify the search for you--I said nothing about changing a reservation number.
[quote:2x2ke3zy]>the customer want another day until 29/07/2021
I cannot automatically add a day I have to have the program search for it if it is free or busy
in fact if you see well there is a record number 12 which is the same element (0006/01) and is occupied on the day 29/07/2021
so I didn't understand your unhealthy idea of adding a day without doing the proper research.[/quote:2x2ke3zy]
If you re-read the paragraph you are referring to, I said that if you are REMOVING days from a reservation you don't need to do a search. And if you adding them, then you do need to do a search. My exact words were:
[i:2x2ke3zy] Since you are going to free up a week (29/07/2021 is going to be changed to 21/07/2021). So you just change the 29 to 21 and save. No search needed. Of course, if the customer wants to extend their stay, then you will have to search.[/i:2x2ke3zy]
James[/quote:2x2ke3zy]
James,
>Gee, Silvio, you sent me an email specifically requesting that I answer questions about this message thread on the forum, so that is what I did.
I sent you a test with simulation of calls to the Isfree()
[b:2x2ke3zy]this test[/b:2x2ke3zy] ( perhaps you not seen it
[code=fw:2x2ke3zy]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dtpicker.ch"</span><br /><br /><br />request dbfcdx<br />request dbffpt<br /><br />request hb_lang_it<br />request hb_codepage_itwin<br /><br /><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><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 /> SetHandleCount<span style="color: #000000;">(</span> <span style="color: #000000;">100</span> <span style="color: #000000;">)</span><br /> FWNumFormat<span style="color: #000000;">(</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">)</span><br /><br /><br /> SET DATE FORMAT <span style="color: #ff0000;">"dd-mm-yyyy"</span><br /> SET DELETED <span style="color: #0000ff;">ON</span><br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /> SET EPOCH <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">year</span><span style="color: #000000;">(</span> date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">20</span><br /> SET MULTIPLE OFF<br /><br /><br />Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------------------//</span><br /><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> oPrenotazioni<br /><span style="color: #00C800;">local</span> cCamera<br /><span style="color: #00C800;">local</span> cTypeRoom<br /><span style="color: #00C800;">local</span> dCheck_in<br /><span style="color: #00C800;">local</span> dCheck_out<br /><span style="color: #00C800;">local</span> cNumPre:=<span style="color: #ff0000;">"RR20062313371 "</span><br /><span style="color: #00C800;">local</span> oRecPrenota<br /><br /><br /><br /> dCheck_in := ctod<span style="color: #000000;">(</span><span style="color: #ff0000;">"08/07/2021"</span><span style="color: #000000;">)</span><br /> dCheck_out := ctod<span style="color: #000000;">(</span><span style="color: #ff0000;">"28/07/2021"</span><span style="color: #000000;">)</span><br /><br /> oPrenotazioni := TReserva<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><br /><span style="color: #B900B9;">// simulation 1 Initial search on Archive from nInvoice number</span><br /><br /><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Now I search on archive the nIvoice number RR20062313371"</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// search on archive the record</span><br /> nInvoice:= alltrim<span style="color: #000000;">(</span>cNumPre<span style="color: #000000;">)</span><br /> oPrenotazioni:<span style="color: #000000;">setorder</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"res_pre"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> oPrenotazioni:<span style="color: #000000;">seek</span><span style="color: #000000;">(</span>nInvoice<span style="color: #000000;">)</span><br /> oRecPrenota:=oPrenotazioni:<span style="color: #000000;">record</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//modify</span><br /> dFirst := oRecPrenota:<span style="color: #000000;">check_in</span><br /> dLast := oRecPrenota:<span style="color: #000000;">check_out</span><br /> cCamera := oRecPrenota:<span style="color: #000000;">ROOMS_ID</span><br /> cTypeRoom := oRecPrenota:<span style="color: #000000;">TYPE</span><br /> <span style="color: #00C800;">ELSE</span><br /> Msgstop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Reservation not found!!"</span>,<span style="color: #ff0000;">"Attention"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> <span style="color: #00C800;">Endif</span><br /><br /> xbrowser oPrenotazioni<br /><br /> <span style="color: #B900B9;">// add a day on dLast</span><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Now I add a day"</span><span style="color: #000000;">)</span><br /> IsFree<span style="color: #000000;">(</span>cCamera,dFirst,dLast<span style="color: #000000;">+1</span>,cTypeRoom,oPrenotazioni<span style="color: #000000;">)</span> <span style="color: #B900B9;">// 29/07/2021</span><br /><br /><br /><br /><br /><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Now I change the number and the type, because the customer want change room (0001) type 02, so the invoice number is the same "</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// simulation 2 // change number and type same rage of dates</span><br /><br />cCamera :=<span style="color: #ff0000;">"0001"</span><br />cTypeRoom :=<span style="color: #ff0000;">"02"</span><br /><br />IsFree<span style="color: #000000;">(</span>cCamera,dFirst,dLast<span style="color: #000000;">+1</span>,cTypeRoom,oPrenotazioni<span style="color: #000000;">)</span><br /><br /><br /><br /><br /><br /><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Now I change and return to initial state number room and type"</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// simulation 3 // change on number and type initial , date ragnge intial</span><br /><br />cCamera :=<span style="color: #ff0000;">"0006"</span><br />cTypeRoom :=<span style="color: #ff0000;">"01"</span><br /><br />IsFree<span style="color: #000000;">(</span>cCamera,dFirst,dLast,cTypeRoom,oPrenotazioni<span style="color: #000000;">)</span><br /><br /><br /><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Now I change all numer 0002, type 01, one day 14/7/2021"</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// simulation 4 // change on number and type , date range</span><br /><br />cCamera :=<span style="color: #ff0000;">"0002"</span><br />cTypeRoom :=<span style="color: #ff0000;">"01"</span><br />dFirst:=ctod<span style="color: #000000;">(</span><span style="color: #ff0000;">"14/07/2021"</span><span style="color: #000000;">)</span><br />dLast :=ctod<span style="color: #000000;">(</span><span style="color: #ff0000;">"14/07/2021"</span><span style="color: #000000;">)</span><br />IsFree<span style="color: #000000;">(</span>cCamera,dFirst,dLast,cTypeRoom,oPrenotazioni<span style="color: #000000;">)</span><br /><br /><br /><br /><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"The invoice is seeked right on archive"</span>+CRLF+ ;<br /> <span style="color: #ff0000;">"Simulation 1 is ok the range ( 8/07 to 29/07 is not avaible )"</span>+CRLF+ ;<br /> <span style="color: #ff0000;">"Simulation 2 is no ok there's no reservation with number 0001"</span>+CRLF+ ;<br /> <span style="color: #ff0000;">"Simulation 3 is ok I return to initial search "</span>+CRLF+ ;<br /> <span style="color: #ff0000;">"Simulation 4 is no ok for the 14/07 the rooms seem avaible but the function show is not avaible "</span><span style="color: #000000;">)</span><br /><br /><br /><br />oRecPrenota:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oPrenotazioni:<span style="color: #000000;">close</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 /><br /><span style="color: #00C800;">Function</span> IsFree<span style="color: #000000;">(</span>cCamera,dCheck_in,dCheck_out,cTypeRoom,oPrenotazioni<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> lFree<br /> <span style="color: #00C800;">local</span> cSearch<br /> * ? cCamera<br /><br /> cSearch := oPrenotazioni:<span style="color: #000000;">ApplyParams</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ROOMS_ID == ? .AND. ALLTRIM(TYPE) == ? .AND. RECNO() != ? .AND. (CHECK_IN > ? .OR. CHECK_OUT < ? )"</span>, ;<br /> <span style="color: #000000;">{</span> cCamera, ALLTRIM<span style="color: #000000;">(</span> cTypeRoom <span style="color: #000000;">)</span>, oPrenotazioni:<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, dCheck_out, dCheck_in <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">if</span> oPrenotazioni:<span style="color: #000000;">LookUp</span><span style="color: #000000;">(</span> cSearch, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">{</span> || .T. <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> == .T.<br /><br /> lFree:=.t.<br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"room is available"</span>+CRLF+CRLF+;<br /> <span style="color: #ff0000;">"Room number : "</span>+cCamera+CRLF+;<br /> <span style="color: #ff0000;">"Room ctype : "</span>+cTypeRoom+CRLF+;<br /> <span style="color: #ff0000;">"Check in : "</span>+cf<span style="color: #000000;">(</span>dCheck_in<span style="color: #000000;">)</span>+CRLF+;<br /> <span style="color: #ff0000;">"Check out : "</span>+cf<span style="color: #000000;">(</span>dCheck_out<span style="color: #000000;">)</span>+CRLF+;<br /> <span style="color: #ff0000;">"No Record : "</span>+ltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>oPrenotazioni:<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">else</span><br /><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"room is not availble"</span>+CRLF+CRLF+;<br /> <span style="color: #ff0000;">"Room number : "</span>+cCamera+CRLF+;<br /> <span style="color: #ff0000;">"Room ctype : "</span>+cTypeRoom+CRLF+;<br /> <span style="color: #ff0000;">"Check in : "</span>+cf<span style="color: #000000;">(</span>dCheck_in<span style="color: #000000;">)</span>+CRLF+;<br /> <span style="color: #ff0000;">"Check out : "</span>+cf<span style="color: #000000;">(</span>dCheck_out<span style="color: #000000;">)</span>+CRLF+;<br /> <span style="color: #ff0000;">"No Record : "</span>+ltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>oPrenotazioni:<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> lFree:=.f.<br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> lFree<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">FUNCTION</span> Cf<span style="color: #000000;">(</span>dTemp<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> Meses:=<span style="color: #ff0000;">"GenFebMarAprMagGiuLugAgoSetOttNovDic"</span><br /> <span style="color: #00C800;">LOCAL</span> f, m, cMes, dFech<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 /> cMes:=<span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>m<><span style="color: #000000;">0</span>,<span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span>Meses,<span style="color: #000000;">(</span>m*<span style="color: #000000;">3</span><span style="color: #000000;">)</span><span style="color: #000000;">-2</span>,<span style="color: #000000;">3</span><span style="color: #000000;">)</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">)</span><br /> dFech:=<span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>m<><span style="color: #000000;">0</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>+cMes+<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><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">CLASS</span> TXData <span style="color: #0000ff;">from</span> TDataBase<br /> <span style="color: #00C800;">DATA</span> cDbfPath <span style="color: #0000ff;">init</span> cFilePath<span style="color: #000000;">(</span>GetModuleFileName<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//for test</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><br /><span style="color: #00C800;">CLASS</span> TReserva <span style="color: #0000ff;">from</span> TXData<br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> lShared <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TReserva<br /> <span style="color: #00C800;">Default</span> lShared := .t.<br /> ::<span style="color: #00C800;">super</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span>,::<span style="color: #000000;">cDbfPath</span> + <span style="color: #ff0000;">"Reserva"</span> ,<span style="color: #ff0000;">"DBFCDX"</span>, lShared<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">use</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">setOrder</span><span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">RETURN</span> Sel</div>[/code:2x2ke3zy]
the invoice and numpre fields must remain so in modification, I thought of it in this way also to create labels with barcodes and qr code.
I don't use any IDs
the reserva file is indexed on [b:2x2ke3zy]ROOMS_ID + DToS (CHECK_IN)[/b:2x2ke3zy]
>If you re-read the paragraph you are referring to, I said that if you are REMOVING days from a reservation you don't need to do a search. And if you adding them, then you do need to do a search. My exact words were:
>Since you are going to free up a week (29/07/2021 is going to be changed to 21/07/2021). So you just change the 29 to 21 and save. No search needed. Of course, if the customer wants to extend their stay, then you will have >to search.
[b:2x2ke3zy]sorry james, but to change the date of the reservation I have to go to "modify reservation" there are no other ways, the user cannot see the archive with a dbu as we see it[/b:2x2ke3zy]
so if I open the booking change dialog I have to change the date range that the customer prefers, at the time of changing these dates the procedure must search the archive if the period is free or busy, if the customer he wants a week less or more, or a day more or less or he wants another number, how do I know if he is free or busy for the week in question.
so at any time if the operator being changed changes
1) the type of the element
2) the number
3) the check_in
4) check_out
the procedure must check if it is free or busy
the operator cannot guess
1) if it is free, it can confirm the change
2) if he is busy he must select an alternative of number or dates
or cancel the reservation
[b:2x2ke3zy]there is nothing difficult
I asked
how is it possible that if I call Isfree () several times and with different parameters it gives me an error or exactly does not return a true day value?[/b:2x2ke3zy]
|
ApplyParams Tdatabase
|
Silvio,
[quote:3641gx3h]>this test ( perhaps you not seen it)[/quote:3641gx3h]
No I have not, I will look at it.
[quote:3641gx3h]>the invoice and numpre fields must remain so in modification[/quote:3641gx3h]
Of course.
[quote:3641gx3h]>I don't use any IDs[/quote:3641gx3h]
I know, and this is one of the reasons you have to work twice as hard as the rest of us. I am working on sample bit of code, that I will show you as soon as it is ready. It is related to IDs.
[quote:3641gx3h]>sorry james, but to change the date of the reservation I have to go to "modify reservation" there are no other ways, the user cannot see the archive with a dbu as we see it.[/quote:3641gx3h]
I was not implying that the user had to do anything different. They could enter the new dates, then the program decides how to process it based on the original and the new check_in and check_out dates. So if the user extends the date, then the program searches just the new day(s) is free. If the user shortens either the check_in or check_out date, then the program doesn't search, it just saves the record with the new dates. Simple.
I would really think about having an alternative option for the user to find new reservations. Using a blank reservation screen, the user then enters any options the customer wants, i.e. Room id, room_type, check_in, check_out, etc. The user MUST enter check-in and check-out, but other fields are optional. Then a search is done, showing all available reservations using the specified criteria in a browse. Maybe you could even use this for the current problem.
[quote:3641gx3h]>there is nothing difficult[/quote:3641gx3h]
Apparently it is, or we wouldn't be having this conversation. <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->
[quote:3641gx3h]>I asked
how is it possible that if I call Isfree () several times and with different parameters it gives me an error or exactly does not return a true day value?[/quote:3641gx3h]
I don't know, but I will look at it.
James
|
Apps with UAC
|
While most applications run fine in Win 7, some are needing UAC approval to proceed. For example, a simple utility I have which runs with the server startup, seeks UAC permission becaue it "might cause a change to the computer". In fact, it just reads and writes data files, and does have an FTP component. When a server updates and reboots, often in the middle of the night, no one is available to grant the permission, and the program quits after a timeout.
Does anyone know what causes some programs to require the UAC and others don't need it ? Also, does anyone know how to set Windows to recognize the program as safe not requiring this permission ( other then to disable UAC ) in Vista / Win 7 ? None of my research shows a way to do this.
Thanks.
|
Apps with UAC
|
Hello Tim,
Is inside the exe-name something like “update”, “install” or “setup”?
Best regards,
Otto
|
Apps with UAC
|
The name is ASWUpdate.exe.
|
Apps with UAC
|
Hello Tim,
rename ASWUpdate.exe to ASWsomething.exe ( don't use update, install, setup) and it should work.
Best regards,
Otto
|
Apps with UAC
|
Thank you. That resolves the issue. Very strange ! I could find nothing on any forum, resource site, book, tutorial on that.
|
Apps with UAC
|
Kudos to Otto for that!
|
Aprenda a crear aplicaciones estilo Metro
|
Copiado textualmente de la pagina web que hace el tema...espero sea de utilidad, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
"Comience a crear aplicaciones estilo Metro de forma rápida y fácil. Nuestra guía de introducción le guía a través de los aspectos básicos de escribir su primera aplicación."
<!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/es-es/windows/apps/">http://msdn.microsoft.com/library/es-es/windows/apps/</a><!-- m -->
|
Aprenda a crear aplicaciones estilo Metro
|
Muy buen aporte, gracias.
Antonio, en el Asus T101mt no puedo utilizar el estilo Metro ya que me dice que la resolución ha de ser superior a 1024x600, me pide una resolución de pantalla mínima de 1024x768 para Wind8. No se si sigues teniendo esta computadora, has podido solucionarlo.
|
Aprenda a crear aplicaciones estilo Metro
|
Andrés,
No sigo teniéndola, gracias por la información.
Es una lastima que Microsoft no se preocupe en mantener compatibilidad con los tablets ya existentes...
|
Aprenda a crear aplicaciones estilo Metro
|
Solucionado, al parecer parece que se bloquea en la resolución mas correcta para el ordenador pero aqui se explica como aumentar la resolucion, despues de realizar los cambios y el reinicio de la computadora un par de veces aumenta la resolución de 600 a 768. Te deja elejir una superior, aunque te dice que la ideal es la de 1024x600 pero me ha dejado la de 1024x768 y ahora ya funciona el metro con windos 8.
[url:1rgzbtz3]http://es.asusxperts.com/asus-eee-pc/5189-asus-eeepc-t101mt-resolucion-pantalla.html[/url:1rgzbtz3]
Supongo que si alguno le pasa lo mismo funcionará ya que solo toca el registro.
|
Aprenda a crear aplicaciones estilo Metro
|
Andrés,
Y que tal va en ese ordenador ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Aprender a multiplicar ;-)
|
Hola,
En <!-- w --><a class="postlink" href="http://www.capelblog.com">www.capelblog.com</a><!-- w -->
Saludos
José Luis Capel
|
Aprender a multiplicar ;-)
|
Puestos a multiplicar, tampoco está de más probar las nuevas hojas de cálculo de Google: <!-- m --><a class="postlink" href="https://www.google.com/accounts/ServiceLogin?service=wise&passive=true&nui=1&continue=http%3A%2F%2Fspreadsheets.google.com%2Fccc%3Fnew">https://www.google.com/accounts/Service ... Fccc%3Fnew</a><!-- m --> <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
|
Aprender a restar
|
Hola,
Disculpad por el off-topic. He puesto en mi blog <!-- w --><a class="postlink" href="http://www.capelblog.com">www.capelblog.com</a><!-- w --> un artículo que pudiera ser interesante para alguno.
Saludos,
José Luis Capel
|
Aprender mod_harbour
|
[url:6ammfrgl]https://www.hotmart.com/product/web-development-with-mod-harbour-and-mercury/K39741308S[/url:6ammfrgl]
|
Aprender mod_harbour
|
Hola Antonio el curso esta en ingles <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
|
Aprender mod_harbour
|
Patricio,
le acabo de enviar un email a Ricardo para que considere una traducción a español <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Aprender mod_harbour
|
Hasta donde yo sé el curso de Ricardo es una "dúplica" en inglés del que dió Charly en privado en español pero que al poco hizo público
|
Aprendiendo a utilizar harbour
|
Hola y buenas estoy migrando clipper a harbour y luego a un entorno grafico quiero implementar una libreria .dll en mi sistema mas especificamente las fiscales para epson y hasar. La cuestion es que he visto que se pueden enlazar estas al sistema incluso en modo consola creando unos prototipos para la llamada a dicha dll. Si alguien me podria facilitar un modelo basico o guia basica para hacerlo me ayudaria un monton, ademas hay algun recurso compatible con los colectores de datos? desde ya muchas gracias.
<!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
|
Aprendiendo de los grandes Maestros :-)
|
[url:ppxzow1s]https://www.youtube.com/watch?v=RtzgfzScjfM[/url:ppxzow1s]
|
Aprendizaje Automatizado usando Harbour
|
Aquí teneis un ejemplo muy sencillo para implementar Aprendizaje Automatizado (Machine Learning) usando Harbour.
Imaginad que tenemos un robot y queremos que el robot aprenda la forma más eficiente de salir de una casa.
Asi que situamos en robot en una habitación al azar y el robot intenta salir de la casa.
El robot aprende de los éxitos y de los fallos, y comienza a mejorar. En unos pocos intentos el robot sabe
la forma más eficiente de salir de la casa <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[img:1u41bygu]https://fivetechsoft.github.io/screenshots/qlearning.jpg[/img:1u41bygu]
Si el robot comienza en la habitación 1 ó en la habitación 3, no hay nada que elegir. Desde la habitación 1 él solo puede ir a la habitación 5.
Desde la habitación 3 él solo puede ir a la habitación 4.
Si está en la habitación 2, entonces tiene dos opciones, salir de la casa (él no sabe que es la salida pero será recompensado)
ó puede ir a la habitación 4.
Una situación similar ocurre en la habitación 5. Puede salir de la casa (y ser recompensado) ó puede ir a la habitación 4 ó a la 1.
Cuando el robot está en la habitación 4 él tiene dos alternativas para salir: ir a través de la habitación 5 ó ir a través de la habitación 2.
Ambos caminos le sacarán de la casa con la misma cantidad de pasos.
Cuando el robot sale de de la casa, él consigue un refuerzo positivo (el dato nScore del objeto State se incrementa en 0.1).
Cuando falla, él obtiene un refuerzo negativo (el dato nScore del objeto State se decrementa en 0.1). Después de unos pocos
intentos el robot aprende la forma correcta.
qlearning.prg
[code=fw:1u41bygu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">static</span> aStates<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> n<br /><br /> aStates = InitStates<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">10</span><br /> ? <span style="color: #ff0000;">"Number of steps to exit"</span>, SolveIt<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">next</span><br /> <br /> <span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">(</span> aStates <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> SolveIt<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oState, nSteps := <span style="color: #000000;">0</span><br /><br /> oState = aStates<span style="color: #000000;">[</span> hb_RandomInt<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, Len<span style="color: #000000;">(</span> aStates <span style="color: #000000;">)</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">]</span><br /><br /> <span style="color: #00C800;">while</span> ! oState == ATail<span style="color: #000000;">(</span> aStates <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">(</span> oState:<span style="color: #000000;">aOptions</span>, <span style="color: #ff0000;">"Options for room: "</span> + AllTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> oState:<span style="color: #000000;">nId</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oState = oState:<span style="color: #000000;">NextState</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> nSteps++<br /> end<br /><br /><span style="color: #00C800;">return</span> nSteps<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> InitStates<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aStates := Array<span style="color: #000000;">(</span> <span style="color: #000000;">6</span> <span style="color: #000000;">)</span><br /><br /> AEval<span style="color: #000000;">(</span> aStates, <span style="color: #000000;">{</span> | o, n | aStates<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> := TState<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddOption</span><span style="color: #000000;">(</span> aStates<span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> aStates<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TState<br /><br /> <span style="color: #00C800;">DATA</span> nId<br /> <span style="color: #00C800;">DATA</span> aOptions <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">DATA</span> nScore <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> nId <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">nId</span> := nId, <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">METHOD</span> AddOption<span style="color: #000000;">(</span> oState <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> AAdd<span style="color: #000000;">(</span> ::<span style="color: #000000;">aOptions</span>, oState <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> NextState<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> NextState<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TState<br /><br /> <span style="color: #00C800;">local</span> n, nMax := <span style="color: #000000;">0</span>, oState, aOptions<br /><br /> <span style="color: #00C800;">if</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aOptions</span> <span style="color: #000000;">)</span> == <span style="color: #000000;">1</span><br /> oState = ::<span style="color: #000000;">aOptions</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">else</span> <br /> aOptions = AShuffle<span style="color: #000000;">(</span> AClone<span style="color: #000000;">(</span> ::<span style="color: #000000;">aOptions</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> aOptions <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> aOptions<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">nScore</span> >= nMax<br /> nMax = aOptions<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">nScore</span><br /> oState = aOptions<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> <span style="color: #00C800;">endif</span> <br /><br /> <span style="color: #00C800;">if</span> oState:<span style="color: #000000;">nId</span> == <span style="color: #000000;">6</span><br /> ::<span style="color: #000000;">nScore</span> += .<span style="color: #000000;">1</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">nScore</span> -= .<span style="color: #000000;">1</span><br /> <span style="color: #00C800;">endif</span> <br /><br /><span style="color: #00C800;">return</span> oState <br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> AShuffle<span style="color: #000000;">(</span> aArray <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> ASort<span style="color: #000000;">(</span> aArray,,, <span style="color: #000000;">{</span> || HB_RandomInt<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1000</span> <span style="color: #000000;">)</span> < HB_RandomInt<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1000</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:1u41bygu]
Después de uns pocos intentos, el robot comienza a aprender. Podemos comprobarlo revisando los distintos valores nScore de los estados:
Cuando el robot está en la habitación 5, él tiene tres alternativas: habitación 1 (nScore es -0.3), habitación 4 (nScore es -0.3) y opción 6 (nScore cero).
por lo que elige el valor más alto y sabe que la opción 6 es la correcta <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->
[img:1u41bygu]https://fivetechsoft.github.io/screenshots/qlearningstates.JPG[/img:1u41bygu]
|
Aprendizaje Automatizado usando Harbour
|
[quote:2cjhb579]The robot is at room: 5
He has these choices:
Go to room: 1 (score: 0 )
Go to room: 4 (score: 0 )
Go to room: 6 (score: 0 )
The robot is at room: 4
He has these choices:
Go to room: 2 (score: 0 )
Go to room: 3 (score: 0 )
Go to room: 5 (score: -0.1 )
The robot is at room: 3
He can just go to room: 4
The robot is at room: 4
He has these choices:
Go to room: 2 (score: 0 )
Go to room: 3 (score: -0.1 )
Go to room: 5 (score: -0.1 )
The robot is at room: 2
He has these choices:
Go to room: 4 (score: -0.2 )
Go to room: 6 (score: 0 )
Number of steps to exit: 5[/quote:2cjhb579]
[quote:2cjhb579]The robot is at room: 3
He can just go to room: 4
The robot is at room: 4
He has these choices:
Go to room: 2 (score: 0.5 )
Go to room: 3 (score: -0.5 )
Go to room: 5 (score: 2.3 )
The robot is at room: 5
He has these choices:
Go to room: 1 (score: -0.4 )
Go to room: 4 (score: -1.1 )
Go to room: 6 (score: 0 )
Number of steps to exit: 3[/quote:2cjhb579]
|
Aprire una pagina di un sito internet
|
Salve,
esiste una funzione per aprire una pagina internet da un'applicazione FWH ? Per aprire intendo eseguire internet explorer ed aprire la pagina che mi interessa.
Finora ho utilizzato shellexecute ma in alcuni casi non mi apre la pagina.
Grazie
Saluti
Marco.
|
Aprire una pagina di un sito internet
|
Quali casi? Un esempio?
EMG
|
Aprire una pagina di un sito internet
|
[quote="Marco Turco":3k893as2]Salve,
esiste una funzione per aprire una pagina internet da un'applicazione FWH ? Per aprire intendo eseguire internet explorer ed aprire la pagina che mi interessa.
Finora ho utilizzato shellexecute ma in alcuni casi non mi apre la pagina.
Grazie
Saluti
Marco.[/quote:3k893as2]
Hola Marco,
en la carpeta samples, viene el archivo webex, es con activex, funciona bien
saludos
|
Aproperties Tsay Timage tBtnbmp
|
Don Antonio Linares, Daniel Garcia Gil
En un dialog tengo tres tipos de control, Tsay, Tbtnbmp, Timage, usados para desplegar fotos tipo jpg o png, mostradas bajo un criterio de selección.
Al hacer click o doble click sobre una foto debo recuperar el indice del aControls para extrraer el nombre del archivo mostrado y hacer una tarea especifica, lo
lo mismo al hacer click sobre un BtnBmp, cual propiedad de aproperties debo usar para este caso?
Y cómo determino el indice en aControls donde se hizo el click?
y por último donde consigo documentacion sobre aproperties de las claases de fivewin.
Saludos
PD: Hasta ahora he logrado ver lo siguiente.....
@ 000, 142 LISTBOX oBrw ;
FIELDS ;
TRANSFORM ( n, "999,999" ) ,;
oDlg:aControls [ n ]:ClassName () ,;
oDlg:aControls [ n ]:cToolTip ,;
IIF ( oDlg:aControls [ n ]:ClassName () = "TIMAGE",;
oDlg:aControls [ n ]:cBMPFILE ,;
oDlg:aControls [ n ]:cVarName ) ,;
oDlg:aControls [ n ]:Cargo ,;
oDlg:aControls [ n ]:SetText ,;
oDlg:aControls [ n ]:cCaption ;
HEADERS ;
"Indice" ,;
"ClassName" ,;
"cToolTip" ,;
"cBmpFile" ,;
"Cargo" ,;
"SetText" ,;
"cCaption" ;
FIELDSIZES ;
060 ,;
100 ,;
100 ,;
100 ,;
100 ,;
100 ,;
100 ;
SIZE 300, 45 PIXEL FONT oFont2 OF oDlg ;
COLOR nRGB ( 220, 220, 000 ), nRGB ( 000, 065, 033 ) ; && Letras / fondo Verde
oBrw:SetArray ( oDlg:aControls )
oBrw:bGotop := { | | n := 1 }
oBrw:bGoBottom := { | | n := EVAL ( oBrw:bLogicLen ) }
oBrw:bSkip := { | nwant, nold | nold := n , n += nwant ,;
n := MAX ( 1, MIN ( n, EVAL ( oBrw:bLogicLen ) ) ), n - nOld }
oBrw:bLogicLen := { | | LEN ( oDlg:aControls ) }
oBrw:nClrBackFocus := nRGB ( 250, 250, 016 ) && Color del Fondo Amarillo
oBrw:nClrForeFocus := nRGB ( 016, 032, 250 ) && Color del Texto Azul
oBrw:nLineStyle := 5 && Try different line styles !!!
oBrw:lCellstyle := .T. && Dibujar malla
|
Aproperties Tsay Timage tBtnbmp
|
Ernesto,
Prueba asi:
[code=fw:9pumt6ru]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">local</span> nAt := AScan<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">aControls</span>, <span style="color: #000000;">{</span> | oControl | oControl:<span style="color: #000000;">hWnd</span> == GetFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oControl := oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> nAt <span style="color: #000000;">]</span><br /><br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br /> <span style="color: #00C800;">case</span> oControl:<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TBTNBMP"</span><br /> <span style="color: #00C800;">return</span> oControl:<span style="color: #000000;">cBmpFile1</span><br /><br /> <span style="color: #00C800;">case</span> oControl:<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TIMAGE"</span><br /> <span style="color: #00C800;">return</span> oControl:<span style="color: #000000;">cBmFile</span><br /><span style="color: #00C800;">endcase</span> <br /> </div>[/code:9pumt6ru]
|
Aproperties Tsay Timage tBtnbmp
|
Don Antonio
Aun sin resolver, segui su comentario, pero, cuando el control es de la clase tBTMBMP, ok puedo buscar el hilo del archivo que se muestra, pero cuando es con la clase TImage, sequeda con el nAt del tBTMBMP anterior, que otro camino busco..
Gracias
|
Aproperties Tsay Timage tBtnbmp
|
en este link hay una imagen, las fotos que se ven es con TIMAGE, los cuadros vacios es con TBTNBMP
<!-- m --><a class="postlink" href="http://www.subirimagenes.com/otros-pantalla1-7393709.html">http://www.subirimagenes.com/otros-pant ... 93709.html</a><!-- m -->
Saludos
|
Aproperties Tsay Timage tBtnbmp
|
ultima imagen
<!-- m --><a class="postlink" href="http://s3.subirimagenes.com:81/imagen/previo/thump_7397137pantallazo03.png">http://s3.subirimagenes.com:81/imagen/p ... lazo03.png</a><!-- m -->
|
Aproperties Tsay Timage tBtnbmp
|
Ernesto,
Eso se debe a que un control TImage no toma el foco (normalmente) ya que el usuario no suele interaccionar con él.
Si estas usando un diálogo definido en un RC prueba a ponerle el estilo WS_TABSTOP que haria que pudiese tomar el foco.
Otra solución es modificar el código que te he propuesto pero que cambie GetFocus() por otra condición que pueda ayudarnos a identificar el control. Por ejemplo, podrias anotar en su DATA Cargo un valor que te ayude a localizarle:
local nAt := AScan( oDlg:aControls, { | oControl | oControl:Cargo == ... } )
otra solución es comprobando su nombre de Clase:
local nAt := AScan( oDlg:aControls, { | oControl | oControl:ClassName() == "TIMAGE" } )
posibilidades siempre hay muchas <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Aqui Un Ejemplo funcional para xbrowse
|
Amigos, aquí está el código ejemplo de una función para edición contable de un comprobante de diario. Fácilmente puede ser pasado a código para facturación.
Es una manera de hacer público mi agradecimiento por toda la ayuda que he recibido de este grandioso foro.
Agradeceré cualquier comentacio o mejora al código.
Espero que les sea de utilidad.
[url=http://img98.imageshack.us/my.php?image=cdiarionh7.png:y5a1pzc6][img:y5a1pzc6]http://img98.imageshack.us/img98/2387/cdiarionh7.th.png[/img:y5a1pzc6][/url:y5a1pzc6][url=http://g.imageshack.us/thpix.php:y5a1pzc6][img:y5a1pzc6]http://img98.imageshack.us/images/thpix.gif[/img:y5a1pzc6][/url:y5a1pzc6]
/*
Ejemplo de TXbrowse para edicion de comprobantes de diario.
Francisco Alegría P., Octubre 22/2008
1- Edicion automatica (lFastEdit = .t.)
2- Validacion de celdas (en este caso, cta y scta).
3- Salto sobre la celda cuando ésta no es editable (con tecla return)
Si la celda proxima no es editable, salta sobre ella a la siguiente.
4- Columnas de Debitos y Creditos:
Si debitos tiene valor, creditos no es editable y viceversa.
5- Cuando se edita la ultima columna, agrega nueva fila y se va a la primer columna.
6- Navegacion con las teclas direccionales, manteniendo el estado de edición.
7- Si se oprima flecha abajo en cualquier columna, y es la ultima fila del browse,
agrega un nuevo registro y se traslada a la primer columna en modo de edicion.
Si se oprime Escape, elimina el registro recien agregado, si este estaba vacio.
8- Para eliminar un registro con valor, se utiliza la tecla delete y presenta dialog para confirmar.
9- Edicion de cualquier columna editable sin necesidad de oprimir enter.
10 Totales y otros textos en footer
11- No admite salvar el registro si no validan .t., las funciones lCtaOK() y lDebHabOK()
Para accionar el salto sobre columna no editable, utilizar este codigo:
Introducirlo en la parte final del metodo function EditGetkeyDown( Self, nKey ),
o usarlo como parte del programa.
Local nNextCol
...
...
nNextCol := ::oBrw:nColSel + 1 // FranciscoA Sept/23/2008
if ::oBrw:aCols[nNextCol]:nEditType == 0 //Si prox col no es editable...
if nNextCol < Len(::oBrw:aCols) //Si no es la ult columna, salta a sig editable
::oBrw:nColSel := nNextCol + 1
::oBrw:Refresh()
endif
endif
*/
[code=fw:y5a1pzc6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"InKey.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Function</span> CDiario<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oWnd, oBrw, oCol, cAlias<br /><span style="color: #00C800;">local</span> n:=<span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> nTotal1:=<span style="color: #000000;">0</span>, nTotal2:=<span style="color: #000000;">0</span><br /><br /><br />DbUseArea<span style="color: #000000;">(</span>.T.,,<span style="color: #ff0000;">"Datos"</span>,<span style="color: #ff0000;">"Datos"</span>,.F.<span style="color: #000000;">)</span><br />cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />dbSelectArea<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"EDITAR COMPROBANTE DE DIARIO"</span> ;<br /> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">900</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">247</span>, <span style="color: #000000;">243</span>, <span style="color: #000000;">232</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">228</span>, <span style="color: #000000;">213</span>, <span style="color: #000000;">184</span><span style="color: #000000;">)</span><br /><br /> oBrw := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">cAlias</span> := cAlias <br /><br /> oBrw:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">lColDividerComplete</span> := .t. <span style="color: #B900B9;">//completa pintado sobre el footer cuando lineas no llenan todo el browse</span><br /><br /> oBrw:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span> <span style="color: #B900B9;">//Altura cabeceras de col</span><br /> oBrw:<span style="color: #000000;">lFooter</span> := .t. <span style="color: #B900B9;">//Que tendrá footer </span><br /> oBrw:<span style="color: #000000;">nFooterLines</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//Lineas del footer </span><br /> oBrw:<span style="color: #000000;">nFooterHeight</span> := <span style="color: #000000;">24</span> <span style="color: #B900B9;">//Altura del Footer</span><br /> oBrw:<span style="color: #000000;">lRecordSelector</span> := .t. <span style="color: #B900B9;">//poner o no, COL de la flechita de la izq</span><br /><br /><br /> oBrw:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">140</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">229</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// VERDECITO</span><br /> oBrw:<span style="color: #000000;">bClrFooter</span> := oBrw:<span style="color: #000000;">bClrHeader</span><br /> oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// colores para lineas normales</span><br /> oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br /> oBrw:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL <span style="color: #B900B9;">//solo ilumina la celda actual</span><br /><br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">20</span> <span style="color: #B900B9;">//altura entre lineas</span><br /><br /> oBrw:<span style="color: #000000;">lFastEdit</span> := .t. <br /><br /> oBrw:<span style="color: #000000;">bPastEof</span> = <span style="color: #000000;">{</span>|| <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span> .and. lDebHabOK<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->debe+<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->haber<span style="color: #000000;">)</span> ,;<br /> <span style="color: #000000;">(</span>Dbappend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<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: #00C800;">Edit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//agrega registro y "oprime" enter</span><br /><br /><br /> <span style="color: #B900B9;">//Aqui uso DbPack() porque es una dbf pequeña y temporal. En grandes usar function de mantenimiento.</span><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->cta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CTA"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta := xVal, <span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_ESCAPE .and. Empty<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>__dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbGoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"SC4"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta := xVal, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->NOMBRE <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DESCRIPCION DE LA CUENTA"</span> <br /> oCol:<span style="color: #000000;">cFooter</span> = <span style="color: #ff0000;">"BALANCE ---> "</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">nEditType</span> = <span style="color: #000000;">0</span> <span style="color: #B900B9;">//no editable</span><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//alineado a la derecha</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DEBITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal1,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Haber =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span> nTotal1+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CREDITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal2,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Debe =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> nTotal2+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CONCEPTO"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> <span style="color: #B900B9;">//Es la ultima columna, agrega nuevo registro en blanco y se va a primer columna,</span><br /> <span style="color: #B900B9;">//solo si la cta y/o valores están OK</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO := xVal ,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Recno<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>==<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Reccount<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> .and. lDebHabOK<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->debe+<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->haber<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /><br /> oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">bKeyDown</span> :=<span style="color: #000000;">{</span> | nKey | Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//--------------------</span><br /><span style="color: #00C800;">Function</span> Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br /> <span style="color: #00C800;">Case</span> nKey == VK_DELETE<br /> <span style="color: #00C800;">if</span> MsgNoYes<span style="color: #000000;">(</span><span style="color: #ff0000;">"¿Está seguro(a) de borrar este registro?"</span>,<span style="color: #ff0000;">"Borrar registro de "</span>+cAlias<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">EndCase</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> lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//tu codigo de validacion</span><br /><span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span>->nombre := <span style="color: #ff0000;">"Nombre de la Cuenta, si existe..."</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><span style="color: #B900B9;">//----------------------------//No permitir registro sin valores</span><br /><span style="color: #00C800;">Function</span> lDebHabOK<span style="color: #000000;">(</span>nValor<span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> nValor = <span style="color: #000000;">0</span><br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Omision de Valores"</span>,<span style="color: #ff0000;">"Alto"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> .f.<br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><br /><span style="color: #B900B9;">//ESTAS FUNCIONES SON PARA COLORES PERSONALIZADOS DEL XBROWSE YA PUBLICADAS</span><br /><span style="color: #B900B9;">//No son necesarias a menos que quieras emplear las classes modificadas.</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR BUTTONBAR</span><br /><span style="color: #00C800;">Function</span> ClrMsgBar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span>nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">228</span>,<span style="color: #000000;">150</span><span style="color: #000000;">)</span>,nRGB<span style="color: #000000;">(</span><span style="color: #000000;">167</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR HEARDERS DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrHeader<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR FOOTER DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrFooter<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /> </div>[/code:y5a1pzc6]
Lo probé antes de subirlo y me funciona bien.
Saludos
Francisco J. Alegría P[/img][/url]
|
Aqui Un Ejemplo funcional para xbrowse
|
Para las funciones descritas, puedes buscar asi:No encuentro las mejoras hechas a xbrowse por franciscoA ??
|
Aqui Un Ejemplo funcional para xbrowse
|
GRACIAS FRANCISCO, te cuento que no ha llegado nada, revisa si se devolvio o si podrias volver a intentar, gracias nuevamente y disculpa
|
Aqui Un Ejemplo funcional para xbrowse
|
SALUDOS FRANCISCO
He tratado de ejecutar tu ejemplo pero me he encontrado algunos problemitas que son:
1.- no tengo la tabla, lo cual no es grave pq se puede ir creando a medida que de errores de base de datos, etc
2.- me da errores lo siguiente:
oCol:lTotal := .t. //para totalizar cols a report y/o excel
oCol:bFooter = {|| TRANSFORM(nTotal2,"9,999,999,999.99") }
o:nFootStrAlign := 1
oCol:bEditWhen := {|| DBTEST:Debe =0 }
oCol:bOnPostEdit = { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),),;
lo que me hace pensar que no tengo la misma version de xbrowse y tras ponerlas todas en comentarios solo a la final, veo la ventana vacia, bueno precisamente esoty trabajando en esto y no se si seria mucho pedirte enviaras las dbf y el xbrowse que tu usas
yo uso fw74 para xharbour no se si afectara, bueno si puedo hacer arrancar tu programa y le logro hacer algo adicional con gusto te informare, buenom cualquier cosa me escribes a mi privado, gracias de antemanos y estamos a la orden aqui en venezuela tanbien
|
Aqui Un Ejemplo funcional para xbrowse
|
Alex, revisa tu correo.
|
Aqui Un Ejemplo funcional para xbrowse
|
Hola,
Podrias enviarme el mismo DBF y codigo a mi tambien? MI email es <!-- e --><a href="mailto:wbguerrero@gmail.com">wbguerrero@gmail.com</a><!-- e --> Aun no he podido lograr compilar ningun browser de los samples de fwh. Todos me dan error
A la espera de tu email y gracias de antemano
|
Aqui Un Ejemplo funcional para xbrowse
|
Compuin, revisa tu correo. Es para la ver 712
Saludos.
|
Aqui Un Ejemplo funcional para xbrowse
|
aqui esta el ejeplo: se crea la tabla DATOS.DBF si no existe.
[code=fw:1z51mwj0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"InKey.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Function</span> CDiario<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oWnd, oBrw, oCol, cAlias<br /> <span style="color: #00C800;">local</span> n:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nTotal1:=<span style="color: #000000;">0</span>, nTotal2:=<span style="color: #000000;">0</span><br /> <br /> <br /> <span style="color: #00C800;">local</span> aDbf := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"cta"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"scta"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"nombre"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"debe"</span> , <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">02</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"haber"</span> , <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">02</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"concepto"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !file<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DATOS.DBF"</span> <span style="color: #000000;">)</span><br /> dbcreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"datos.dbf"</span>, aDbf <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span><br /> <br /> <br /><br /><br /><br /><br /> DbUseArea<span style="color: #000000;">(</span>.T.,,<span style="color: #ff0000;">"Datos"</span>,<span style="color: #ff0000;">"Datos"</span>,.F.<span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">if</span> lastrec<span style="color: #000000;">(</span><span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> dbappend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> rlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> field->cta := <span style="color: #ff0000;">"6130380125"</span><br /> field->scta := <span style="color: #ff0000;">"3230"</span><br /> field->nombre := <span style="color: #ff0000;">"NOMBRE CUENTA"</span><br /> dbunlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <br /> <br /> cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> dbSelectArea<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"EDITAR COMPROBANTE DE DIARIO"</span> ;<br /> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">900</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">247</span>, <span style="color: #000000;">243</span>, <span style="color: #000000;">232</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">228</span>, <span style="color: #000000;">213</span>, <span style="color: #000000;">184</span><span style="color: #000000;">)</span><br /><br /> oBrw := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">cAlias</span> := cAlias <br /><br /> oBrw:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">lColDividerComplete</span> := .t. <span style="color: #B900B9;">//completa pintado sobre el footer cuando lineas no llenan todo el browse</span><br /><br /> oBrw:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span> <span style="color: #B900B9;">//Altura cabeceras de col</span><br /> oBrw:<span style="color: #000000;">lFooter</span> := .t. <span style="color: #B900B9;">//Que tendrá footer </span><br /> oBrw:<span style="color: #000000;">nFooterLines</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//Lineas del footer </span><br /> oBrw:<span style="color: #000000;">nFooterHeight</span> := <span style="color: #000000;">24</span> <span style="color: #B900B9;">//Altura del Footer</span><br /> oBrw:<span style="color: #000000;">lRecordSelector</span> := .t. <span style="color: #B900B9;">//poner o no, COL de la flechita de la izq</span><br /><br /><br /> oBrw:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">140</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">229</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// VERDECITO</span><br /> oBrw:<span style="color: #000000;">bClrFooter</span> := oBrw:<span style="color: #000000;">bClrHeader</span><br /> oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// colores para lineas normales</span><br /> oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br /> oBrw:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL <span style="color: #B900B9;">//solo ilumina la celda actual</span><br /><br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">20</span> <span style="color: #B900B9;">//altura entre lineas</span><br /><br /> oBrw:<span style="color: #000000;">lFastEdit</span> := .t. <br /><br /> oBrw:<span style="color: #000000;">bPastEof</span> = <span style="color: #000000;">{</span>|| <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span> .and. lDebHabOK<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->debe+<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->haber<span style="color: #000000;">)</span> ,;<br /> <span style="color: #000000;">(</span>Dbappend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<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: #00C800;">Edit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//agrega registro y "oprime" enter</span><br /><br /><br /> <span style="color: #B900B9;">//Aqui uso DbPack() porque es una dbf pequeña y temporal. En grandes usar function de mantenimiento.</span><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->cta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CTA"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta := xVal, <span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_ESCAPE .and. Empty<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>__dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbGoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"SC4"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta := xVal, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->NOMBRE <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DESCRIPCION DE LA CUENTA"</span> <br /> oCol:<span style="color: #000000;">cFooter</span> = <span style="color: #ff0000;">"BALANCE ---> "</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">nEditType</span> = <span style="color: #000000;">0</span> <span style="color: #B900B9;">//no editable</span><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//alineado a la derecha</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DEBITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal1,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Haber =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span> nTotal1+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CREDITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal2,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Debe =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> nTotal2+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CONCEPTO"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> <span style="color: #B900B9;">//Es la ultima columna, agrega nuevo registro en blanco y se va a primer columna,</span><br /> <span style="color: #B900B9;">//solo si la cta y/o valores están OK</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO := xVal ,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Recno<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>==<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Reccount<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> .and. lDebHabOK<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->debe+<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->haber<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /><br /> oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">bKeyDown</span> :=<span style="color: #000000;">{</span> | nKey | Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//--------------------</span><br /><span style="color: #00C800;">Function</span> Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br /> <span style="color: #00C800;">Case</span> nKey == VK_DELETE<br /> <span style="color: #00C800;">if</span> MsgNoYes<span style="color: #000000;">(</span><span style="color: #ff0000;">"¿Está seguro(a) de borrar este registro?"</span>,<span style="color: #ff0000;">"Borrar registro de "</span>+cAlias<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">EndCase</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> lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//tu codigo de validacion</span><br /><span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span>->nombre := <span style="color: #ff0000;">"Nombre de la Cuenta, si existe..."</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><span style="color: #B900B9;">//----------------------------//No permitir registro sin valores</span><br /><span style="color: #00C800;">Function</span> lDebHabOK<span style="color: #000000;">(</span>nValor<span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> nValor = <span style="color: #000000;">0</span><br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Omision de Valores"</span>,<span style="color: #ff0000;">"Alto"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> .f.<br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><br /><span style="color: #B900B9;">//ESTAS FUNCIONES SON PARA COLORES PERSONALIZADOS DEL XBROWSE YA PUBLICADAS</span><br /><span style="color: #B900B9;">//No son necesarias a menos que quieras emplear las classes modificadas.</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR BUTTONBAR</span><br /><span style="color: #00C800;">Function</span> ClrMsgBar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span>nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">228</span>,<span style="color: #000000;">150</span><span style="color: #000000;">)</span>,nRGB<span style="color: #000000;">(</span><span style="color: #000000;">167</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR HEARDERS DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrHeader<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR FOOTER DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrFooter<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /> </div>[/code:1z51mwj0]
|
Aqui Un Ejemplo funcional para xbrowse
|
No funciona. Mi version de FWH es la 6.12. Que esta mal?
|
Aqui Un Ejemplo funcional para xbrowse
|
es un error de ejecucion? o de compilacion,
saludos.
|
Aqui Un Ejemplo funcional para xbrowse
|
Al momento de ejecutar. Te lo envie a tu correo como error browser.
Saludos,
|
Aqui Un Ejemplo funcional para xbrowse
|
compuIn. Pon el error aqui, o mandamelo al correo: <!-- e --><a href="mailto:sysctrl@prodigy.net.mx">sysctrl@prodigy.net.mx</a><!-- e -->,
ya que en mi correo de hotmail, no he recibido nada.
saludos..
|
Aqui Un Ejemplo funcional para xbrowse
|
Te lo acabo de enviar. Agradezco tu ayuda ya que ningun browser me funciona
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.