Normal Topic Export/Import Spec element order (Read 882 times)
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Export/Import Spec element order
Sep 20th, 2017 at 1:59am
Print Post Print Post  
Over time, many different Export/Import specs have been created.  But it is now impossible to manually find and drag elements to the desired sequence.  I am working with 428 exportable elements in a file.  Is there a way to reset the listing of the elements to match the natural flow of the form?  How about a way to make the Import sequence match the Export sequence?  This is a mandatory need when using these functions to copy records (especially with subforms and with a few element exceptions).
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Export/Import Spec element order
Reply #1 - Sep 20th, 2017 at 6:27pm
Print Post Print Post  
Hello,

If you open the form without a default import/export spec loaded, the order listed matches the form's navigation order.

You can use a bit of code in a single record mass update that will create an Import that matches your currently loaded export spec.

Code
Select All
#Include "sbasic_include.sbas"

Var vExportSpec as String
Var vOut as String
Var vEntry as String

vOut = @SpecCommand(SPEC_OPERATION_CLEAR, SPEC_TYPE_IMPORT, "")
vExportSpec = @SpecCommand(SPEC_OPERATION_VIEW, SPEC_TYPE_EXPORT, "")
vExportSpec = @Replace(vExportSpec, "=Open0", "=1")

While vExportSpec <> ""
{
	vEntry = Split(vExportSpec, ";")
	vOut = @SpecCommand(SPEC_OPERATION_SET, SPEC_TYPE_IMPORT, vEntry)
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Export/Import Spec element order
Reply #2 - Sep 22nd, 2017 at 5:34pm
Print Post Print Post  
Ray,

That's a very handy bit of code. Nice work!!!

This is going into my SBasic Code Library app. Smiley

Carl
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged