Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Modulo function in progress 4gl

 
   Database Forums (Home) -> Progress RSS
Next:  May I install SQL 2000 64bit Ent into W2K 32bit E..  
Author Message
Claus

External


Since: Jun 28, 2007
Posts: 7



(Msg. 1) Posted: Mon Jul 16, 2007 10:58 am
Post subject: Modulo function in progress 4gl
Archived from groups: comp>databases>progress (more info?)

Hello,

Does anyone know where to find the code of the MODULO function used in
progress.


Thanks in advance. Claudiu.

 >> Stay informed about: Modulo function in progress 4gl 
Back to top
Login to vote
progcat

External


Since: Jul 31, 2007
Posts: 1



(Msg. 2) Posted: Tue Jul 31, 2007 4:02 pm
Post subject: Re: Modulo function in progress 4gl [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jul 16, 8:34 am, Claus wrote:
> Hello,
>
> Does anyone know where to find the code of the MODULO function used in
> progress.
>
> Thanks in advance. Claudiu.

I think this is what you want: Try this program: display 10 mod
3.

 >> Stay informed about: Modulo function in progress 4gl 
Back to top
Login to vote
google

External


Since: Aug 02, 2007
Posts: 1



(Msg. 3) Posted: Thu Aug 02, 2007 6:10 am
Post subject: Re: Modulo function in progress 4gl [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 2, 12:35 pm, Claus wrote:
> Actually is not what i wanted.
>
> The problem is to calculate the modulo of a integer number of 30
> digits long.

Hi Claudiu,

Not sure if you are looging at doing this in Progress and if so the
problem will be that it does not support integers of that size, what
you can do is use a decimal and create your own function.

def var aa as dec no-undo.

function fModulo returns dec
(longNum as dec, longNum2 as dec) forward.

aa = 123456789012345678901234567890.

message "ans --> " fModulo (aa,9996614.0).

function fModulo returns dec (longNum as dec, longNum2 as dec).

def var i as int.

if longNum < 2147483647 and
longNum2 < 2147483647 then
return dec(longNum modulo longNum2).

assign longNum = truncate(longNum,0)
longNum2 = truncate(longNum2,0).

return truncate(longNum - (longNum2 * truncate((longNum /
longNum2),0)),0).

end.
 >> Stay informed about: Modulo function in progress 4gl 
Back to top
Login to vote
Claus

External


Since: Jun 28, 2007
Posts: 7



(Msg. 4) Posted: Thu Aug 02, 2007 11:35 am
Post subject: Re: Modulo function in progress 4gl [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Actually is not what i wanted.

The problem is to calculate the modulo of a integer number of 30
digits long.
 >> Stay informed about: Modulo function in progress 4gl 
Back to top
Login to vote
Claus

External


Since: Jun 28, 2007
Posts: 7



(Msg. 5) Posted: Mon Aug 06, 2007 3:55 am
Post subject: Re: Modulo function in progress 4gl [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 2, 4:10 pm, goo... DeleteThis @devenv.com wrote:
> On Aug 2, 12:35 pm, Claus wrote:
>
> > Actually is not what i wanted.
>
> > The problem is to calculate the modulo of a integer number of 30
> > digits long.
>
> Hi Claudiu,
>
> Not sure if you are looging at doing this in Progress and if so the
> problem will be that it does not support integers of that size, what
> you can do is use a decimal and create your own function.
>
> def var aa as dec no-undo.
>
> function fModulo returns dec
> (longNum as dec, longNum2 as dec) forward.
>
> aa = 123456789012345678901234567890.
>
> message "ans --> " fModulo (aa,9996614.0).
>
> function fModulo returns dec (longNum as dec, longNum2 as dec).
>
> def var i as int.
>
> if longNum < 2147483647 and
> longNum2 < 2147483647 then
> return dec(longNum modulo longNum2).
>
> assign longNum = truncate(longNum,0)
> longNum2 = truncate(longNum2,0).
>
> return truncate(longNum - (longNum2 * truncate((longNum /
> longNum2),0)),0).
>
> end.

Thanks for this. It is what I wanted.
 >> Stay informed about: Modulo function in progress 4gl 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
PROGRESS/ QAD/ OH - OMNI GROUP tgugger@aimexec.com 419-250-1900 PROGRESS/ QAD/ IMMEDIATE/ OH ...

New to progress - Hi, I'm new to progress - how active is the group? Is there a mailing list? I've struggled to find online documentation or an FAQ - please could people point me in the direction of resources to get up to speed? Thanks, S.

Progress Database 9.1 SN -

PROGRESS is NOT SQL-92 compatible - Big error: select ac_code, SUM(case when acd_year < 2006 then acd_amt else 0.0000001 end) from ..... rounds to INTEGER, but when select ac_code, SUM(acd_amt) from ..... result is good. Any help from PROGRESS support Team ?? Adam

Progress & Syteline - I am hopeing somebody out there can help me with a question. I took over administration of a Progress Syteline database, and I need to know if anybody can tell me how to install the Merant ODBC Drivers and if they came anywhere on the Progress Syteline....
   Database Forums (Home) -> Progress All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]