dbTalk Databases Forums  

Lookup a value

comp.databases.progress comp.databases.progress


Discuss Lookup a value in the comp.databases.progress forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
St?phane
 
Posts: n/a

Default Lookup a value - 02-19-2004 , 08:50 AM






I have a table with this kind of field:

ADD FIELD "MyField" OF "MyTable" AS character
FORMAT "x(10)"
INITIAL "P"
LABEL "MyLabel"
POSITION 25
SQL-WIDTH 20
VIEW-AS "VIEW-AS COMBO-BOX
LIST-ITEM-PAIRS ""Planned"", ""P"", ""Ordered"", ""O"", ""Filled"", ""F"",
""Complete"", ""C"", ""Distribute"", ""D"", ""History"", ""H"" "
LENGTH 0
ORDER 50

I have a loop on this table in a non-visual procedure:

for each MyTable no-lock:
put MyField "," .
end.

the result is something like:
P,O,F,C

but this result is wanted:
P,Planned,O,Ordered,D,Distribute

Is there somebody with a solution ?

Thank you, Stéphane.

Reply With Quote
  #2  
Old   
ranger
 
Posts: n/a

Default Re: Lookup a value - 02-19-2004 , 09:21 PM






the LIST-ITEMS is a visual or a widgets attribute
you can create one using a FORM statement
then use it to get the labels

here goes -



FORM
MyField
WITH FRAME MyFrame.

/* now you got the LIST-ITEMS attribute to get the labels from

this is just a dummy frame to create the widget */



FOR EACH MyTable:

PUT MyField ","
ENTRY(
LOOKUP(MyField, MyField:LIST-ITEMS IN FRAME MyFrame) - 1,
MyField:LIST-ITEMS IN FRAME MyFrame)
",".

/* the LOOKUP finds the value in the list

and the ENTRY picks up the label behind him */

END.



i haven't tried it out but in any case you get the idea
tell me if it works, HTH



stephane.delhautal (AT) libertysurf (DOT) fr (St?phane) wrote in message news:<f812f171.0402190650.54e1bb82 (AT) posting (DOT) google.com>...
Quote:
I have a table with this kind of field:

ADD FIELD "MyField" OF "MyTable" AS character
FORMAT "x(10)"
INITIAL "P"
LABEL "MyLabel"
POSITION 25
SQL-WIDTH 20
VIEW-AS "VIEW-AS COMBO-BOX
LIST-ITEM-PAIRS ""Planned"", ""P"", ""Ordered"", ""O"", ""Filled"", ""F"",
""Complete"", ""C"", ""Distribute"", ""D"", ""History"", ""H"" "
LENGTH 0
ORDER 50

I have a loop on this table in a non-visual procedure:

for each MyTable no-lock:
put MyField "," .
end.

the result is something like:
P,O,F,C

but this result is wanted:
P,Planned,O,Ordered,D,Distribute

Is there somebody with a solution ?

Thank you, Stéphane.

Reply With Quote
  #3  
Old   
St?phane
 
Posts: n/a

Default Re: Lookup a value - 02-20-2004 , 01:36 AM



Thank you for your answer. But i specified that i wrote a NON-VISUAL procedure !

ranger101 (AT) hotmail (DOT) co.il (ranger) wrote in message news:<d6cdf6f8.0402191921.33f3d571 (AT) posting (DOT) google.com>...
Quote:
the LIST-ITEMS is a visual or a widgets attribute
you can create one using a FORM statement
then use it to get the labels


I have a loop on this table in a non-visual procedure:


Reply With Quote
  #4  
Old   
ranger
 
Posts: n/a

Default Re: Lookup a value - 02-20-2004 , 08:16 AM



dear dear stephane what will i do with you



Quote:
Thank you for your answer. But i specified that i wrote a NON-VISUAL procedure
and i explained slowly and simple enough so you could understand

that it's completely fictitous it is just for reference

Quote:
this is just a dummy frame to create the widget */
meaing it won't show up but it will still be there

even if you're running in batch mode or closing your eyes



again you need this attribute to get the labels from

it's a visual attribute and the simplest way is to create one

but fictitously meaning it won't really show up it's just for reference



now be a good girl and go try it

god it's like teaching grandma to use the vcr

i give up with all those gapping idiots, good bye for now



stephane.delhautal (AT) libertysurf (DOT) fr (St?phane) wrote in message news:<f812f171.0402192336.7aa4d5c6 (AT) posting (DOT) google.com>...
Quote:
ranger101 (AT) hotmail (DOT) co.il (ranger) wrote in message news:<d6cdf6f8.0402191921.33f3d571 (AT) posting (DOT) google.com>...
the LIST-ITEMS is a visual or a widgets attribute
you can create one using a FORM statement
then use it to get the labels


I have a loop on this table in a non-visual procedure:


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.