HELP needed with FILE Structure ... 
Author Message
 HELP needed with FILE Structure ...

Bhartha,

Convert the ascii file to a file which support key's and then use the
key's to find your components.

IMPORT       FILE,PRE(CSV),DRIVER('Basic','ALWAYSQUOTE=off'),NAME('DosSt.csv')
RECORD         RECORD
StockID1            STRING(10)
Location             STRING(10)
StockID2            STRING(10)
Descrption          STRING(40)
Price                   STRING(10)
                        END
                     END

EXPORT       FILE,PRE(EXP),DRIVER('Topspeed'),CREATE,NAME('DosSt.tps')
kStockID1        KEY(EXP:StockID1),DUP,OPT,NOCASE
kStockID2        KEY(EXP:StockID2),DUP,OPT,NOCASE
RECORD         RECORD
StockID1            STRING(10)
Location             STRING(10)
StockID2            STRING(10)
Descrption          STRING(40)
Price                   REAL
                        END
                     END

  CODE
  OPEN(IMPORT)
  IF ErrorCode() THEN HALT(0,'Import: (' & ErrorCode() & ') ' & Error()) .
  CREATE(EXPORT)
  OPEN(EXPORT)
  IF ErrorCode() THEN HALT(0,'Export: (' & ErrorCode() & ') ' & Error()) .
  SET(IMPORT)
  LOOP
     NEXT(IMPORT)
     IF ErrorCode() THEN BREAK .
     EXP:StockID1    = CSV:StockID1
     EXP:Location     = CSV:Location
     EXP:StockID2    = CSV:StockID2
     EXP:Descrption  = CSV:Descrption
     EXP:Price           = CSV:Price
     APPEND(EXPORT)
    IF ErrorCode() THEN STOP('Export: (' & ErrorCode() & ') ' & Error()) .
  END
  BUILD(EXPORT)
  IF ErrorCode() THEN STOP('Export: (' & ErrorCode() & ') ' & Error()) .

--
Best Regards,
Maarten
C5EEb - ABC
Certainly Clarion Developer



Tue, 25 Jun 2002 03:00:00 GMT  
 HELP needed with FILE Structure ...
I've dealt with subassemblies (..of subassemblies..) etc.

I won't go into the program logic here.

The first thing I would do would be to read all of the CSV data into a
multi-keyed clarion work file.

This will make it easier for you to view what you've got onscreen, do
any parsing or field modifications you want to do using simple
programming, and then farm out certain chunks of data to the 'real'
files that your program will use.

--end--



Thu, 27 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Clarion 3 .dat file structure help needed

2. Need file structure for clarion/dos 2.1

3. need exe files structure

4. need exe file structure

5. smalltalk loop structure question...need help : )

6. Need Help With Data Aquisition and Window Structure

7. View Structure - Need Help with confusion!

8. Need Help on Ada Structure Graph

9. Need HELP with STRUCTURES

10. Need help with program structure

11. help needed on tree structure

12. need help => STRUCTURE in F77

 

 
Powered by phpBB® Forum Software