KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: 4DSCRIPT & the 32K Limit
PRODUCT: 4D | VERSION: 6.7 | PLATFORM: Mac & Win
Published On: December 7, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

4DSCRIPT is a great mechanism for executing 4D methods and at the same time inserting HTML into the page that you are building. The contents of the $0 variable of the 4D method used with 4DSCRIPT are inserted into the HTML page by 4D. But what if you need to return more than 32K - for instance, if you have a BLOB with a lot of data in it?

In 4D, the value in $0 of a method can never exceed 32K - not in a "standard" 4D Method, and not in one called via the Web. To do this, you will need a 4DSCRIPT and a 4DHTMLVAR. For example:

<!--#4DSCRIPT/Web_GetHTML/xMyBlob--> : The method does not exist.
<!--#4DHTMLVAR xMyBlob--> : Undefined

In the "Web_GetHTML" Method, you will want to get a pointer to the data passed in $1 (in this case, xMyBlob). Check to see that the pointer is valid, and if so, fill the BLOB with whatever data you want to display. Then, display the data on the Web page using 4DHTMLVAR.