Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in nfJsonCreate in distributable but was working fine in development environment 1

Status
Not open for further replies.

Sng1

Programmer
Aug 3, 2021
65
IN
In development environment, every thing is working fine while in runtime environment nfJsonCreate is creating error. Which setting am I missing in runtime which is creating proble. Below is the code where problem Variable ' ' is not found.
Code:
if m.bidim
		xtabs = nivel(2)
		este = m.este+'['+m.xtabs
	endif

	for pn = m.nelem to m.nelem+m.ncols-1

		elem = m.obt.&arrayName( m.pn )

		este = m.este+iif(m.pn>m.nelem,','+m.xtabs,'')

		if vartype(m.elem) # 'O'

			if m.nelem+m.ncols-1 = 1 and isnull(m.elem) and m.nonullarrayitem

				este = m.este+""

			else
				este = m.este+concatval(m.elem)

			endif

		else

			[highlight #FCE94F]bc = iif(type('m.elem.baseclass')='C',m.elem.baseclass,'?')

			if bc = 'Collection'

				este = m.este+' { "collection'+ collTagName( m.elem )+'":'

   				este =  m.este+procobject(m.elem ,.t.,m.nonullarrayitem,m.amembersFlag)

				este = m.este + '}'+m.xTabs+'}'

			else

   				este =  m.este+[{]+procobject(m.elem ,.f.,m.nonullarrayitem,m.amembersFlag)+[}]

			endif[/highlight]


		endif

	endfor
 
i've had issues in the past with both nfjsonread and nfjsoncreate because they don't use m.dot.

in the runtime environment might you have an imported excel sheet with field names a,b,c,d,e,etc ?

either select 0 before calling nfjsoncreate or change that bc to m.bc .

hth

n
 
You don't provide much information, but Nigel's advice ( though he seems to be referring to a very outdated release )
can be the first thing to try.

If your problem persists or you find another bug, please go to project page and open a issue there:


This goes for all the open source tools we get from github...! -Github and Stack Overflow are the current
tools for open source development, so posting there contributes to improve the VFP usage metrics shown in
language rankings like Tiobe ( ) VFP can ( an deserves to ) be higher,
but only the users activity online can achieve that.

If you don't have a github account sign up and start following, starring and cloning all the VFP projects you like!

Soon I'll release new improved versions for nfJson and nfXml that will be available on my github/nftools project,
so please go there and follow the project to get notifications for releases and updates.

-while you wait check this little tool to customize VFP colors on real time:


ezgif-2-1e67987156_xbev1k.gif


















Marco Plaza
@nfoxProject
 
Marco said:
f your problem persists or you find another bug, please go to project page and open a issue there
I have also raised issue there. Cause of problem is VFP9r.dll and VFP9RENU.Dll . As I run in exe , these dll comes in picture and cause problem. If VFP9r.dll and VFP9RENU.Dll are removed from folder in which exe is placed, then everything works fine. As soon as I put them in folder in which exe is placed , it creates problem. I have attached table and program which creates Json.
 
After revision, no problem was found on nfJson;
Check
"The dll versions you are shipping ( vfp9r.dll + vfp9renu.dll 9.0.0.2412 ) are for sure older than the vfp9.exe you used to compile your exe. Just make sure your dlls and vfp9.exe versions match. Using the latest ones I attached on zip ( vfp9r.dll 9.0.0.74.23 + vfp9renu.dll 9.0.0.5815 ) it all runs fine."



Marco Plaza
@nfoxProject
 
Sng1,

indeed it's very important to use the exact runtime version, same version number as the SP or Hotfix you used build. That was the essential information you should have provided earlier.

Notice, a VFP9r.dll can even run a VFP8 compiled fxp or app, as those files contain the VFP equivalent of Java bytecode, opcodes that stand for the VFP language commands/functions. The runtimes are just an interpreter for these.

But once you build an EXE, it will include the runtime major version necessary to use. Unfortunately that's not including the minor and less so buildnumber and revision number. Nevertheless some things get out of whack when not being extremely strict here.

If you apply hotfixes to your development PC it comes with instructions where to put which files, including to replace the vfp9r.dll etc. in C:\Program Files (x86)\Common Files\Microsoft Shared\VFP
If you followed the instructions you find the correct version there, too. If you just copied the new vfp9.exe into Home(), then you caused your own trouble.

If you use some of the available runtime installers, they come for every VFP service pack and hotfix version, and this differentiation is made for a good reason.

On m PC the vfp9r.dll in C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\ is file version 9.0.0.7423, product version 9.0.00.7423, when I do ? VERSION(4) I get 09.00.0000.7423. That can differ, if you only have the original VFP9 version without SP, SP1, SP2 or another Hotfix level.

All the different versions are listed at
Please ensure that all things are same version.


Chriss
 
Grateful Marco... It worked. Thanks a lot for wonderful product and your valuable help. I could have never thought that was the probable mistake.

Chris said:
Please ensure that all things are same version
Will do that and ensure that every dll I am using is in sync with VFP9 version.

 
Sorry for getting a bit mad on your behalf. It was annoying me even though I'm not you. Same for commenting about missing mdot usage after a post of the code plastered with mdot usage.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top