FoxInCloud
Error: SCRIPTING.FILESYSTEMOBJECT
Gravatar is a globally recognized avatar based on your email address. Error: SCRIPTING.FILESYSTEMOBJECT
  Vincent H.
  All
  Apr 5, 2018 @ 09:07am

On the server (not in local mode) I get the new following error:

error # 1733 ("SCRIPTING.FILESYSTEMOBJECT class definition not found") My code is:

Fso = CREATEOBJECT ("Scripting.FileSystemObject")
Gravatar is a globally recognized avatar based on your email address. re: Error: SCRIPTING.FILESYSTEMOBJECT
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 5, 2018 @ 09:22am

this happens with COM/OLE classes; not sure whether it's a VFP or a Windows bug.

The workaround I've found it to instantiate an object of this OLE class at server startup, store it into a _screen.property or a public variable, and re-use this instance to avoid re-creating new instances over and over.

Gravatar is a globally recognized avatar based on your email address. re: Error: SCRIPTING.FILESYSTEMOBJECT
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 5, 2018 @ 09:41am

Thank you, I'm trying a public variable

Gravatar is a globally recognized avatar based on your email address. re: Error: SCRIPTING.FILESYSTEMOBJECT
  Vincent H.
  Vincent H.
  Apr 5, 2018 @ 09:59am

It's fine (with a public variable) !

Gravatar is a globally recognized avatar based on your email address. re: Error: SCRIPTING.FILESYSTEMOBJECT
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 9, 2018 @ 10:58am

I advise to create a function:

function oScriptingFSO as Scripting.FileSystemObject
local cType
cType = vartype(m.goScriptingFSO)
if m.cType == 'U'
  public goScriptingFSO
endif
if m.cType # 'O'
  goScriptingFSO = createObject('Scripting.FileSystemObject')
endif
return m.goScriptingFSO
endfunc

In your code:

local loScriptingFSO as Scripting.FileSystemObject
loScriptingFSO = oScriptingFSO()
loScriptingFSO.method()
…
Gravatar is a globally recognized avatar based on your email address. re: Error: SCRIPTING.FILESYSTEMOBJECT
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 9, 2018 @ 02:56pm

I advise to create a function:

Because you also use this statement, in the FIC code ?

Gravatar is a globally recognized avatar based on your email address. re: Error: SCRIPTING.FILESYSTEMOBJECT
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 10, 2018 @ 12:17am

just a programming hint; using a function:

  • isolates the code and the variable name; eg., if you prefer to have less public variables, you could store each reference to a COM object into a property of a public object:
function oScriptingFSO as Scripting.FileSystemObject
local cType
cType = vartype(m.goCOMs)
if m.cType == 'U'
  public goCOMs
endif
if m.cType # 'O'
  goCOMs = createObject('Empty')
endif
if !type('m.goCOMs.oScriptingFSO') == 'O'
  addProperty(m.goCOMs, 'oScriptingFSO', createObject('Scripting.FileSystemObject'))
endif
return m.goCOMs.oScriptingFSO
endfunc
  • instantiates 'Scripting.FileSystemObject' only when needed
  • reinstantiates 'Scripting.FileSystemObject' if aborted or killed
Gravatar is a globally recognized avatar based on your email address. re: Error: SCRIPTING.FILESYSTEMOBJECT
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 10, 2018 @ 02:43am

interesting, thank you Thierry

© 1996-2024