topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
radio button en recursos | No comprendo. Porque hacer asi? Porque no dejar todos en el mismo grupo? separado solo en el resource(recurso). |
radio button en recursos | porque asi deben ser |
radio button en recursos | En el recurso, en el control ID 127, debes marcarlo como grupo |
radio button en recursos | Perfecto!
solucionado.
Gracias. |
radio y bChange | Hola.
Que estoy haciendo mal en este codigo que el bChange cuando compilo me dice que no existe.
[code=fw:23uov6ev]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">radio</span> oRAdio <span style="color: #0000ff;">id</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">of</span> odlg <br />...<br />oRadio:<span style="color: #000000;">bChange</span>:= <span style="color: #000000;">{</span> || <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"a"</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> </div>[/code:23uov6ev]
Gracias. |
radio y bChange | Try this:
[code=fw:nytua5bn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">radio</span> oRAdio <span style="color: #0000ff;">var</span> nVar ...</div>[/code:nytua5bn]
If you omit the VAR clause, oRadio is the radio variable and not the radio object. |
radio y bChange | gracias!
funciono |
radios en folder sera bug? | el enter en el radio button dentro de folder no funciona, no cambia de controla, alguna solucion?
gracias
Paco |
radios en tu ppc | hola a todos
en esta pagina he anotado unos cuantos links de radios por internet
<!-- m --><a class="postlink" href="http://www.arrakis.es/~canal_five/radios.htm">http://www.arrakis.es/~canal_five/radios.htm</a><!-- m -->
Un saludo |
rando color | I have an archive where I put a field ncolor ( numeric) to show a color but when I insert a record it is allways black because the fields is empty (0) .
How I can to rando a color different every time I insert a new record ?
Any nice solution ?
I made this
[code=fw:fa0ilm2z]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Rando_Color<span style="color: #000000;">(</span>nColor<span style="color: #000000;">)</span><br /> nRed:=HB_Random<span style="color: #000000;">(</span><span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> nBlue:=HB_Random<span style="color: #000000;">(</span><span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> nGia:=HB_Random<span style="color: #000000;">(</span><span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> nColor:= nrgb<span style="color: #000000;">(</span>nRed,nGia,nBlue<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span>ncolor<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> nColor</div>[/code:fa0ilm2z]
but I have often the same or similar color |
rando color | Try with
[code=fw:2eslng90]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> ? Int<span style="color: #000000;">(</span> <span style="color: #000000;">255</span> * hb_Random<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, Int<span style="color: #000000;">(</span> <span style="color: #000000;">255</span> * hb_Random<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, Int<span style="color: #000000;">(</span> <span style="color: #000000;">255</span> * hb_Random<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:2eslng90] |
rando color | seem run ok I add the search in archive to dbseek any clone |
random problem in xBrowse Problem BASE/1004 There is no meth | Hello,
Some customers report me this error:
Problem BASE/1004 There is no method: ISKINDOF
Args:
[ 1] = U
[ 2] = C TMULTIGET
Stack Calls
===========
Called from: => ISKINDOF( 0 )
Called from: .\source\classes\XBROWSE.PRG => EDITGETKEYDOWN( 15132 )
Offending line:
[code=fw:1949fart]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> EditGetkeyDown<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, nKey <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> lMultiGet := ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TMULTIGET"</span> <span style="color: #000000;">)</span></div>[/code:1949fart]
I am not able to reproduce it. Maybe you can give me some light.
Thank you. |
random problem in xBrowse Problem BASE/1004 There is no meth | The above error means that oCol:oEditGet is NIL when the function is called.
But this is how this function is used
[code=fw:3hefswys]<div class="fw" id="{CB}" style="font-family: monospace;"> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span> | nKey | EditGetkeyDown<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, nKey <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:3hefswys]
Logically the function should not execute when oCol:oEditGet itself is NIL.
Let us look into this. |
random problem in xBrowse Problem BASE/1004 There is no meth | For now, please try making this change in xbrowse.prg
for the lines
[code=fw:gcmqtnor]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> EditGetkeyDown<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, nKey <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> lMultiGet := ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TMULTIGET"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lExit := .f.<br /> </div>[/code:gcmqtnor]
Substitute these lines
[code=fw:gcmqtnor]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> EditGetkeyDown<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, nKey <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> lMultiGet<br /> <span style="color: #00C800;">local</span> lExit := .f.<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oEditGet</span> == <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> lMultiGet := ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TMULTIGET"</span> <span style="color: #000000;">)</span><br /> </div>[/code:gcmqtnor] |
random problem in xBrowse Problem BASE/1004 There is no meth | Thank you very much! |
random sentences generator | Inspired in the idea of AI large languages models, this is a very simple and easy to understand sentences generator, quite funny <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
The more sentences that you provide to it, the more "inspired" that it will be <!-- s:-D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":-D" title="Very Happy" /><!-- s:-D -->
llml.prg
[code=fw:1ayt5lwm]<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> hTokens := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"el gato subió al arbol y maulló hasta que llegó el bombero"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Me gusta aprender cosas nuevas todos los días"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"El cielo es azul y el sol brilla"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"La música es una forma de expresión artística"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"El chocolate es un dulce que se hace con cacao"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"La Tierra es el tercer planeta del sistema solar y tiene una luna"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"El agua es un líquido transparente e inodoro que se compone de hidrógeno y oxígeno"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Los gatos son animales domésticos muy populares"</span> <span style="color: #000000;">)</span><br /><br /> ? Generate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"el"</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: #00C800;">function</span> Tokenizer<span style="color: #000000;">(</span> cSentence <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aTokens := hb_ATokens<span style="color: #000000;">(</span> cSentence <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> n<br /> <br /> hb_HCaseMatch<span style="color: #000000;">(</span> hTokens, .F. <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> Len<span style="color: #000000;">(</span> aTokens <span style="color: #000000;">)</span> - <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">if</span> ! hb_HHasKey<span style="color: #000000;">(</span> hTokens, aTokens<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> hTokens<span style="color: #000000;">[</span> aTokens<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">{</span> aTokens<span style="color: #000000;">[</span> n + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> AAdd<span style="color: #000000;">(</span> hTokens<span style="color: #000000;">[</span> aTokens<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">]</span>, aTokens<span style="color: #000000;">[</span> n + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /> <br /><span style="color: #00C800;">function</span> Generate<span style="color: #000000;">(</span> cToken <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cSentence := cToken, n := <span style="color: #000000;">1</span><br /><br /> <span style="color: #00C800;">while</span> hb_hHasKey<span style="color: #000000;">(</span> hTokens, cToken <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> hTokens<span style="color: #000000;">[</span> cToken <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> .and. n++ < <span style="color: #000000;">20</span><br /> cSentence += <span style="color: #ff0000;">" "</span> + hTokens<span style="color: #000000;">[</span> cToken <span style="color: #000000;">]</span><span style="color: #000000;">[</span> hb_RandomInt<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, Len<span style="color: #000000;">(</span> hTokens<span style="color: #000000;">[</span> cToken <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">]</span> <br /> cToken = hTokens<span style="color: #000000;">[</span> cToken <span style="color: #000000;">]</span><span style="color: #000000;">[</span> hb_RandomInt<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, Len<span style="color: #000000;">(</span> hTokens<span style="color: #000000;">[</span> cToken <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">]</span><br /> end<br /> <br /><span style="color: #00C800;">return</span> cSentence </div>[/code:1ayt5lwm]
Some funny results:
[quote:1ayt5lwm]"el chocolate es un líquido que llegó compone de expresión artística"[/quote:1ayt5lwm]
[quote:1ayt5lwm]"el agua brilla"[/quote:1ayt5lwm]
[quote:1ayt5lwm]"el gato planeta del sistema solar y el agua"[/quote:1ayt5lwm]
[quote:1ayt5lwm]"el tercer es el y maulló"[/quote:1ayt5lwm]
[quote:1ayt5lwm]"el sol es un y el hasta que se hace de hidrogeno artística"[/quote:1ayt5lwm]
[quote:1ayt5lwm]"el sol planeta del sistema solar y el hasta que se el sol es azul dulce que se el chocolate"[/quote:1ayt5lwm] |
random sentences generator | In this example we load all William Shakespeare's books into memory:
[url:knwe62dm]https://www.fivetechsoft.com/files/shakespeare.txt[/url:knwe62dm]
[code=fw:knwe62dm]<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> hTokens := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</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> cText := hb_memoRead<span style="color: #000000;">(</span> <span style="color: #ff0000;">"shakespeare.txt"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cSentence <br /><br /> <span style="color: #00C800;">for</span> each cSentence in hb_ATokens<span style="color: #000000;">(</span> cText, <span style="color: #ff0000;">"."</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> cSentence <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> <br /><br /> ? Generate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"the"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:knwe62dm] |
random sentences generator | Dear Antonio,
thank you very much.
I added
#xtranslate hb_HHasKey( [<x,...>] ) => HHasKey( <x> )
and translated:
Tokenizer("The tomcat climbed the tree and meowed until the firefighter arrived.")
Tokenizer("I like learning new things every day.")
Tokenizer("The sky is blue and the sun is shining.")
Tokenizer("Music is a form of artistic expression.")
Tokenizer("Chocolate is a sweet made from cocoa.")
Tokenizer("The Earth is the third planet in the solar system and has a moon.")
Tokenizer("Water is a clear and odorless liquid made of hydrogen and oxygen.")
Tokenizer("Cats are very popular pets.")
However, as a result, I only get el
Should it work with xHarbour?
Best regards,
Otto |
random sentences generator | Dear Otto,
When you call function Generate( <cInitialWord> ) you have to provide an initial word that exists in your sentences,
in your case:
? Generate( "the" ) |
random sentences generator | Dear Otto,
In this example you can visually review how we organize the tokens, so its easier to understand how it works <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
llml.prg
[code=fw:3bbtlabz]<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> hTokens := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</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 /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"The cat climbed the tree and meowed until the firefighter arrived"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"I like learning new things every day"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"The sky is blue and the sun is shining"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Music is a form of artistic expression"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Chocolate is a sweet made from cocoa"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"The Earth is the third planet in the solar system and has a moon"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Water is a clear and odorless liquid made of hydrogen and oxygen"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Cats are very popular pets"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Paris is the capital of France and a popular tourist destination"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"A triangle is a polygon with three sides and three angles"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"I like to read books and watch movies"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"A bicycle is a vehicle that has two wheels and pedals"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Microsoft is a technology company that makes software and hardware products"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Apples are a type of fruit that can be red, green, or yellow"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Elephants are the largest land animals"</span> <span style="color: #000000;">)</span><br /> Tokenizer<span style="color: #000000;">(</span> <span style="color: #ff0000;">"The color wheel consists of primary colors like red, blue, and yellow"</span> <span style="color: #000000;">)</span><br /><br /> XBrowser<span style="color: #000000;">(</span> hTokens <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;">5</span><br /> ? Generate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"The"</span> <span style="color: #000000;">)</span><br /> ? Generate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"A"</span> <span style="color: #000000;">)</span><br /> ? Generate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"are"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Tokenizer<span style="color: #000000;">(</span> cSentence <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aTokens := hb_ATokens<span style="color: #000000;">(</span> cSentence <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> n, nAt<br /> <br /> hb_HCaseMatch<span style="color: #000000;">(</span> hTokens, .F. <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> Len<span style="color: #000000;">(</span> aTokens <span style="color: #000000;">)</span> - <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">if</span> ! hb_HHasKey<span style="color: #000000;">(</span> hTokens, aTokens<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> hTokens<span style="color: #000000;">[</span> aTokens<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">{</span> aTokens<span style="color: #000000;">[</span> n + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> AAdd<span style="color: #000000;">(</span> hTokens<span style="color: #000000;">[</span> aTokens<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">]</span>, aTokens<span style="color: #000000;">[</span> n + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /> <br /><span style="color: #00C800;">function</span> Generate<span style="color: #000000;">(</span> cToken <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cSentence := cToken, n := <span style="color: #000000;">1</span><br /><br /> <span style="color: #00C800;">while</span> hb_hHasKey<span style="color: #000000;">(</span> hTokens, cToken <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> hTokens<span style="color: #000000;">[</span> cToken <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> .and. n++ < <span style="color: #000000;">100</span><br /> cSentence += <span style="color: #ff0000;">" "</span> + <span style="color: #000000;">(</span> cToken := hTokens<span style="color: #000000;">[</span> cToken <span style="color: #000000;">]</span><span style="color: #000000;">[</span> hb_RandomInt<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, Len<span style="color: #000000;">(</span> hTokens<span style="color: #000000;">[</span> cToken <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 /> end<br /> <br /><span style="color: #00C800;">return</span> cSentence </div>[/code:3bbtlabz] |
random sentences generator | You can use chatGPT to generate the sentences for you:
[quote:2gcgjc7r]write 50 simple sentences to feed artificial intelligence using the format Tokenizer( sentence ) [/quote:2gcgjc7r]
[quote:2gcgjc7r]Tokenizer("The sun rises in the east.")
Tokenizer("Cats are furry animals.")
Tokenizer("Water freezes at zero degrees Celsius.")
Tokenizer("Mars is known as the red planet.")
Tokenizer("The moon orbits the Earth.")
Tokenizer("Bananas are a good source of potassium.")
Tokenizer("Football is a popular sport worldwide.")
Tokenizer("Stars twinkle in the night sky.")
Tokenizer("The Great Wall of China is a historic landmark.")
Tokenizer("Rivers flow from higher to lower elevations.")
Tokenizer("Bees play a crucial role in pollination.")
Tokenizer("Diamonds are a form of carbon.")
Tokenizer("The Pacific Ocean is the largest ocean on Earth.")
Tokenizer("The Statue of Liberty stands in New York Harbor.")
Tokenizer("The human body has 206 bones.")
Tokenizer("Photosynthesis is the process by which plants make food.")
Tokenizer("The Eiffel Tower is located in Paris.")
Tokenizer("Birds have feathers for flying.")
Tokenizer("The Amazon Rainforest is home to diverse wildlife.")
Tokenizer("Electricity is a form of energy.")
Tokenizer("The Sahara Desert is the largest hot desert.")
Tokenizer("Snowflakes have unique and intricate patterns.")
Tokenizer("Honey is produced by bees from flower nectar.")
Tokenizer("The Earth's atmosphere consists of nitrogen and oxygen.")
Tokenizer("Jupiter is the largest planet in our solar system.")
Tokenizer("A rainbow is formed by the refraction of light.")
Tokenizer("The Mona Lisa is a famous painting by Leonardo da Vinci.")
Tokenizer("Owls are nocturnal birds of prey.")
Tokenizer("Tigers are the largest cats in the world.")
Tokenizer("The Nile River is the longest river in Africa.")
Tokenizer("Penguins live in the Southern Hemisphere.")
Tokenizer("The Mona Lisa is displayed in the Louvre Museum.")
Tokenizer("Astronauts wear spacesuits for protection in space.")
Tokenizer("The Leaning Tower of Pisa is in Italy.")
Tokenizer("The human brain weighs about 3 pounds.")
Tokenizer("Ants are known for their organized colonies.")
Tokenizer("The Taj Mahal is a beautiful marble mausoleum.")
Tokenizer("Volcanoes erupt molten lava.")
Tokenizer("The speed of light is approximately 299,792 kilometers per second.")
Tokenizer("Chameleons can change color to blend into their surroundings.")
Tokenizer("The Celsius and Fahrenheit scales are used to measure temperature.")
Tokenizer("The Sydney Opera House is an iconic landmark in Australia.")
Tokenizer("The Hubble Space Telescope captures stunning images of the universe.")
Tokenizer("Pandas primarily eat bamboo.")
Tokenizer("The coldest temperature ever recorded on Earth was -128.6 degrees Fahrenheit.")
Tokenizer("The Mona Lisa has a mysterious smile.")
Tokenizer("Rainbows are a spectrum of light.")
Tokenizer("Dolphins are highly intelligent marine mammals.")
Tokenizer("The Berlin Wall divided East and West Berlin during the Cold War.")
Tokenizer("The human heart beats about 100,000 times per day.")
[/quote:2gcgjc7r] |
random sentences generator | Dear Antonio,
Thank you, it works.
And thank you very much for your research and development work and for exploring new techniques for us.
Best regards,
Otto |
random with a dbf | I have a dbf where there is a field ( codice)
how I can load an random number to load a record
Regards |
random with a dbf | You may use nRandom( <nRange> ) --> nValue to create random numbers. |
random with a dbf | thanks antonio
but this func is of fw or harbour ? |
random with a dbf | FW/FWH |
random with a dbf | Silvio
Try the folowing:
[code:28n4g6lo]
FUNCTION Unique()
LOCAL cNumeric:= STR (HB_RANDOMINT(1,10000) ,5)
// You may use any number instand of 10000
cNumeric := STRTRAN (cNumeric ," ","0")
RETURN( cNumeric)
[/code:28n4g6lo]
Regards
Dionisis |
random with a dbf | thanks but I must create a random number from a file dbf
on the file dbf i have a numeric field ( codice) :
use IMG alias IMG
totale:= img->(reccount())
Number:=nRnadom(totale)
Go Number
have you another idea ? |
random with a dbf | Hello Silvio again
Try the following :
[code:1wzjs16i]
FUNCTION Unique(nTotale)
RETURN( HB_RANDOMINT(1,nTotale))
[/code:1wzjs16i]
Regards
Dionisis |
random with a dbf | thanks to all |
range date : the return !!! | To james and Otto specially,
There is an error on dbfilter when we made the dbfilter to search the init date and final date :
You be careful with my reasons
A Hotel Ask to chalet :
2 umbrellas for the weekend from 11.07 to 12.07 ( the hotel wants the number 1 and 2)
1 umbrella forse the weekend from 18.07 to 19.07 ( the hotel wants the number 3)
then another hotel want 3 umbrellas ( the number 1, 2 and 3) from 10.07 to 21.07
If I use the dbfilter command and Is_free function ( made by me and correct by james) the procedure let me say these umbrellas are occupated and it not make an booking order
BUT but this is not the reality
beacuse the number 1 and the number 2 are Free from 10.07 to 11.07 and from 13.07 to 21.07
and the number 3 is Free from 10.07 to 17.07 and from 20.07 to 21.07
How resolve it ?
Any idea ? |
range date : the return !!! | Silvio,
I guess I don't really understand what you are trying to do.
I thought that the start and end dates you were entering into the filter was the date range that the user wished to reserve. For example the dates entered are 01.06.09 - 05.06.09 would mean that the customer wanted to reserve all the days between those dates.
Are you needing to actually find any single days between the start and end date that are available for a specified umbrella? What about for any umbrella (I can see this being useful also)?
I have never seen a beach with reserved umbrellas here in the US, so I am not familiar with how they might be reserved. I can see how it might be useful if a customer was going to be there for a week, for the system to find any combination of umbrellas that were free, either the same umbrella for multiple days, and/or several umbrellas that are available for single or multiple days. The customer might prefer to have the same umbrella for the entire date range, but would be willing to accept a mixed reservation of several umbrellas instead. This can get quite complicated.
The other side of the issue is that you also need to make it easy for the computer user to solve the problem. Having them look at each umbrella for some available days is not a good solution. Ideally, after the initial parameters are entered the system should look for the optimum solution first, and if that fails then automatically offer up some alternative solutions for the customer to pick from. It should not be designed so the user has to keep trying new ways to solve the problem.
It will really help to define the problem in detail in words before trying to write any code to solve the problem.
James |
range date : the return !!! | Hello james,
>I have never seen a beach with reserved umbrellas here in the US
The high beach culture beside the friendly people is the reason for the success of the Adriatic tourism.
As far as I know usually one “bagno” has up to around 150 umbrellas. This “square mile” normally gives work to a whole family. Every day the whole place is polished the sunbeds in the morning are turned in the sea direction and the umbrellas are opened for the customers. Top service.
Best regards,
Otto |
range date : the return !!! | Otto,
150 umbrelas ?
I saw on my town 1200, 1600 , 3000 ...5000 umbrellas not 150 ....!!!
If you search with google map this location "Roseto degli Abruzzi" you can see all beaches
James,
Many chalet reserve many umbrellas for the hotels
Hotels ask to chalet 60/70 umbrellas for a specific period
this umbrellas have two basic element ( two chair)
when arrive the customer on hotel want your umbrellas of last year and take also seabeds
On sample I make on top of this topic I sad an chalet can reserve umbrellas for a period
2 umbrelas ( number 1 e number 2) for a week end 11.07 to 12.07
1 umbrealls ( number 3) for another week end 18.07 to 19.07
then another hotel or customer want the number 1,2 and 3 from 08.07 to 20.07
the procedure let me say thisisi not possible beacuse the first hotel occupated this umbrellas on this period
but it is not reality because I see free the umbrealls and occuapted only from 11.07 to 12.07 and 18.07 to 19.07
the procedure must say they are free from 08.07 to 10 and from 13.07 to 17.o7 and from 20.07 to 20.07
I understand I cannot resolve it .... |
range date : the return !!! | james,
>I thought that the start and end dates you were entering into the filter was the date range that the user wished to reserve. For >example the dates entered are 01.06.09 - 05.06.09 would mean that the customer wanted to reserve all the days between those >dates
[b:2gpcz2bb]yes [/b:2gpcz2bb]
>Are you needing to actually find any single days between the start and end date that are available for a specified umbrella? What >about for any umbrella (I can see this being useful also)?
[b:2gpcz2bb]yes[/b:2gpcz2bb]
How resolve it ? |
range date : the return !!! | Hello Silvio,
I read that in Emilia Romagna (110km coast) are 252.800 umbrellas which are divided into 1426 “bagni” which is ca. 180 per "bagno".
Maybe it is different where you are. But the typical Adriatic beach around Rimini should be like that.
This is my experience too spending my holiday on the Adriatic sea since ever .
Best regards,
Otto |
range date : the return !!! | Hello Silvio,
we use a so called “Dispo-sheet” where we have the room categories and show the vacancies for each day.
Maybe you can do it like that.
Best regards,
Otto
[img:31li4oe6]http://www.atzwanger-software.com/fw/dispo.jpg[/img:31li4oe6] |
range date : the return !!! | Otto,
>>>I have never seen a beach with reserved umbrellas here in the US
I hope you didn't take my comment that I was being critical--it sounds a lot nicer than having to lug your own umbrella and chairs to the beach as we do here. And the older I get, the nicer that sounds!
Differences in culture are what make travel fun in my opinion.
James |
range date : the return !!! | Silvio,
[quote:91dl1625]I thought that the start and end dates you were entering into the filter was the date range that the user wished to reserve. For >example the dates entered are 01.06.09 - 05.06.09 would mean that the customer wanted to reserve all the days between those >dates
yes
>Are you needing to actually find any single days between the start and end date that are available for a specified umbrella? What >about for any umbrella (I can see this being useful also)?
yes
How resolve it ?[/quote:91dl1625]
Finding the data, and then presenting the data are two different issues.
Finding it can be done with DO WHILE loops. First find all umbrellas that are free for the entire date range, then find all the umbrellas that are free for less than the entire range. For example if the date range is 5 days, I would loop through all umbrellas looking for any that are free for the entire 5 days. Then loop through for 4 days, then 3, then 2, then 1. This is more complex than it seems, since any that are available for 5 days will also be available for 4,3,2 and 1 day so they should be eliminated from subseqent searches. Also, you can't just pick any 3 day and any 2 day availability since the periods have to fill the entire 5 day period and not overlap. There are lots of combinations possible.
Perhaps a solution would be to first list all the 5 day availabilities, then if the customer doesn't like those, then all the ones with the first 4 days and all those with the last 1 day. Then 1 and 4, then 3 and 2, 2 and 3--still lots of possible combinations. If they want a 10 day reservation, then the possibilities get much larger.
OK, then how to present this to the user. Would I be correct in assuming that customers may want to specify a certain umbrella, or one near the water, or maybe not near the water? How important of an issue is this?
Adding an umbrella specification really adds to the complexity since all the date range searches would then have to be limited to either 1 umbrella or a range of umbrellas (like first row, second row, etc.). Whew!
Then it seems you also have another criteria, chairs or beds? How many options of these are there?
This is a much more complex problem than it seems at first. How are they doing this now? Manually? If so, then any automated system would be better than manual, but it does help to try to describe an ideal system from the start before coding. You can build a simple automated system (still better than manual) then continue to add and refine it.
[i:91dl1625]Murphy's Law, "Nothing is as simple as it seems."[/i:91dl1625]
James |
range date : the return !!! | James,
I think I cannot create thi control because is too hard
We can think to another solution
Perhaps if I create a new father dbf where I can insert the number of umbrellas and all dates from May to September ( this is the period of summer booking from 17.05 to 12.09) when I insert a booking order I can save this data on this Father dbf.
But I not Know How create it because Perhaps I must create over 250 field into a dbf
then the research on this file will be too complex...
What do you think abou t? |
range date : the return !!! | Otto,
How I can make to show on YOUR CLASS datepick FROM JANNUARY TO DECEMBER WHEN A UMBRELLAS IS FREE OR NOT ? |
range date : the return !!! | Silvio,
>I think I cannot create thi control because is too hard
Yes you can! You just have to define the solution you want, then start working on it a step at a time.
[i:3btdj32h]A journey of a thousand miles begins with a single step. -Lao-tzu[/i:3btdj32h]
You have lots of friends here to help.
The step you need to take right now is to comment on each of the quesitons that I asked in my last post.
What I can tell you, is that just starting to code without any idea of where you are going isn't going to work. If you don't know where you are going, then any road will get you there.
James |
range date : the return !!! | Silvio,
Here I have made a work flow diagram for the problem. Now all you have to do is write the code.
[url:2s9638k4]http://blueballfixed.ytmnd.com[/url:2s9638k4]
James |
range date : the return !!! | I undestand there are many factor to create a funcionally power control of date.
On Hotel application it can be easy because we can see day by day but for the night of each days ther eI can use Tplan to create a easy tableau
Instead on Beach application I have many factors : One day , Morning, Afternoon, ....
It is so Hard and for each umbrellas there many orders : for sample I can have a umbrellas with 127 orders different if we think only to the morning order ( 254 if we think for the morning and afternoon, only 127 for the normal day) because there are 127 day on summer period ( from 16.05 to 12sept) : how I can control all ? |
range date : the return !!! | Silvio,
[quote:2ojwpuoa]It is so Hard and for each umbrellas there many orders : for sample I can have a umbrellas with 127 orders different if we think only to the morning order ( 254 if we think for the morning and afternoon, only 127 for the normal day) because there are 127 day on summer period ( from 16.05 to 12sept) : how I can control all ?[/quote:2ojwpuoa]
This is not much more difficult. You just have 2 periods for each umbrella for each day. When you a looking for a full-day reservation, then both periods must be available. You might also consider finding two umbrellas for a full-day reservation if there are no full-day reservations available. The customer would have to move at mid-day, but it would be better than no umbrella.
Again, I ask, how are they doing this now? It is all manual with paper or cards? If so do they have very limited citeria that they use? How exactly do they find available umbrellas?
It helps a lot to define what the current system is, then define how a better automated system would work. Then get your customer to agree to this before you start coding. You can also do this in phases. Phase 1 is a simple system, either equal to the current cababilities or slightly better, then Phase 2, 3, etc. are more advanced versions. I would think since you are already into the current season, that your customer is very anxious to get something as soon as possible even if it is not an ideal system. So, giving them a simple system soon, is better than a more advanced system much later.
So you need to define all the must-have features and then all the nice-to-have features.
James |
range date : the return !!! | Silvio,
Could you try this code ?
It should be a good starting
[code=fw:13baq033]<div class="fw" id="{CB}" style="font-family: monospace;"><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> aFlds := <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">"IdNumber"</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">0</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Date"</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">0</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"AfterNoon"</span>,<span style="color: #ff0000;">"L"</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">0</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">local</span> el , i<br /><span style="color: #B900B9;">//DELETE FILE "Umbrella.dbf"</span><br /><span style="color: #B900B9;">//DELETE FILE "Umbrella.cdx"</span><br /><span style="color: #00C800;">IF</span> ! File<span style="color: #000000;">(</span><span style="color: #ff0000;">"Umbrella.dbf"</span><span style="color: #000000;">)</span><br /> DbCreate<span style="color: #000000;">(</span><span style="color: #ff0000;">"Umbrella"</span>,aFlds<span style="color: #000000;">)</span><br />END<br /><span style="color: #00C800;">IF</span> ! File<span style="color: #000000;">(</span><span style="color: #ff0000;">"Umbrella.cdx"</span><span style="color: #000000;">)</span><br /> USE UMBRELLA<br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> FIELD->IdNumber+Date+IIF<span style="color: #000000;">(</span>FIELD->AfterNoon,<span style="color: #ff0000;">"1"</span>,<span style="color: #ff0000;">"0"</span><span style="color: #000000;">)</span> TAG <span style="color: #ff0000;">"IdNumber"</span><br /> <span style="color: #B900B9;">//INDEX ON Date+Field->IdNumber+IIF(FIELD->AfterNoon,"1","0") TAG "Date"</span><br /> <span style="color: #B900B9;">// With one seek we can check for a date AND Idnumber</span><br /> CLOSE ALL<br />END<br />USE UMBRELLA SHARED<br /><span style="color: #00C800;">IF</span> RECCOUNT<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span><br /> BuildTestData<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END<br />OrdSetFocus<span style="color: #000000;">(</span><span style="color: #ff0000;">"IDNumber"</span><span style="color: #000000;">)</span><br />TestFree<span style="color: #000000;">(</span><span style="color: #ff0000;">"0001"</span> , CTOD<span style="color: #000000;">(</span><span style="color: #ff0000;">"10/07/2009"</span><span style="color: #000000;">)</span> , .F. , CTOD<span style="color: #000000;">(</span><span style="color: #ff0000;">"21/07/2009"</span><span style="color: #000000;">)</span> , .T.<span style="color: #000000;">)</span> <span style="color: #B900B9;">// Number umbrella , from date , Not afternoon , to date , afternoon</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />***********************************************************************************<br /><span style="color: #0000ff;">INIT</span> PROCEDURE InitUmbrella<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />******************************<br />ANNOUNCE RDDSYS <span style="color: #B900B9;">// This line must not change</span><br />REQUEST DBFCDX <span style="color: #B900B9;">// Causes DBFNTX RDD to be linked in</span><br />rddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Set up DBFNTX as default driver</span><br />SET<span style="color: #000000;">(</span>_SET_AUTOPEN, .T. <span style="color: #000000;">)</span><br />SET DATE FRENCH<br /><span style="color: #00C800;">RETURN</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />PROC BuildTestData<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />**************************<br /><span style="color: #00C800;">LOCAL</span> aData := <span style="color: #000000;">{</span><span style="color: #000000;">}</span> , el<br />AADD<span style="color: #000000;">(</span>aData,<span style="color: #000000;">{</span><span style="color: #ff0000;">"0001"</span>,<span style="color: #ff0000;">"20090711"</span>,.F.<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />AADD<span style="color: #000000;">(</span>aData,<span style="color: #000000;">{</span><span style="color: #ff0000;">"0001"</span>,<span style="color: #ff0000;">"20090711"</span>,.T.<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />AADD<span style="color: #000000;">(</span>aData,<span style="color: #000000;">{</span><span style="color: #ff0000;">"0001"</span>,<span style="color: #ff0000;">"20090712"</span>,.F.<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />AADD<span style="color: #000000;">(</span>aData,<span style="color: #000000;">{</span><span style="color: #ff0000;">"0001"</span>,<span style="color: #ff0000;">"20090712"</span>,.T.<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />AADD<span style="color: #000000;">(</span>aData,<span style="color: #000000;">{</span><span style="color: #ff0000;">"0002"</span>,<span style="color: #ff0000;">"20090718"</span>,.F.<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />AADD<span style="color: #000000;">(</span>aData,<span style="color: #000000;">{</span><span style="color: #ff0000;">"0002"</span>,<span style="color: #ff0000;">"20090718"</span>,.T.<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />AADD<span style="color: #000000;">(</span>aData,<span style="color: #000000;">{</span><span style="color: #ff0000;">"0002"</span>,<span style="color: #ff0000;">"20090719"</span>,.F.<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />AADD<span style="color: #000000;">(</span>aData,<span style="color: #000000;">{</span><span style="color: #ff0000;">"0002"</span>,<span style="color: #ff0000;">"20090719"</span>,.T.<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">FOR</span> EACH el IN aData<br /> DBAPPEND<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> NETERR<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> EXIT<br /> END<br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> FCOUNT<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> FieldPut<span style="color: #000000;">(</span>i,el<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /> UNLOCK<br /><span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">RETURN</span><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------//</span><br />FUNC TestFree<span style="color: #000000;">(</span>IdNumber , FromDate , FromNoon , ToDate , ToNoon<span style="color: #000000;">)</span><br />***************************************************<br /><span style="color: #00C800;">LOCAL</span> Date , lNoon<br /><span style="color: #00C800;">LOCAL</span> el , Txt , i<br /><span style="color: #00C800;">LOCAL</span> nCount := IIF<span style="color: #000000;">(</span>FromNoon,<span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> aFree<span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span><br /><span style="color: #00C800;">IF</span> ToDate > FromDate<br /> nCount += <span style="color: #000000;">(</span>ToDate-FromDate<span style="color: #000000;">-1</span><span style="color: #000000;">)</span>*<span style="color: #000000;">2</span><br /> nCount += IIF<span style="color: #000000;">(</span>ToNoon,<span style="color: #000000;">2</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><br />END<br />Date := FromDate<br />Txt := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nCount<br /> <span style="color: #00C800;">IF</span> lNoon == <span style="color: #00C800;">nil</span><br /> lNoon := FromNoon<br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #00C800;">IF</span> ! lNoon<br /> Date += <span style="color: #000000;">1</span><br /> END<br /> END<br /> <span style="color: #00C800;">IF</span> ! DBSEEK<span style="color: #000000;">(</span>IdNumber+DTOS<span style="color: #000000;">(</span>Date<span style="color: #000000;">)</span>+IIF<span style="color: #000000;">(</span>lNoon,<span style="color: #ff0000;">"1"</span>,<span style="color: #ff0000;">"0"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> Txt += <span style="color: #000000;">(</span>el := DTOC<span style="color: #000000;">(</span>Date<span style="color: #000000;">)</span> + IIF<span style="color: #000000;">(</span>lNoon,<span style="color: #ff0000;">" After"</span>,<span style="color: #ff0000;">" Before"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> + CRLF<br /> AADD<span style="color: #000000;">(</span>aFree,el<span style="color: #000000;">)</span><br /> END<br /> lNoon := ! lNoon<br /><span style="color: #00C800;">NEXT</span><br />? Txt<br /><span style="color: #00C800;">RETURN</span> aFree<br /><br /> </div>[/code:13baq033] |
range date : the return !!! | Silvio,
I was looking at your problem again.
What is the fieldname for the umbrella number? Is it CAMERA? Literally translated it seems to be "room" in English.
If not, then also what is the CAMERA field for?
James |
range date : the return !!! | yes |
range date : the return !!! | Ok, then I wonder why there are multiple reservations for the same date range for the same umbrella? In some cases, I see three records for the same date range. I know you mentioned morning and afternoon reservations, but that would account for only two.
Is there a field for morning, afternoon?
How did the sample database get filled out? Is it likely to have unrealistic data in it?
James |
rango dates | I insert on a dialog two control datepick to select two dates
one initial and the second the end date
Now I want to control on an archive if there is a booking order for that period of dates
I have [b:vf5agrum]test->dal [/b:vf5agrum]( initial date) and [b:vf5agrum]test->al [/b:vf5agrum]end date
How I can make to create the filter ?
thanks |
rango dates | Silvio,
maybe you can try like this:
[code=fw:3ug4as4c]<div class="fw" id="{CB}" style="font-family: monospace;"><br />initialdate < test->da .AND. end > test->dal<br /> </div>[/code:3ug4as4c] |
rango dates | Otto not is easy,
On booking reservation I have two field cotiza->dal and COtiza ->al
If the user select the initial date and the end date
I want show all umbrellas and each umbrellas must check into booking archive if have a reservation
I made a test sample but it not run
[code=fw:qkeg46ix]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dtpicker.ch"</span><br /><br /><br /><br /><br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">TRUE</span> .T.<br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">FALSE</span> .F<br /><br /><span style="color: #00C800;">STATIC</span> dDataIniziale , dDataFinale<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> odlgDate<br /><span style="color: #00C800;">Local</span> nOmBrellone:=<span style="color: #000000;">264</span><br /><span style="color: #00C800;">Local</span> Xtipo :=<span style="color: #ff0000;">"O"</span><br /><br />dDataIniziale :=DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />dDataFinale:=DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> odlgDate <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">280</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SEARCH DATES"</span><br /><br /> @ <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span> DTPICKER dDataIniziale <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> odlgDate<br /> @ <span style="color: #000000;">2</span>,<span style="color: #000000;">2</span> DTPICKER dDataFinale <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> odlgDate <span style="color: #0000ff;">VALID</span> dDataIniziale<=dDataFinale<br /><br /><br /> @ <span style="color: #000000;">3</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"check"</span> <span style="color: #0000ff;">action</span> SHOW_LISTBOX<span style="color: #000000;">(</span>dDataIniziale,dDataFinale ,nOmbrellone, XTIPO<span style="color: #000000;">)</span> <span style="color: #0000ff;">OF</span> odlgDate<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> odlgDate <span style="color: #0000ff;">CENTER</span><br /><br /><br /><br /><span style="color: #00C800;">Function</span> show_listbox<span style="color: #000000;">(</span> dDataIniziale,dDataFinale ,n, XTIPO<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> oBPre,oText<br />USE COTIZA <span style="color: #0000ff;">ALIAS</span> COTIZA<br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> COTIZA->CAMERA <span style="color: #0000ff;">TO</span> CAMERA<br />GO TOP<br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !cotiza-><span style="color: #000000;">(</span>EoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> alltrim<span style="color: #000000;">(</span>COTIZA->tipoattrez<span style="color: #000000;">)</span>=XTIPO .AND. COTIZA->CAMERA=n ;<br /> .AND. dDataIniziale < COTIZA->DAL .AND. dDataFinale > COTIZA->dAL<br /><br /> oText:=TTxtFile<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"check.txt"</span><span style="color: #000000;">)</span><br /> oText:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"NumDoc: "</span>+alltrim<span style="color: #000000;">(</span>cotiza->Numdoc<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oText:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Omb: "</span>+str<span style="color: #000000;">(</span>cotiza->camera<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oText:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Dal: "</span>+cf<span style="color: #000000;">(</span>cotiza->dal<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oText:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Al: "</span>+cf<span style="color: #000000;">(</span>cotiza->Al<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oText:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"stato "</span>+str<span style="color: #000000;">(</span>cotiza->stato<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oText:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> cotiza-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><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 /><br /><br /> </div>[/code:qkeg46ix]
this the archive cotiza.dbf <!-- m --><a class="postlink" href="http://www.vdswin.it/data_cotiza.rar">http://www.vdswin.it/data_cotiza.rar</a><!-- m --> |
rango dates | I try also with this :
IF alltrim(COTIZA->tipoattrez)=XTIPO .AND. COTIZA->CAMERA=n ;
.AND. COTIZA->DAL<=(dDataIniziale) .AND. COTIZA->AL>=(dDataFinale) .or. ;
alltrim(COTIZA->tipoattrez)=XTIPO .AND. COTIZA->CAMERA=n .AND. ;
dDataIniziale<= COTIZA->DAL .AND. COTIZA->AL<= dDataFinale
if I select from 13.06 to 14.06 it run ok ( 13.06 - 14-06)
if I select from 14.06 to 14.06 it run ok ( 13.06 - 14-06)
If I select from 14.06 to 15.06 it not run but there is a reservation from 13.06 to 14-06 why it not see it ? |
rango dates | Try this:
[code=fw:2ofsfohc]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">IF</span> alltrim<span style="color: #000000;">(</span>COTIZA->tipoattrez<span style="color: #000000;">)</span>=XTIPO .AND. COTIZA->CAMERA=n ;<br />.AND. COTIZA->DAL<=<span style="color: #000000;">(</span>dDataIniziale<span style="color: #000000;">)</span> .AND. COTIZA->AL>=<span style="color: #000000;">(</span>dDataIniziale<span style="color: #000000;">)</span> .or. ;<br />alltrim<span style="color: #000000;">(</span>COTIZA->tipoattrez<span style="color: #000000;">)</span>=XTIPO .AND. COTIZA->CAMERA=n .AND. ;<br />dDataFinale <= COTIZA->DAL .AND. COTIZA->AL <= dDataFinale</div>[/code:2ofsfohc]
James |
rango dates | Actually, this would be better:
[code=fw:2rdp3p7r]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">IF</span> alltrim<span style="color: #000000;">(</span>COTIZA->tipoattrez<span style="color: #000000;">)</span>=XTIPO .AND. COTIZA->CAMERA=n .AND.;<br /> <span style="color: #000000;">(</span> ;<br /> <span style="color: #000000;">(</span> COTIZA->DAL <= dDataIniziale .AND. COTIZA->AL >= dDataIniziale <span style="color: #000000;">)</span> .or. ;<br /> <span style="color: #000000;">(</span> dDataFinale <= COTIZA->DAL .AND. COTIZA->AL <= dDataFinale <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">)</span></div>[/code:2rdp3p7r]
James |
rango dates | good Now It seem go good |
rango dates | Glad to hear it.
You can still speed it up considerably by designing the proper index and using it to filter out some of the records before doing your date range test.
James |
rango dates | SORRY,
I WRITE WRONG ..
IT NOT RUN GOOD |
rango dates | Hello Silvio
have you tried my code. This is the code for occuied:
initialdate < test->da .AND. end > test->dal
You should use it like that:
if initialdate < test->da .AND. end > test->dal
else
here are your add's
endif
What is the result?
Regards,
Otto |
rango dates | Otto,
>if initialdate < test->da .AND. end > test->dal
It is more complicated than that. He needs to know if the new date range overlaps any existing date range by one or more days. I thought the one I posted would do it, but I haven't tested it. Silvio says it still isn't working. I will test it here.
Regards,
James |
rango dates | james I sent yesterday the test files to YOU |
rango dates | Otto and James I explain the code :
[code=fw:1irw2l72]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><br /><span style="color: #00C800;">If</span> aData<span style="color: #000000;">[</span>nY,nX<span style="color: #000000;">]</span>== <span style="color: #ff0000;">"O"</span><br /> cTipoAttrez:=<span style="color: #ff0000;">"O"</span><br /> cTipoSol :=<span style="color: #ff0000;">""</span><br /> cPosNome := <span style="color: #ff0000;">""</span><br /> nOmbrellone := <span style="color: #000000;">(</span>oDBeach<span style="color: #000000;">)</span>->camera<br /> nFila:= <span style="color: #000000;">(</span>oDBeach<span style="color: #000000;">)</span>->Y<br /> cCaption2:=<span style="color: #ff0000;">"Ombrellone n.:"</span>+str<span style="color: #000000;">(</span>nOmbrellone<span style="color: #000000;">)</span>+CRLF+<span style="color: #ff0000;">"Fila:"</span>+str<span style="color: #000000;">(</span>nFila<span style="color: #000000;">)</span><br /> n:= nOmbrellone<br /><br /> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>OrdSetFocus<span style="color: #000000;">(</span><span style="color: #000000;">3</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbGoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !<span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>EoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /><br /><br /> <span style="color: #00C800;">IF</span> alltrim<span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->tipoattrez<span style="color: #000000;">)</span>=cTipoAttrez .AND. <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->CAMERA=n .AND.;<br /> <span style="color: #000000;">(</span> ;<br /> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->DAL <= dDataIniziale .AND. <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->AL >= dDataIniziale <span style="color: #000000;">)</span> .or. ;<br /> <span style="color: #000000;">(</span> dDataFinale <= <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->DAL .AND. <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->AL <= dDataFinale <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">)</span><br /><br /><br /> cPosNome := alltrim<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->RAZSOC<span style="color: #000000;">)</span><br /> cTipoSol := alltrim<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->TIPSOL<span style="color: #000000;">)</span><br /> nStato:=<span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->stato<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDDO</span><br /><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:1irw2l72]
aData[nY,nX] is the type of object and this case it is an umbrellas. I made a class where I can draw the beach and the I can save all umbrellas on a dbf
the procedure show all object of the beach but if the object is an umbrellas must to control if there is a booking on cotiza.dbf for this umbrellas for the range dates
it found the number and the type of umbrellas (cTipoAttrez) and if the reservation is made during the two dates entered return the nstate
the nstate can be 1 = booking, 2= occupated
my procedure then show the umbrellas and show a bitmap blu if nstate is 1 , red if the nstate is 2, and if it not have nstate show an green umbrella
green = free |
rango dates | Silvio,
This sample code seems to be working fine. There is one matching record:
Record no. 7, DAL=06/13/2009, AL=06/14/2009
James
[code=fw:3kwwahgy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />request dbfcdx<br />REQUEST DBFFPT<br /><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> cTipoAttrez, nCamera, dIniziale, dFinale, nRecs<br /> field DAL, AL, CAMERA, TIPOATTREZ<br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /> set epoch <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">"1980"</span><br /> set century <span style="color: #0000ff;">on</span><br /><br /> cTipoAttrez:=<span style="color: #ff0000;">"O"</span><br /> nCamera:= <span style="color: #000000;">264</span><br /> dIniziale:= ctod<span style="color: #000000;">(</span><span style="color: #ff0000;">"06/14/2009"</span><span style="color: #000000;">)</span><br /> dFinale := ctod<span style="color: #000000;">(</span><span style="color: #ff0000;">"06/15/2009"</span><span style="color: #000000;">)</span><br /><br /> use cotiza shared<br /><br /> set filter <span style="color: #0000ff;">to</span> alltrim<span style="color: #000000;">(</span>tipoattrez<span style="color: #000000;">)</span> == cTipoAttrez .AND. CAMERA == nCamera ;<br /> .AND. ;<br /> <span style="color: #000000;">(</span>;<br /> <span style="color: #000000;">(</span> DAL >= dIniziale .AND. DAL <= dFinale <span style="color: #000000;">)</span> .OR.;<br /> <span style="color: #000000;">(</span> AL >= dIniziale .AND. AL <= dFinale <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">)</span><br /><br /> go top<br /><br /> <span style="color: #0000ff;">count</span> <span style="color: #0000ff;">to</span> nRecs<br /><br /> <span style="color: #0000ff;">msgInfo</span><span style="color: #000000;">(</span> nRecs <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3kwwahgy] |
rango dates | My previous code was using the American date format. Here it is using the Italian date format.
Regards,
James
[code=fw:3honaq0j]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />request dbfcdx<br />REQUEST DBFFPT<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> cTipoAttrez, nCamera, dIniziale, dFinale, nRecs<br /> field DAL, AL, CAMERA, TIPOATTREZ<br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /> set epoch <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">"1980"</span><br /> set century <span style="color: #0000ff;">on</span><br /> set date italian<br /><br /> cTipoAttrez:=<span style="color: #ff0000;">"O"</span><br /> nCamera:= <span style="color: #000000;">264</span><br /> dIniziale:= ctod<span style="color: #000000;">(</span><span style="color: #ff0000;">"14/06/2009"</span><span style="color: #000000;">)</span><br /> dFinale := ctod<span style="color: #000000;">(</span><span style="color: #ff0000;">"15/06/2009"</span><span style="color: #000000;">)</span><br /><br /> use cotiza shared<br /><br /> set filter <span style="color: #0000ff;">to</span> alltrim<span style="color: #000000;">(</span>tipoattrez<span style="color: #000000;">)</span> == cTipoAttrez .AND. CAMERA == nCamera ;<br /> .AND. ;<br /> <span style="color: #000000;">(</span>;<br /> <span style="color: #000000;">(</span> DAL >= dIniziale .AND. DAL <= dFinale <span style="color: #000000;">)</span> .OR.;<br /> <span style="color: #000000;">(</span> AL >= dIniziale .AND. AL <= dFinale <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">)</span><br /><br /> go top<br /><br /> <span style="color: #0000ff;">count</span> <span style="color: #0000ff;">to</span> nRecs<br /><br /> <span style="color: #0000ff;">msgInfo</span><span style="color: #000000;">(</span> nRecs <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3honaq0j] |
rango dates | Hello James,
with your filter you are testing if there is a booking exactly in this period.
If you change for example the booking
00002 Cliente H 3 1 01-01-2009 31-12-2009 .F. 1 0434 A 24-07-2002 GIOVANNI BIANCHI to a whole year booking your code still returns 1.
If think what I posted is the right filter:
set filter to ( dIniziale < AL .AND. dFinale > dal )
Best regards,
Otto |
rango dates | Otto,
>with your filter you are testing if there is a booking exactly in this period.
No, I am testing to see if the new date range overlaps any existing date range.
>If you change for example the booking
>00002 Cliente H 3 1 01-01-2009 31-12-2009 .F. 1 0434 A 24-07-2002 GIOVANNI BIANCHI to a whole >year booking your code still returns 1.
As it should. There is one record that overlaps the new range.
>If think what I posted is the right filter:
>set filter to ( dIniziale < AL .AND. dFinale > dal )
No, this is not correct. Here is an eample:
We want to book from 14/06/2009 - 15/06/2009 (dIniziale - dFinale)
There is a record with a booking from 13/06/2009 - 14/06/2009 (DAL - AL). By your example:
set filter to 14/06/2009 < 14/06/2009 .and. 15/06/2009 > 13/06/2009
The first condition will fail (leaving no record meeting the filter), yet you cannot book 14/06/2009-15/06/2009 because 14/06/2009 is already booked.
What we really want to know is if dIniziale is within any existing date range OR if dFinale is within any existing date range. This would actually be a better way to write the filter (it makes it more clear).
[code=fw:5peaq03h]<div class="fw" id="{CB}" style="font-family: monospace;"> set filter <span style="color: #0000ff;">to</span> alltrim<span style="color: #000000;">(</span>tipoattrez<span style="color: #000000;">)</span> == cTipoAttrez .AND. CAMERA == nCamera ;<br /> .AND. ;<br /> <span style="color: #000000;">(</span>;<br /> <span style="color: #000000;">(</span> dIniziale >= DAL .AND. dIniziale <= AL <span style="color: #000000;">)</span> .OR.;<br /> <span style="color: #000000;">(</span> dFinale >= DAL .AND. dFinale <= AL <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">)</span></div>[/code:5peaq03h]
James |
rango dates | Jamse,
[quote:1f57m92e]>00002 Cliente H 3 1 01-01-2009 31-12-2009 .F. 1 0434 A 24-07-2002 GIOVANNI BIANCHI to a whole >year booking your code still returns 1.
As it should. There is one record that overlaps the new range.
[/quote:1f57m92e]
but if you change this record to a booking over the whole season shouldn'd there then be 2:
the whole season booking and the booking from 14-15.6.2009
I am not clear what the msginfo should report: the free places or the occupied one?
Best regards,
Otto |
rango dates | Otto,
>but if you change this record to a booking over the whole season shouldn'd there then be 2:
>the whole season booking and the booking from 14-15.6.2009
Other than the dates, there are two other criteria which that record (recno 2) doesn't meet.
>I am not clear what the msginfo should report: the free places or the occupied one?
msgInfo() is returning the number of records that exist that overlap the desired booking date. If nRec>0 then you cannot make the booking.
James |
rango dates | Hello james,
I try to understand the conditions.
( DAL >= dIniziale .AND. DAL <= dFinale ) .OR. ( AL >= dIniziale .AND. AL <= dFinale )
Here a little graphic showing what I mean:
[img:2uv71mu2]http://www.atzwanger-software.com/fw/james.jpg[/img:2uv71mu2]
FALSE ( DAL >= dIniziale .AND. DAL <= dFinale )
FALSE ( AL >= dIniziale .AND. AL <= dFinale )
Both parts of the condition return false but the period is occupied.
Best regards,
Otto |
rango dates | James ,
I try with this :
[code=fw:rv3a6e8e]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> <span style="color: #00C800;">If</span> aData<span style="color: #000000;">[</span>nY,nX<span style="color: #000000;">]</span>== <span style="color: #ff0000;">"O"</span><br /> cTipoAttrez:=<span style="color: #ff0000;">"O"</span><br /> cTipoSol :=<span style="color: #ff0000;">""</span><br /> cPosNome := <span style="color: #ff0000;">""</span><br /> nOmbrellone := <span style="color: #000000;">(</span>oDBeach<span style="color: #000000;">)</span>->camera<br /> nFila:= <span style="color: #000000;">(</span>oDBeach<span style="color: #000000;">)</span>->Y<br /> cCaption2:=<span style="color: #ff0000;">"Ombrellone n.:"</span>+str<span style="color: #000000;">(</span>nOmbrellone<span style="color: #000000;">)</span>+CRLF+<span style="color: #ff0000;">"Fila:"</span>+str<span style="color: #000000;">(</span>nFila<span style="color: #000000;">)</span><br /> n:= nOmbrellone<br /> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>OrdSetFocus<span style="color: #000000;">(</span><span style="color: #000000;">3</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> set filter <span style="color: #0000ff;">to</span> alltrim<span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->tipoattrez<span style="color: #000000;">)</span> == cTipoAttrez .AND. <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->CAMERA == n ;<br /> .AND. ;<br /> <span style="color: #000000;">(</span>;<br /> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->DAL >= dDataIniziale .AND. <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->DAL <= dDataFinale <span style="color: #000000;">)</span> .OR.;<br /> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->AL >= dDataIniziale .AND. <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->AL <= dDataFinale <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbGoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !<span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>EoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cPosNome := alltrim<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->RAZSOC<span style="color: #000000;">)</span><br /> cTipoSol := alltrim<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->TIPSOL<span style="color: #000000;">)</span><br /> nStato:=<span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->stato<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDDO</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:rv3a6e8e]
I try , it seem run but I not made all tests I 'm working with my friend to make all tests |
rango dates | Otto,
How You control if a room is free in your Whotel application ?
I want a room from 16.08.2009 to 20.08.2009 : your application not control it ? |
rango dates | Otto,
>Both parts of the condition return false but the period is occupied.
While trying to fall asleep last night, I realized that my previous filter was not covering all conditions. You have pointed out one of those conditions and you are correct. There are more conditions also.
I am going to think about this some more this morning and run more tests. This is more complicated than it at first seemed. Now that I have had some sleep, maybe the little gray cells will be working better.
Regards,
James |
rango dates | Silvio and Otto,
OK, after one cup of coffee (but no testing), I think this filter covers all conditions:
[code=fw:19qz70d1]<div class="fw" id="{CB}" style="font-family: monospace;"> set filter <span style="color: #0000ff;">to</span> alltrim<span style="color: #000000;">(</span>tipoattrez<span style="color: #000000;">)</span> == cTipoAttrez .AND. CAMERA == nCamera ;<br /> .AND. ;<br /> <span style="color: #000000;">(</span>;<br /> <span style="color: #000000;">(</span> dIniziale >= DAL .AND. dIniziale <= AL <span style="color: #000000;">)</span> .OR.;<br /> <span style="color: #000000;">(</span> dFinale >= DAL .AND. dFinale <= AL <span style="color: #000000;">)</span> .OR. ;<br /> <span style="color: #000000;">(</span> dIniziale < DAL .AND. dFinale > AL <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">)</span></div>[/code:19qz70d1]
Otto, it seems that we were both right and we were both wrong--the filter needs to include both of our filters.
Now I am going to do have another cup of coffee and do some testing.
James |
rango dates | OK, testing seems to confirm that the filter is working. If you use these test dates:
dIniziale:= ctod("14/01/2009")
dFinale := ctod("15/12/2009")
You will get nRecs=6 which is all records in the database that also meet the first two criteria (the non-date criteria). Before adding Otto's filter, nRecs would have been 0. Thanks Otto!
Regards,
James |
rango dates | Otto,
>Here a little graphic showing what I mean:
>FALSE ( DAL >= dIniziale .AND. DAL <= dFinale )
>FALSE ( AL >= dIniziale .AND. AL <= dFinale )
>Both parts of the condition return false but the period is occupied.
You are referring to my first filter, note that I changed it later to:
[code=fw:24kr12j6]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #000000;">(</span> dIniziale >= DAL .AND. dIniziale <= AL <span style="color: #000000;">)</span> .OR.;<br /> <span style="color: #000000;">(</span> dFinale >= DAL .AND. dFinale <= AL <span style="color: #000000;">)</span></div>[/code:24kr12j6]
This would trap the condition in your graphic, but it was still missing the oposite of your graphic--when dIniziale <= DAL and dFinale was >= AL. These are now covered in the new filter.
[code=fw:24kr12j6]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #000000;">(</span> dIniziale >= DAL .AND. dIniziale <= AL <span style="color: #000000;">)</span> .OR.;<br /> <span style="color: #000000;">(</span> dFinale >= DAL .AND. dFinale <= AL <span style="color: #000000;">)</span> .OR. ;<br /> <span style="color: #000000;">(</span> dIniziale < DAL .AND. dFinale > AL <span style="color: #000000;">)</span></div>[/code:24kr12j6]
James |
rango dates | Hello James,
why do you think that the condition I posted should not work?
Best regards,
Otto |
rango dates | Otto,
>why do you think that the condition I posted should not work?
>( dIniziale < AL .AND. dFinale > DAL )
Well because I tested it and it didn't as I pointed out in a previous message.
I have looked at it again and I realized that I was not seeing it properly. I was confusing DAL and AL. What I was thinking you had was this:
( dIniziale < DAL .AND. dFinale > AL )
But after looking at your filter again and making a slight modification this seems to work:
( dIniziale <= AL .AND. dFinale >= DAL )
It is important to add the = signs. It works the same as my previous filter but it is much simpler. I like it!
Regards,
James |
rango dates | Hello James,
thank you for your answer.
> I was confusing DAL and AL.
James, therefore I ask what you show in the msginfo.
It was not clear from the question Silvio posted what he really wants:
the free umbrellas or the occupied.
This with the equal signs is much depending of the purpose.
Silvio needs free umbrellas during the day in my case with WINHOTEL
I check if the night is free.
Best regards,
Otto |
rango dates | Otto,
>> I was confusing DAL and AL.
>James, therefore I ask what you show in the msginfo.
>It was not clear from the question Silvio posted what he really wants:
>the free umbrellas or the occupied.
It appears that he was looking to tell if an umbrella was reserved for a date range. However, it would seem to be a better user interface to just select a date and show all umbrellas that are not reserved. Maybe that is what he wants. Silvio?
Howerver, msgInfo() was just a quick test of the filter.
>This with the equal signs is much depending of the purpose.
>Silvio needs free umbrellas during the day in my case with WINHOTEL
>I check if the night is free.
Hmm. But, wouldn't it be the same? If a room is occupied for the night of the 15th, don't you consider the room occupied on the 15th? So, wouldn't you need the same filter?
James |
rango dates | JAMES,
set filter to alltrim((oDPre)->tipoattrez)) == cTipoAttrez .AND. (oDPre)->CAMERA == n ;
.AND. ;
(;
( dDataIniziale >= (oDPre)->DAL .AND. dDataIniziale <= (oDPre)->AL ) .OR. ;
( dDataFinale >= (oDPre)->DAL .AND. dDataFinale <= (oDPre)->AL ) .OR. ;
( dDataIniziale < (oDPre)->DAL .AND. dDataFinale > (oDPre)->AL ) ;
)
WHY THE COMPILATOR LET ME SAY
source\RIV220.prg(275) Error E0030 Syntax error: "syntax error at 'FILTER'" ? |
rango dates | I call oDpre because
oDPre:=Open_Dbf("Cotiza")
I use this function from 7 year |
rango dates | James,
this is the last ?
set filter to alltrim((oDPre)->tipoattrez)) == cTipoAttrez .AND. (oDPre)->CAMERA == n ;
.AND. ;
(;
( dDataIniziale >= (oDPre)->DAL .AND. dDataIniziale <= (oDPre)->AL ) .OR.;
( dDataFinale >= (oDPre)->DAL .AND. dDataFinale <= (oDPre)->AL ) .OR. ;
( dDataIniziale < (oDPre)->DAL .AND. dDataFinale > (oDPre)->AL ) ;
)
the compilator make error
for this
set filter to alltrim((oDPre)->tipoattrez) == cTipoAttrez .AND. (oDPre)->CAMERA == n ;
.AND. ;
(;
( (oDPre)->DAL >= dDataIniziale .AND. (oDPre)->DAL <= dDataFinale ) .OR.;
( (oDPre)->AL >= dDataIniziale .AND. (oDPre)->AL <= dDataFinale );
)
the compilator runned ok
can you understand why the compilator make error ? |
rango dates | Silvio,
I don't see the error, but use the simpler filter like this:
set filter to alltrim((oDPre)->tipoattrez)) == cTipoAttrez .AND. (oDPre)->CAMERA == n ;
.AND. ( dIniziale <= (oDPre)->AL .AND. dFinale >= (oDPre)->DAL )
and see if the error goes away.
However, if I may make another suggestion. You are using this var, oDPre, to signify a character value (the alias). The "o" prefix standardly signifies an object datatype not a character datatype. This makes your code harder to understand, so it would be better to use "cDPre" or better yet, "cAlias."
Better yet would be to use a database object. Then you can use syntax like oDPre:DAL and you don't have to use aliases at all.
Regards,
James |
rango dates | Silvio,
[quote:1g7i6akz]I call oDpre because
oDPre:=Open_Dbf("Cotiza")
I use this function from 7 year.[/quote:1g7i6akz]
I understand, I was just pointing out that the name "oDPre" signifies that it is an object and you are returning a character data type from the function, not an object. So, oDPre should really be cDPre.
[quote:1g7i6akz]this is the last ?
set filter to alltrim((oDPre)->tipoattrez)) == cTipoAttrez .AND. (oDPre)->CAMERA == n ;
.AND. ;
(;
( dDataIniziale >= (oDPre)->DAL .AND. dDataIniziale <= (oDPre)->AL ) .OR.;
( dDataFinale >= (oDPre)->DAL .AND. dDataFinale <= (oDPre)->AL ) .OR. ;
( dDataIniziale < (oDPre)->DAL .AND. dDataFinale > (oDPre)->AL ) ;
)[/quote:1g7i6akz]
No, this is the last:
[code=fw:1g7i6akz]<div class="fw" id="{CB}" style="font-family: monospace;">set filter <span style="color: #0000ff;">to</span> alltrim<span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->tipoattrez<span style="color: #000000;">)</span><span style="color: #000000;">)</span> == cTipoAttrez .AND. <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->CAMERA == n ;<br />.AND. <span style="color: #000000;">(</span> dIniziale <= <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->AL .AND. dFinale >= <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>->DAL <span style="color: #000000;">)</span></div>[/code:1g7i6akz]
Try it and I don't think you will get an error. This replaces the filter above.
Regards,
James |
rango dates | I made :
set filter to alltrim((oDPre)->tipoattrez)) == cTipoAttrez .AND. (oDPre)->CAMERA == n ;
.AND. ( dDataIniziale <= (oDPre)->AL .AND. dDataFinale >= (oDPre)->DAL )
[b:2mo0bw95]Compiling 'source\RIV220.prg'...
source\RIV220.prg(261) Error E0030 Syntax error: "syntax error at 'FILTER'"[/b:2mo0bw95] |
rango dates | Silvio,
You have an extra paren (shown in red).
set filter to alltrim((oDPre)->tipoattrez)[color=#FF0000:1ulwglfp])[/color:1ulwglfp] == cTipoAttrez .AND. (oDPre)->CAMERA == n ;
.AND. ( dDataIniziale <= (oDPre)->AL .AND. dDataFinale >= (oDPre)->DAL )
James |
rango dates | sorry... thanks..here there is very hot....
but I want understand
On a dialog I have a similar problem :
to insert a new order I want to control for sample
if the umbrella number 264 have an order on period date I want found
I know and the user insert this data :
the number of umbrellas (n)
the type of umbrellas (type)
the initial date ( dData1)
the end date (dData2)
I wank make a function must return me a value .t. if found a record .f. if it not found any record
I made :
Function Isfree(dData1,dData2,n,type)
Local lvalue:=.f.
(oDPre)->(OrdSetFocus(3)) // order on umbrellas numbers
set filter to alltrim((oDPre)->tipoattrez) == type .AND. (oDPre)->CAMERA == n ;
.AND. ( dData1 <= (oDPre)->AL .AND. dData2 >= (oDPre)->DAL )
(oDPre)->(DbGoTop())
DO WHILE !(oDPre)->(EoF())
lvalue:=.t.
(oDPre)->(DbSkip())
ENDDO
return lvalue
why it return me alway .t. ?
where I make error ? |
rango dates | perhaps I found the solution :
Function Isfree(dData1,dData2,n,type)
Local lvalue:=.f.
(oDPre)->(OrdSetFocus(3)) // order on umbrellas numbers
(oDPre)->(DbGoTop())
DO WHILE !(oDPre)->(EoF())
IF alltrim((oDPre)->tipoattrez) == type .AND. (oDPre)->CAMERA == n ;
.AND. ( dData1 <= (oDPre)->AL .AND. dData2 >= (oDPre)->DAL )
lvalue:=.t.
endif
(oDPre)->(DbSkip())
ENDDO
return lvalue |
rango dates | Silvio,
this is the solution, I have shown You in Your other post.
But don't do DBGOTOP. Use DBSEEK, because there is a index and EXIT the loop after Number-change.
Look at Your other post !
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
rango dates | james,Otto,
I try to use your code and run ok but I'm afraid that not all cases have been closed
is OK for some case but not all cases, and I fear that the end user will have problems when he 'll use my application |
rango dates | Hello Silvio,
Please post some screen shots what you really want to reach and a test program with the current source.
Best regards,
Otto |
rango dates | Silvio,
[quote:shjrt4sr]I try to use your code and run ok but I'm afraid that not all cases have been closed
is OK for some case but not all cases[/quote:shjrt4sr]
We need an example of a case where it doesn't work.
James |
rango dates | Silvio,
Try this:
[code=fw:15mq8g3t]<div class="fw" id="{CB}" style="font-family: monospace;"> SET FILTER ...<br /> <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbGoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> lFree:=.t.<br /> <span style="color: #00C800;">if</span> ! <span style="color: #000000;">(</span>oDPre<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> lFree:= .f.<br /> <span style="color: #00C800;">endif</span><br /> <br /><span style="color: #00C800;">return</span> lFree</div>[/code:15mq8g3t]
About the general process of selecting an umbrella, what does the user do when the desired umbrella is not free? Do they have to keep guessing at new dates or new umbrellas? I would think it would be better to display the entire beach graphic for the specified range of dates, and show all the umbrella's statuses, free or available. Then the user can pick a free umbrella for the desired dates.
Another very useful feature would be to show all the dates that a certain umbrella is reserved, so the user could select an available date range.
I don't think it is very useful to just have the user check the desired date range for a particular umbrella. This will leave them to do a lot of trial and error guessing if the desired range and/or umbrella is not available.
Regards,
James |
rao - xbrowse with nMarqueeStyle 7 | Rao, using the mouse scrolling in a browse with nMarqueeStyle 7 (win7 bar)
the border of cursorof row move correct, but the color background no.
[img:3pobvk2t]http://i.imgur.com/O9oh7UA.png[/img:3pobvk2t]
[code=fw:3pobvk2t]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrwD <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"EMPL_DOC"</span> ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">OF</span> oDlgD ;<br /> <span style="color: #0000ff;">FONT</span> oFontD<br /><br /> ADD <span style="color: #0000ff;">TO</span> oBrwD <span style="color: #00C800;">DATA</span> EMPL_DOC->NOMBRE+CRLF+EMPL_DOC->DESCRIPCIO <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Nombre de archivo"</span>+FINL+<span style="color: #ff0000;">"Descripción"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">350</span><br /> ADD <span style="color: #0000ff;">TO</span> oBrwD <span style="color: #00C800;">DATA</span> EMPL_DOC->FECHA <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Fecha"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">070</span> <span style="color: #0000ff;">LEFT</span><br /><br /> WITH OBJECT oBrwD<br /> :<span style="color: #000000;">MyConfig</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">01</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bPaintText</span> := <span style="color: #000000;">{</span> |oCol, hDC, cText, aCoord| XColDrawText<span style="color: #000000;">(</span> oCol, hDC, cText, aCoord <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">lHScroll</span> := <span style="color: #00C800;">FALSE</span><br /> :<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">36</span><br /> :<span style="color: #000000;">nFreeze</span> := <span style="color: #000000;">2</span><br /> :<span style="color: #000000;">nDataLines</span> := <span style="color: #000000;">2.5</span><br /> :<span style="color: #000000;">nHeaderLines</span> := <span style="color: #000000;">2</span><br /> :<span style="color: #000000;">nMarqueeStyle</span> := <span style="color: #000000;">7</span><br /> :<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">{</span>|| IIf<span style="color: #000000;">(</span> !EMPL_DOC-><span style="color: #000000;">(</span> Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, DocuE_Visualizar<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bDropFiles</span> := <span style="color: #000000;">{</span>|nRow, nCol, aFiles| DocuE_DragDropFile<span style="color: #000000;">(</span> aFiles <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> END</div>[/code:3pobvk2t] |
rao - xbrowse with nMarqueeStyle 7 | If you are not using a very old version of FWH. it is not necessary to use oCol:bPaintText for display of Win7bars. It is enough if you specify the MarqueeStyle.
bPaintText was recommended before we included painting of win7bars within xbrowse.
Please try removing bPaintText and see if your version supports it. Also please let us know the version you are using. If you still experience any problem, please let us know. |
raro error con radio button | buenos días
comento mi problema ya que sin ningún cambio de código lo empezó a hacer
al clickear sobre el radio elegido, desaparece el texto
alguna idea del origen del problema?
el unico cambio fue que pasé de compilar con fwh612 a fwh1101
gracias de antemano
Pablo |
raro error con radio button | hola, mira se ayuda:
<!-- m --><a class="postlink" href="http://www.fivewin.com.br/forum/topic.asp?TOPIC_ID=18815">http://www.fivewin.com.br/forum/topic.a ... C_ID=18815</a><!-- m --> |
raro error con radio button | Gracias
ya logré solucionarlo con la informacion del post |
raro funcionamiento de la tecla escape | Hola,En el ejemplo que muestro mas abajo se define una ventana mdi child y dentro de ella incrustado una barra de botones, una barra outlook 2003, un splitter y un dialogo.El problema viene a al pulsar la tecla "ESC", esta hace que se evalue 2 veces el valid de la ventana mdi child.En el dialogo hay un get:[code:3vd3k5ch]@ 0, 0 Get oGet Var cVar Of oDlg Size 50, 12[/code:3vd3k5ch]
y comprobando el código fuente la clase tget he visto que comentando la llamada a ::oWnd:KeyChar() del método KeyChar se evita que se ejecute dos veces el valid:
[code:3vd3k5ch]METHOD KeyChar( nKey, nFlags ) CLASS TGet
...
if nKey == VK_ESCAPE // avoids a beep!
// ::oWnd:KeyChar( nKey, nFlags )
return 1
endif
...
[/code:3vd3k5ch]
Ya me imagino que no es la solución correcta, sobre todo porque si en el ejemplo se quita la línea del get, osea se deja la definición del dialogo sin nada dentro de él, sigue ejecutando 2 veces el valid de la ventana.
Ejemplo:
[code:3vd3k5ch]#include 'Fivewin.ch'
#include "Splitter.ch"
Procedure Main()
local oWndMain, oMenu
Define Window oWndMain Title "Ventana principal" Mdi
Set Message To "" Keyboard Clock Date Of oWndMain 2007
MENU oMenu 2007
MENUITEM '&Child' MESSAGE 'Ventana child' Action ps_Child( oWndMain )
ENDMENU
oWndMain:SetMenu( oMenu )
Activate Window oWndMain MAXIMIZED;
Valid msgnoyes('¿Abandonar el programa?', 'Salir')
return
*---------------------------------------------------------------------
static Procedure ps_Child( oWndMain )
local oWnd, oBar, oBtn1, oBtn2
Define Window oWnd MdiChild Title 'Ventana child' of oWndMain
Set Message To "" Of oWnd 2007
Define ButtonBar oBar Size 50, 45 Of oWnd 2007
Define Button oBtn1 Of oBar Prompt 'Otro' TOP
Define Button oBtn2 Of oBar Prompt 'Edit' TOP
Activate Window oWnd On Init ps_Init(oWnd, oBar) Valid .F.
return
*---------------------------------------------------------------------
static procedure ps_Init( oWnd, oBar )
local oDlg, oGet, cVar, oOutLook, aRect, oSplit
local nWidth, nHeight
Define Dialog oDlg Of oWnd TRANSPARENT STYLE nOR( WS_CHILD, WS_VISIBLE )
@ 0, 0 Get oGet Var cVar Of oDlg Size 50, 12
Define OutLook2003 oOutLook Of oWnd PROMPTS "Accesos"
oWnd:oLeft := NIL
aRect := oOutLook:aDialogs[ 1 ]:GetCliRect()
@ 0, aRect:nRight SPLITTER oSplit ;
VERTICAL _3DLOOK ;
PREVIOUS CONTROLS oOutLook ;
HINDS CONTROLS oDlg ;
SIZE 4, oWnd:nHeight - 70 PIXEL ;
OF oWnd
ACTIVATE DIALOG oDlg NoWait Valid oWnd:End()
oWnd:bResized := {|| oSplit:AdjClient(), oOutlook:refresh(.t.) }
oDlg:Move( 0, oSplit:nRight,,, .F. )
nWidth := oDlg:nWidth
nWidth += oOutLook:nWidth
nWidth += oSplit:nWidth
nHeight := oDlg:nHeight
nHeight += oBar:nHeight
nHeight += oWnd:oMsgBar:nHeight
oWnd:SetSize(nWidth, nHeight, .F.)
oWnd:bResized := {|| oSplit:AdjClient(), oDlg:SetSize( oWnd:nWidth - oOutLook:nWidth - oSplit:nWidth - 8, oSplit:nHeight - 1, .t. ),;
oDlg:refresh(.t.), oOutlook:refresh(.t.) }
oWnd:bValid := {|| ps_Salir()}
return
*---------------------------------------------------------------------
static function ps_Salir()
msginfo('1')
return .T.[/code:3vd3k5ch] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.