Load Command Quirks in 4gl.
Posted in 1994
>
> Sample code:
> define file_name char(80)
> define foo char(160)
> let file_name = "a_file_name"
> load from file_name insert into a_table
> let foo = file_name, " TEST"
Try: let foo = file_name CLIPPED, " TEST"
> display foo
>
> results from displaying foo:
> a_file_name
>
> I am running 4gl version 4.10UC4 on SCO Unix 3.2
>
> the load command places a null character in the variable file_name after the
> last non-blank character. :-( Not a nice trick.
Not so. file_name is "a_file_name" + 69 spaces. " TEST" gets added on
starting at position 81 yielding 85 characters which is then truncated when
fed back into file_naem which is CHAR(80). (not perhaps an exactly factual
documentation of the way 4gl does the operation, but sufficient).
As mentioned above, use CLIPPED to lose the extra spaces.
As an added note:
let file_name = "a_file_name"
let abc = LENGTH(filed_name)
DISPLAY abc yields '11'
cheers
j.
_____________________________________________________________________________
Jack Parker - Hewlett Packard, BSMC Boise, Idaho, USA
jparker@hpbs3645.boi.hp.com
_____________________________________________________________________________
"Grant me the serenity to accept the things I cannot change, the courage
to change the things I can, and the wisdom to hide the bodies of the
people that I had to kill because they pissed me off."
_____________________________________________________________________________
Any opinions expressed herein are my own and not those of my employers.
_____________________________________________________________________________