home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / bazy / fiasco_2.1 / arexx / dbstructure.frx < prev    next >
Text File  |  1997-10-06  |  2KB  |  136 lines

  1. /* dbstructure.frx
  2.  * Display structure of Fiasco database
  3.  * Copyright © 1997 Nils Bandener
  4.  * $VER: dbstructure_frx 6.2 (6.10.97)
  5.  */
  6.  
  7. scriptname = "DBStructure"
  8.  
  9. Options Results
  10.  
  11. /*
  12.  *  If not called from Fiasco, try to address the active
  13.  *  Fiasco project
  14.  */
  15.  
  16. if ~abbrev(address(), "FIASCO.") then
  17. do
  18.     ports = show("Ports")
  19.  
  20.     do i = 1 to words(ports)
  21.  
  22.         if abbrev(word(ports, i), "FIASCO.") then
  23.         do
  24.             Address Value word(ports, i)
  25.  
  26.             GetAttr Project Name Active ARexx
  27.  
  28.             Address Value Result
  29.  
  30.             break
  31.         end
  32.     end
  33. end
  34.  
  35. fiasco_port = address()
  36.  
  37. Signal on Syntax
  38. Signal on Halt
  39. Signal on Break_C
  40. Signal on Failure
  41.  
  42. LockGUI
  43.  
  44. GetAttr 'Fields Stem fl'
  45.  
  46. do i = 1 to fl.count
  47.  
  48.     GetAttr 'Field Name "' || fl.i || '" Stem fd'
  49.  
  50.     say 'Field ID: "' || fl.i || '"'
  51.  
  52.     if fd.listview ~= 0 then
  53.     do
  54.         say 'Type: ' || fd.type || ' Listview'
  55.     end
  56.     else
  57.     do
  58.         say 'Type: ' || fd.type
  59.     end
  60.  
  61.     say 'Formula: ' || fd.formula
  62.  
  63.     say 'ARexx Script: ' || fd.arexxscript
  64.  
  65.     say 'InitCont Type: ' || fd.initconttype
  66.  
  67.     say 'InitCont Value: ' || fd.initcontvalue
  68.  
  69.     say 'Virtual: ' || fd.virtual
  70.  
  71.     if symbol(fd.maxchars) = "VAR" then say 'Max Chars: ' || fd.maxchars
  72.  
  73.     if symbol(fd.minvalue) = "VAR"  then say 'Min Value: ' || fd.minvalue
  74.  
  75.     if symbol(fd.maxvalue) = "VAR"  then say 'Max Value: ' || fd.maxvalue
  76.  
  77.     if symbol(fd.precision) = "VAR"  then say 'Precision: ' || fd.precision
  78.  
  79.     if symbol(fd.command) = "VAR"  then say 'Command: ' || fd.command
  80.  
  81.     if symbol(fd.stack) = "VAR"  then say 'Stack: ' || fd.stack
  82.  
  83.     say
  84.  
  85. end
  86.  
  87.  
  88. bail_out:
  89.  
  90. Address Value fiasco_port
  91.  
  92. UnlockGUI
  93. ResetStatus
  94.  
  95. exit
  96.  
  97. syntax:
  98. failure:
  99.  
  100. if show("Ports", fiasco_port) then
  101. do
  102.     Address Value fiasco_port
  103.  
  104.     RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
  105. end
  106. else
  107. do
  108.     say "Error" rc "in line" sigl ":" errortext(rc)
  109.     say "Enter to continue"
  110.     pull dummy
  111. end
  112.  
  113. call bail_out
  114.  
  115. halt:
  116. break_c:
  117.  
  118. if show("Ports", fiasco_port) then
  119. do
  120.     Address Value fiasco_port
  121.  
  122.     RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
  123.  
  124.     if result = 0 then return
  125. end
  126. else
  127. do
  128.     say "*** Break"
  129.     say "Enter to continue"
  130.     pull dummy
  131. end
  132.  
  133. call bail_out
  134.  
  135.  
  136.