Question about PROCESS 4D TAGS 4d v13

Hi All,
Mac 10.13, 4D v13

Working with PROCESS 4D TAGS and testing it baffles me because,
I created a ‘template’ html document, that gets opened by 4D
which contains this code:

In a 4D method that runs this, aTxtHeaders array is filled with 7 text strings.

The template -monthly.html- get’s opened, filled and saved as a new file: Rob_321.html

$path_t:=Get 4D folder(Current Resources folder)+“monthly.html”
DOCUMENT TO BLOB($path_t;$template_x)

PROCESS 4D TAGS($template_x;$processed_x)

$path_t:=Get 4D folder(Database Folder)+“attachmentz”+Folder separator+“Rob_321.html”
BLOB TO DOCUMENT($path_t;$processed_x)

standard code to be found in the manual.

When I open the Rob_321.html file with BBEdit I see this result, which is correct

	 <table cellspacing="0" border="1" cellpadding="2"  bordercolor="#f0f0f0" width="100%">
	 	 <tr>
	 	  <th> Description</th>
		  <th> &#37;</th>
		  <th> Hours</th>
		  <th> Income</th>
		  <th> Misc</th>
		  <th> Year Totals</th>
		  <th> </th>
		 </tr>
	  </table>

So I copy that exact -same- code over to another 4D project, using the -same- array and same open file code.
Then when I open this Rob_321.html using BBEdit I see this:

            <table cellspacing="0" border="1" cellpadding="5"  bordercolor="#f0f0f0" width="100%">
	 	 <tr>
			 <th> <!--4DVAR aTxtHeaders{aTxtHeaders}--> </th>
			<th> <!--4DVAR aTxtHeaders{aTxtHeaders}--> </th>
			<th> <!--4DVAR aTxtHeaders{aTxtHeaders}--> </th>
			<th> <!--4DVAR aTxtHeaders{aTxtHeaders}--> </th>
			<th> <!--4DVAR aTxtHeaders{aTxtHeaders}--> </th>
			<th> <!--4DVAR aTxtHeaders{aTxtHeaders}--> </th>
			<th><!--4DVAR aTxtHeaders{aTxtHeaders}--></th>
		 </tr>

When I debug the code prior to PROCESS 4D TAGS, the array IS filled with data.
What am I missing ? or doing wrong ?
Both programs written by me are opened with the same version of 4D v13
Also opened the test-code and the final-code simultaneous with 2, 4D v13 programs and compared Preference settings.

ernie hilgers (aruba)

I don’t have a definitive answer to your question, but as a general observation:

Since v16 (which introduced new tags such as #4DEVAL and #4DCODE), 4D expects the pound sign (hash) on its HTML tags. It used to be an option to integrate well with Dreamweaver, but nowadays it is pretty much mandatory (at least for the newer generation of tags).

With v12.2, 4DVAR and 4DHTMLVAR were superseded by #4DTEXT and #4DHTML.

Notice they are referred to as “former” tags.

https://doc.4d.com/4Dv15/4D/15.6/Connection-Security.300-3817738.en.html

The main difference is that Char(1) to invoke direct HTML injection is no longer supported in #4DTEXT.

That said, my understanding is that 4DVAR ctilontinues to work until this day, but maybe that only applies to 4DB created before v12.

c.f.

https://download.4d.com/Documents/Products_Documentation/LastVersions/Line_12/VIntl/PDF_Format/4D_v12.1_Addendum.pdf

Compatibility note: The 4DVAR and 4DHTMLVAR tags are still supported in 4D v12.1 and work the same way as in previous versions. However, we recommend that you start using the new nomenclature and migrate the code of your applications as soon as possible.

If you are using that code in two different projects then there must be two copies of monthly.html, one in the Resources folder of Project1 and one in the Resources folder of Project2.

So is monthly.html different in the second project maybe?

Thank you for feedback !!
Using v13 on mac or pc I have found (empirical) that there is no difference using #4DVAR or 4DVAR.

Further, concerning the odd behavior: I have spend many hours to day to figure out what the cause was. Then I decided to just take a fresh copy of Project2, and copy over (again) the method of the html building code from Project1. Between the 2 projects only the name of 1 variable needed to change. This time I choose to manually copy and past all instances of that variable change, compared to “Find & Replace all”
Loo and behold now it works.
Looking at both the methods from Project2 of 6 hours earlier, I see no difference. But I will not complain. Now it works.
Thank you for your valuable feedback.

Hi Adam_Storck,

Thank you for your quick reaction.

Adam_Storck Partners
If you are using that code in two different projects then there must be two copies of monthly.html, one in the Resources folder of Project1 and one in the Resources folder of Project2.
correct, Project1 in it’s own “package” folder with it’s own Resources folder & Monthly.html
Project2 in it’s own folder with it’s own Resources folder & Monthly.html
the “monthly.html” file is copied from Project1 to Project2 and placed accordingly.

One only difference, (but to me makes no difference) is that in Project1 the method executed run in the main process (user environment)
Project2 the method runs in it’s own process. But all vars are defined.
During debug the “correct” path is observed.
Only the step PROCESS 4D TAGS is NOT processing the info as expected = read the array in a loop (may times done this before)
but it does loop the correct amount of times (7). Only it’s not the content of the array but a repeat of the 4d tag instruction. (?)

I even tried #4DVAR or 4DVAR of #4DTEXT or 4DTEXT. Makes no difference in project2 it does NOT fill the table with data, it just repeats the TAG instruction.
Ran both projects in Mac osX10.6.8, Mac 10.10.5, Mac 10.13.6, Mac 10.14.6 Windows7 4D v13 and v15 (in parallels)
Not that I have not tried to grasp what’s going on…

So after reading your email, I got fired up again and took a fresh (clean) copy of project2 and copied and pasted code from project1.
This time I did NOT use “replace all” but looked for each instance of that variable name that is different from project1
in project1 that one variable is called “Calz”
in project2 it’s called “Shprints”
So I did a manual “look for Calz and pasted” replaced it with Shprints.

Darn, now it works !!!
looking at Project2 from 6 hours earlier, NO visual difference !!!
Computers…

So is monthly.html different in the second project maybe?
exact copy. (copy the file from one folder and paste in another)

Conclusion:
Thank you so much for inquiring which fired me up again. Been spending quite some time today investigating this problem.

Have a great Friday and Weekend. Your feedback is much appreciated.

ernie hilgers (aruba)

Glad you got it working again Ernie. :+1: