fgl_copyblob()

fgl_copyblob() performs a value copy of one blob to another:

fgl_copyblob(destination, source)

In 4GL, all blob assignments are performed by reference which means that it is not possible to copy the contents of one blob to another. For example

LOCATE x IN FILE ‘a.txt’

LOCATE y IN FILE ‘b.txt’

LET b = a

In this example, the variable y becomes a reference to the file a.txt as a result of the assignment operation. To be able to copy the contents of ‘x’ into ‘y’, we can use the function fgl_copyblob():

LOCATE x IN FILE ‘a.txt’

LOCATE y IN FILE ‘b.txt’

CALL  fgl_copyblob(y, x)

FREE x

FREE y

The function takes two arguments, both of which must be of type BYTE or TEXT. The first argument specifies the destination for the copy operation, and the second specifies the source of the copy operation.

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.