dbTalk Databases Forums  

Substituting break by

comp.databases.progress comp.databases.progress


Discuss Substituting break by in the comp.databases.progress forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
martin.doherty@gmail.com
 
Posts: n/a

Default Substituting break by - 01-24-2006 , 05:57 AM






for example I have this:

for each product where prod-name begins "a":
display prod-name pack skip.
end.

I wanted to put in a conditional "break by" using a string like so:

def var by-name as char init "break by prod-name".

for each product where prod-name begins "a" by-name:
display prod-name pack skip.
end.

this failed.

Then I tried it with a logical like so:

def var by-name as log init no.

for each product where prod-name begins "a"
if by-name = no then break by pack
else break by prod-name:
display prod-name pack skip.
end.

This also failed. Is there a way of doing this without using a .i file?

Thanks Martin


Reply With Quote
  #2  
Old   
Steve Foley
 
Posts: n/a

Default Re: Substituting break by - 01-24-2006 , 08:12 AM






Try this:

/* Using an if function rather than an if statement. */

for each product where prod-name begins "a"
break by if by-name = no then pack else prod-name:
display prod-name pack skip.
end.




<martin.doherty (AT) gmail (DOT) com> wrote

Quote:
for example I have this:

for each product where prod-name begins "a":
display prod-name pack skip.
end.

I wanted to put in a conditional "break by" using a string like so:

def var by-name as char init "break by prod-name".

for each product where prod-name begins "a" by-name:
display prod-name pack skip.
end.

this failed.

Then I tried it with a logical like so:

def var by-name as log init no.

for each product where prod-name begins "a"
if by-name = no then break by pack
else break by prod-name:
display prod-name pack skip.
end.

This also failed. Is there a way of doing this without using a .i file?

Thanks Martin




Reply With Quote
  #3  
Old   
martin.doherty@gmail.com
 
Posts: n/a

Default Re: Substituting break by - 01-24-2006 , 10:04 AM



Foley,

By God it works!

Thanks for that one,

Martin


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.