dbTalk Databases Forums  

attributes based on text

comp.databases.pick comp.databases.pick


Discuss attributes based on text in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Frans
 
Posts: n/a

Default attributes based on text - 06-21-2005 , 04:01 PM






Hi,

I'm wondering how to do the following

I have a prog that reads in a textfile with definitions (likea print
layout) In this layout I have e.g. SO<ENTRY.DT>the ENTRY.DATE part
will be read into a var called e.g. layout.field

Now I have a table in another file callede.g. file.layout where a
record for the SO file has a line line:
EQU ENTRY.DT TO 10
I can of course include this into the program.

Is there a way to read this file 'on the fly' and then use something
like:

read SO.ITEM form file.so, so.id else so.item=''

VAR.TO.DISPLAY = ITEM.SO<LAYOUT.FIELD>

I found that I get errors as LAYOUT.FIELD contains the text ENTRY.DT
and not a equate. Bsically I'm looking into a way to 'translate' the
var LAYOUT.FIELD into a attr number.

Sorry if it does not make complete sence.... It is nearly midnight and
hot here inthe Netherlands :-)

Thanks,

Frans

Reply With Quote
  #2  
Old   
Ross Ferris
 
Posts: n/a

Default Re: attributes based on text - 06-21-2005 , 06:15 PM






Frans,

What you need is a multi-valued list of the field (dict?) names you
want to insert - if your equates are being built by a program, just
have it create a "real string" as well, so

ENTRY.LIST = ""
EQU ENTRY.NAME TO 1
ENTRY.LIST<1,ENTRY.NAME> = "ENTRY.NAME"

EQU ENTRY.TITLE TO 2
ENTRY.LIST<1,ENTRY.TITLE> = "ENTRY.TITLE"
......
......
EQU ENTRY.DT TO 10
ENTRY.LIST<1,ENTRY.DT> = "ENTRY.DT"
.....
.....
read SO.ITEM form file.so, so.id else so.item=''
* VAR.TO.DISPLAY = ITEM.SO<LAYOUT.FIELD>
LOCATE(LAYOUT.FIELD,ENTRY.LIST,1;POS) THEN
VAR.TO.DISPLAY = ITEM.SO<POS>
END ELSE
GOTO ERROR.HANDLER
END


HTH

Ross Ferris
Stamina Software
Visage - speaks YOUR language!


Reply With Quote
  #3  
Old   
Frans
 
Posts: n/a

Default attributes based on text - 06-22-2005 , 01:20 AM



Hi Ross,

Thank you! Indeed this looks like the solution!

Frans



On 21 Jun 2005 16:15:44 -0700, "Ross Ferris" <rossf (AT) stamina (DOT) com.au>
wrote:

Quote:
Frans,

What you need is a multi-valued list of the field (dict?) names you
want to insert - if your equates are being built by a program, just
have it create a "real string" as well, so

ENTRY.LIST = ""
EQU ENTRY.NAME TO 1
ENTRY.LIST<1,ENTRY.NAME> = "ENTRY.NAME"

EQU ENTRY.TITLE TO 2
ENTRY.LIST<1,ENTRY.TITLE> = "ENTRY.TITLE"
.....
.....
EQU ENTRY.DT TO 10
ENTRY.LIST<1,ENTRY.DT> = "ENTRY.DT"
....
....
read SO.ITEM form file.so, so.id else so.item=''
* VAR.TO.DISPLAY = ITEM.SO<LAYOUT.FIELD
LOCATE(LAYOUT.FIELD,ENTRY.LIST,1;POS) THEN
VAR.TO.DISPLAY = ITEM.SO<POS
END ELSE
GOTO ERROR.HANDLER
END


HTH

Ross Ferris
Stamina Software
Visage - speaks YOUR language!


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 - 2012, Jelsoft Enterprises Ltd.