× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello group,

I have a field named XCVAR1 in a database file with a size of 150 bytes defined with the DDS keyword VARLEN (no size specified).

I understand that this field initially has a length of zero.

Just setting the field XCVAR1 works;

XCVAR1 = 'false' ;

but there might be other values in this VARLEN defined field that I should leave intact (and at the same offset) when they were set by other programs.

When trying to set the field to a value like:

%subst(XCVAR1:1:5) = 'false';

the programs throws an error complaining about invalid field size.

If I first set the XCVAR1 field size like;

if %len(XCVAR1) < 5;
%len(XCVAR1) = 5;
endif;

all is well.

Should the compiler not just set the length of XCVAR1 to 5 when I assign the value 'false' if the XCVAR1 length is less then the value I want to set using the %subst function or can someone explain why not?


Kind regards,

Loek Maartens.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.