[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

http_url_encoder_addvar()



>Finally found it.  After adding +2  after the varable to be appended, I no
>longer see %09X.
>
>tst2     http_url_encoder_addvar( enc
>tst2                            : 'xml'
>tst2                            : %addr(xmlData)+2
>tst2                            : %len(%trim(xmlData)) )

Just wanted to point out that the best practice on %addr of data (that is what you are doing with +2) at V6 is to use %ADDR(fld : *DATA). This accounts for the possibility of using the large variable support that supports 4 byte lengths.

Since HTTPAPI is still compatible with lower OS levels, the examples will be +2 but we can avoid strange problems down the road if we get used to using *DATA in our new programs.

The second thing is that the %len of xmlData (assuming it is varying length) is just %len(xmlData) or if you are really paranoid of sending blanks %len(%trimr(xmlData)) but doing a %trim could potentially lead to interesting results. Consider this string:
"                            <xml><data=123></data></xml>"
If you trim both sides to find the length, your program will only send blanks (if I counted right).
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------