For Programmers: Free Programming Magazines  


Home > Archive > Clipper > March 2005 > xharbour









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author xharbour
Sandy Ferguson

2004-08-27, 8:55 am

I have been playing with xharbour & have problems I can't seem to solve
with a read of the manual.
I have a clipper programme that compiles but the resultant app. doesn't
fit on my screen. Have to scroll up & down to read a full screen. By
using the Xprompt I found that maxrow() & maxcol() are both 119. Why.
Also I thought the mouse didn't work but have now found that if I left
click & then double right click it works. Why.
Possibly I will eventually work these things out but any help from
someone who is way ahead of me would be appreciated.
Sandy Ferguson
Eduardo Fernandes

2004-08-27, 3:55 pm


"Sandy Ferguson" <sferg@ozemail.com.au> escreveu na mensagem
news:y7EXc.53$lE.4543@nnrp1.ozemail.com.au...
> I have been playing with xharbour & have problems I can't seem to solve
> with a read of the manual.
> I have a clipper programme that compiles but the resultant app. doesn't
> fit on my screen. Have to scroll up & down to read a full screen. By
> using the Xprompt I found that maxrow() & maxcol() are both 119. Why.
> Also I thought the mouse didn't work but have now found that if I left
> click & then double right click it works. Why.
> Possibly I will eventually work these things out but any help from
> someone who is way ahead of me would be appreciated.
> Sandy Ferguson


Sandy,

Post this thread at news://news.xharbour.org/xHarbour

Regards,
Eduardo

Ron Pinkas

2004-08-27, 3:55 pm

> I have a clipper programme that compiles but the resultant app. doesn't
> fit on my screen. Have to scroll up & down to read a full screen.


Because this is the Screen Size specified in your O/S settings. You can
change that by:

1. Right Click the caption of th econsole window,
2. Click "Properties"
3. Click the "Layout" tab.
4. Reduce the "HEight" edit box in the "Screen Buffer Size" section.
5. Click the "Ok" button.

> using the Xprompt I found that maxrow() & maxcol() are both 119. Why.


See above.

> Also I thought the mouse didn't work but have now found that if I left
> click & then double right click it works. Why.


Please post the question to news://news.xHarbour.org/xHarbour

> Possibly I will eventually work these things out but any help from
> someone who is way ahead of me would be appreciated.


Welcome to xHarbour, I believe you'll find all you need at
http://www.xHarbour.org or http://www.xHarbour.com

Ron


Claudio Voskian

2005-03-21, 3:55 pm

Hi Paul

"Paul" <k__computer@home.nl> escribió en el mensaje
news:d1mj3v$bkl$1@news2.zwoll1.ov.home.nl...
| Hi there,
|
| i'm trying to convert an older application to xharbour. i am using a
toolkit
| function LASTDAYOM() to calculate the last day of a given month. this
| function is not available in xharbour, since it generates a link error. is
| there a workaround? or update? or another solution to handle this.
| tia
| paul.
|
|

Try this (pure clipper code):

*
function ultdiames(fecha) // = lastdayofm(date or char)
*---------------
local mm := 1, aa
if valtype(fecha) = 'D'
mm += month(fecha)
aa := year(fecha)
else
mm += val(substr(fecha,5,2)) // asume formato aaaammdd
aa := val(left(fecha,4))
endif

if mm > 12
mm := 1
aa++
endif

return ctod("01/"+ strzero(mm,2) +"/"+ strzero(aa,4)) - 1

HTH
--
Saluten
Claudio
Buenos Aires - Argentina
--
"Argentina crece gracias a que sus políticos y gobernantes dejan de robar
mientras duermen..."


Pavel Tsarenko

2005-03-22, 8:55 am

Paul

P> i'm trying to convert an older application to xharbour. i am using a
P> toolkit function LASTDAYOM() to calculate the last day of a given
P> month. this function is not available in xharbour, since it
P> generates a link error. is there a workaround? or update? or another
P> solution to handle this.
P> tia paul.

Add CT.LIB to your linker script.

Best regards, Pavel Tsarenko


Johan Nel

2005-03-22, 8:55 am

Paul,

This is quite an easy function to implement. Here is one that is using pure
Clipper and date manipulation to do it:

Function Bom(dDate)
default dDate to Date()
return( dDate - Day(dDate) + 1 )

function Eom(dDate)
local dTDate
default dDate to Date()
dTDate := dDate + 35
return( Bom((dDate + 35) - Day(dDate)) - 1 )

HTH

--
Johan Nel
Pretoria, South Africa.
"Paul" <k__computer@home.nl> wrote in message
news:d1mj3v$bkl$1@news2.zwoll1.ov.home.nl...
> Hi there,
>
> i'm trying to convert an older application to xharbour. i am using a

toolkit
> function LASTDAYOM() to calculate the last day of a given month. this
> function is not available in xharbour, since it generates a link error. is
> there a workaround? or update? or another solution to handle this.
> tia
> paul.
>
>



Ross McKenzie

2005-03-22, 3:55 pm

On Tue, 22 Mar 2005 12:01:48 +0200, "Johan Nel"
<johan.nel555@removeall5s.xsinet.co.za> wrote:

>Paul,
>
>This is quite an easy function to implement. Here is one that is using pure
>Clipper and date manipulation to do it:
>
>Function Bom(dDate)
>default dDate to Date()
>return( dDate - Day(dDate) + 1 )
>
>function Eom(dDate)
>local dTDate
>default dDate to Date()
>dTDate := dDate + 35
>return( Bom((dDate + 35) - Day(dDate)) - 1 )
>
>HTH
>
>--
>Johan Nel
>Pretoria, South Africa.


Hi Johan,

I think you have been out in the sun too long....where does dTDate get
used <g>?


Regards,

Ross McKenzie
ValuSoft
Melbourne Australia

valusoft AT optushome DOT com DOT au

I love deadlines...I particularly enjoy the whooshing noise they make as they fly by.
Johan Nel

2005-03-22, 3:55 pm

Hi Ross,

> I think you have been out in the sun too long....where does dTDate get
> used <g>?


Maybe not too much sun, but a lack of it while at DevFest in London<VBG>.

Realised now that it is not used and can remember from LOOOONNNNNGGGG ago
that I was busy changing the function to ignore the dTDate....

Ok, here is an even shorter function without obsolete code....

function Eom(dDate)
default dDate to Date()
return( Bom((dDate + 35) - Day(dDate)) - 1 )

Regards,
Johan
PS: Ross, looks like Andre will be here this wend to pick up the final
batch of books. Will keep you informed of the progress. Maybe you can
tentatively speak to Neil about his availability next w to pick it up in
Windhoek?

"Ross McKenzie" <NoJunk_valusoft@optushome.com.au> wrote in message
news:4240196e.34912718@news...
> On Tue, 22 Mar 2005 12:01:48 +0200, "Johan Nel"
> <johan.nel555@removeall5s.xsinet.co.za> wrote:
>
pure[color=darkred]
>
> Hi Johan,
>
>
>
> Regards,
>
> Ross McKenzie
> ValuSoft
> Melbourne Australia
>
> valusoft AT optushome DOT com DOT au
>
> I love deadlines...I particularly enjoy the whooshing noise they make as

they fly by.


Ray Marron

2005-03-22, 3:55 pm

"Claudio Voskian" <mixxell@hotmail.com> wrote in message
news:3a89g7F6a3lpqU1@individual.net...
> Ray

[...]
> But in your case, you would need a function (ie STOD) that is not part of
> clipper libs.


Doesn't everybody have a date-format-independent version of that function in
their in-house libs by now? :)

If anybody doesn't here's the source to mine:

Function StoD(cDTOS)
/*
The functional inverse of dtos().
*/
local dNew
local cDF := set(_SET_DATEFORMAT, "YYYY/MM/DD")

dNew := ctod(transform(cDTOS, "@R 9999/99/99"))

set(_SET_DATEFORMAT, cDF)

Return(dNew)

--
Ray Marron


Johan Nel

2005-03-22, 3:55 pm

Ray,

Here is mine :)

function Stod(cDate)
local cFormat := Upper(Set(_SET_DATEFORMAT))
local nLen, cYr, cMnth, cDay
default cDate to Dtos(Date())
nLen := Len(cDate := Trim(Left(cDate, 8)))
cDate := cDate + Right('01000101', 8 - nLen)
cYr := Left(cDate, 4)
cMnth := Substr(cDate, 5, 2)
cDay := Right(cDate, 2)
cFormat := StrTran(cFormat, Replicate('Y', Len(cFormat) -
Len(StrTran(cFormat, 'Y'))), 'Y')
cFormat := StrTran(cFormat, Replicate('M', Len(cFormat) -
Len(StrTran(cFormat, 'M'))), 'M')
cFormat := StrTran(cFormat, Replicate('D', Len(cFormat) -
Len(StrTran(cFormat, 'D'))), 'D')

return(Ctod(StrTran(StrTran(StrTran(cFor
mat, 'D', cDay), 'M', cMnth), 'Y',
cYr)))


--
Johan Nel
Pretoria, South Africa.
"Ray Marron" <me@privacy.net> wrote in message
news:3aap4kF69p11nU1@individual.net...
> "Claudio Voskian" <mixxell@hotmail.com> wrote in message
> news:3a89g7F6a3lpqU1@individual.net...
> [...]
of[color=darkred]
>
> Doesn't everybody have a date-format-independent version of that function

in
> their in-house libs by now? :)
>
> If anybody doesn't here's the source to mine:
>
> Function StoD(cDTOS)
> /*
> The functional inverse of dtos().
> */
> local dNew
> local cDF := set(_SET_DATEFORMAT, "YYYY/MM/DD")
>
> dNew := ctod(transform(cDTOS, "@R 9999/99/99"))
>
> set(_SET_DATEFORMAT, cDF)
>
> Return(dNew)
>
> --
> Ray Marron
>
>



Claudio Voskian

2005-03-22, 3:55 pm

Ray

"Ray Marron" <me@privacy.net> escribió en el mensaje
news:3aap4kF69p11nU1@individual.net...
| "Claudio Voskian" <mixxell@hotmail.com> wrote in message
| news:3a89g7F6a3lpqU1@individual.net...
| > Ray
| [...]
| > But in your case, you would need a function (ie STOD) that is not part
of
| > clipper libs.
|
| Doesn't everybody have a date-format-independent version of that function
in
| their in-house libs by now? :)
|
| If anybody doesn't here's the source to mine:
|
| Function StoD(cDTOS)
| /*
| The functional inverse of dtos().
| */
| local dNew
| local cDF := set(_SET_DATEFORMAT, "YYYY/MM/DD")
|
| dNew := ctod(transform(cDTOS, "@R 9999/99/99"))
|
| set(_SET_DATEFORMAT, cDF)
|
| Return(dNew)
|
| --
| Ray Marron
|
|

Thank you for your input.
I have my own that works ok, but is written in .asm o .c, just don't
remember when and how (but I remember I was who wrote that years ago).
It is not portable 'as is' to xh, as the one listed do.

Maybe I will switch my old version to plain clipper in this way.

TIA!
--
Saluten
Claudio
Buenos Aires - Argentina
--
"Argentina crece gracias a que sus políticos y gobernantes dejan de robar
mientras duermen..."


Claudio Voskian

2005-03-24, 8:55 pm

Hi Paul

"Paul" <k__computer@home.nl> escribió en el mensaje
news:d1mj3v$bkl$1@news2.zwoll1.ov.home.nl...
| Hi there,
|
| i'm trying to convert an older application to xharbour. i am using a
toolkit
| function LASTDAYOM() to calculate the last day of a given month. this
| function is not available in xharbour, since it generates a link error. is
| there a workaround? or update? or another solution to handle this.
| tia
| paul.
|
|

Try this (pure clipper code):

*
function ultdiames(fecha) // = lastdayofm(date or char)
*---------------
local mm := 1, aa
if valtype(fecha) = 'D'
mm += month(fecha)
aa := year(fecha)
else
mm += val(substr(fecha,5,2)) // asume formato aaaammdd
aa := val(left(fecha,4))
endif

if mm > 12
mm := 1
aa++
endif

return ctod("01/"+ strzero(mm,2) +"/"+ strzero(aa,4)) - 1

HTH
--
Saluten
Claudio
Buenos Aires - Argentina
--
"Argentina crece gracias a que sus políticos y gobernantes dejan de robar
mientras duermen..."


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com