Passing File / Record Structures 
Author Message
 Passing File / Record Structures

Hi can anyone tell me how to pass a file / record stucture to a function and
be able to use the field names of the record in that function.

For example I have a JOB Items file and a Quote Items file and want to pass
either of these to the same function and be able to work with variable names
that are common in both files.

And or even alter the variables.

Regards
Andrew Burnett



Sat, 02 Jul 2005 20:40:03 GMT  
 Passing File / Record Structures
Hi Andrew,
Since in most cases the file/record structures are global in nature, you
should not have any problems accessing the record structures from within
your function.

--
Ben E. Brady
http://www.y2kbrady.com/diabetes/
Read the article... don't wait for the movie...


Quote:
> Hi can anyone tell me how to pass a file / record stucture to a function
and
> be able to use the field names of the record in that function.

> For example I have a JOB Items file and a Quote Items file and want to
pass
> either of these to the same function and be able to work with variable
names
> that are common in both files.

> And or even alter the variables.

> Regards
> Andrew Burnett




Sat, 02 Jul 2005 22:53:22 GMT  
 Passing File / Record Structures
But I want to be able to reference the different files using the same
variable name in the function.

For example QUI:Width or JOB:Width as for example OTH:Width



Quote:
> Hi Andrew,
> Since in most cases the file/record structures are global in nature, you
> should not have any problems accessing the record structures from within
> your function.

> --
> Ben E. Brady
> http://www.y2kbrady.com/diabetes/
> Read the article... don't wait for the movie...



> > Hi can anyone tell me how to pass a file / record stucture to a function
> and
> > be able to use the field names of the record in that function.

> > For example I have a JOB Items file and a Quote Items file and want to
> pass
> > either of these to the same function and be able to work with variable
> names
> > that are common in both files.

> > And or even alter the variables.

> > Regards
> > Andrew Burnett




Sun, 03 Jul 2005 06:05:27 GMT  
 Passing File / Record Structures
If you send record than WHO will give you cahance to detect which fields are
the ones you need...
Than WHAT will meke function's local variables capable to handle record
fileds...
All that is in the Help

Regards Slobodan


Quote:
> Hi can anyone tell me how to pass a file / record stucture to a function
and
> be able to use the field names of the record in that function.

> For example I have a JOB Items file and a Quote Items file and want to
pass
> either of these to the same function and be able to work with variable
names
> that are common in both files.

> And or even alter the variables.

> Regards
> Andrew Burnett




Sun, 03 Jul 2005 14:19:40 GMT  
 Passing File / Record Structures
!Qui:Record
!Field1
!Field2
!Field3
!End

1. Declare a group:
RecordGroupType   Like(Qui:Record),Type

MyFunction        Function(RecordGroupType  paramGroup)
.
.

    Code
    If paramGroup.Field1...

So You access the field by it's name, bat use a paramGroup as a parent
instead of  File.
It's wery usefool when you need to pass the file record between two Dll-s,
if You need to pass it inside one app, it,s beter to create global Class
vith virtual functions and use them vithout pasing the record...



Sun, 03 Jul 2005 16:21:26 GMT  
 Passing File / Record Structures
Hi there , I finks this code might help u out a little .....
CalculateWidth        FUNCTION (InRecord * CSTRING,RecType  BYTE)
DATA
LJBRECORD  LIKE(JOB:RECORD),PRE(LJB),OVER(InRecord)
LQURECORD  LIKE(QUO:RECORD),PRE(LQU),OVER(InRecord)
CODE

enjoy :)
HTH
Best Regards
Miguel



Sun, 03 Jul 2005 22:10:27 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Pass record structure with DDE -- repost

2. Passing Record structure using DDE

3. passing allocatable record structures

4. Checking record structure of a data file

5. Writing Record Structures to a File

6. Declare Function : passing a structure

7. Passing structures to and from C

8. Pass data between subVIS using Event structures.

9. Passing and reading a structure to dll funtion

10. passing structure to dll function

11. Pass DATA to next step in Sequence Structure

12. Passing complex structures between ADA and FORTRAN

 

 
Powered by phpBB® Forum Software