This is method I used in older version of 4D, not sure if it will work in
4D 2003 but it should:

  // ==========================
//exporting procedure for structure

C_TIME($refNum)
C_STRING(3;$cr;$tb)
C_STRING(31;$s)
C_LONGINT($table;$field;$len;$type;$ot;$of;$cf)
C_BOOLEAN($invisible;$trig1;$trig2;$trig3;$trig4;$ind;$uni;$inv;$ao;$am)

$cr:=Char(Carriage return)
$tb:=Char(Tab)

$refNum:=Create document("";"TEXT")
If (OK=1)
For ($table;1;Get last table number)
  //export table info
SEND PACKET($refNum;Table name($table)+$tb)

GET TABLE PROPERTIES($table;$inv;$trig1;$trig2;$trig3;$trig4)
If ($inv)
SEND PACKET($refNum;"I"+$tb)
End if
If ($trig1)
SEND PACKET($refNum;"N")
End if
If ($trig2)
SEND PACKET($refNum;"S")
End if
If ($trig3)
SEND PACKET($refNum;"D")
End if
If ($trig4)
SEND PACKET($refNum;"L")
End if


SEND PACKET($refNum;$cr+$cr)

For ($field;1;Get last field number($table))
SEND PACKET($refNum;Field name($table;$field)+$tb)
GET FIELD PROPERTIES($table;$field;$type;$len;$ind;$uni;$inv)
Case of
: ($type=Is Alpha Field)
$s:="S"+String($len)
: ($type=Is Real)
$s:="R"
: ($type=Is Text)
$s:="T"
: ($type=Is Picture)
$s:="P"
: ($type=Is LongInt)
$s:="L"
: ($type=Is BLOB)
$s:="O"
: ($type=Is Boolean)
$s:="B"
: ($type=Is Date)
$s:="D"
: ($type=Is Time)
$s:="T"
: ($type=Is Subtable)
$s:="X"

End case
SEND PACKET($refNum;$s+$tb)

If ($ind)
SEND PACKET($refNum;"I")
End if
If ($uni)
SEND PACKET($refNum;"U")
End if
If ($inv)
SEND PACKET($refNum;"N")
End if

SEND PACKET($refNum;$tb)


GET RELATION PROPERTIES($table;$field;$ot;$of;$cf;$ao;$am)

If ($ot#0)
SEND PACKET($refNum;"->")
SEND PACKET($refNum;Field name($ot;$of)+$tb)

If ($ao)
SEND PACKET($refNum;"O")
End if
If ($am)
SEND PACKET($refNum;"M")
End if


End if

SEND PACKET($refNum;$cr)

End for
SEND PACKET($refNum;$cr+$cr)

End for
CLOSE DOCUMENT($refNum)
End if

// ==========================

Regards,

Peter Bozek

On Wed, Sep 4, 2019 at 2:20 PM Narinder Chandi via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Tony,
>
> Are you able to open the structure with a later version of 4D? In v14 the
> EXPORT STRUCTURE command was introduced:
> https://doc.4d.com/4Dv17/4D/17.2/EXPORT-STRUCTURE.301-4386049.en.html
> which would get you the quickest representation of your structure, albeit
> in XML.
>
> Otherwise it should only take a few minutes to crank out a custom method
> to produce an text output representation of your structure using the
> structure access commands:
> https://doc.4d.com/4Dv17/4D/17.2/Structure-Access.201-4385958.en.html
>
> Unfortunately I don't have such method to hand though.
>
> Regards,
>
> Narinder Chandi,
> ToolBox Systems Ltd.
> --
>
> -----Original Message-----
> From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of 4D Tech Mailing
> List <4d_tech@lists.4d.com>
> Reply-To: 4D Tech Mailing List <4d_tech@lists.4d.com>
> Date: Wednesday, 4 September 2019 at 13:04
> To: 4D Tech Mailing List <4d_tech@lists.4d.com>
> Cc: "Wright, Tony" <tony.wri...@nhslothian.scot.nhs.uk>
> Subject: 4D 2003  export structure
>
>     Hi
>
>     Does anyone have a method I can use to create a text file
>     With information of each table and info about each attubute
>
>     i.e.
>
>     Table name = patients
>     Fields
>         Surname Alpha 30
>         Forename alpha 30
>         DOB = Date
>
>         Etc etc
>
>     This DB was using 4D 2003 in its days
>
>     Many thanks
>
>     Tony
>
>
>
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to