home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 117 / af117a.adf / archives / af117a1.lzx / Fiasco_2.2 / Databases / Multimedia / gotoxref.frx < prev    next >
Text File  |  1998-09-22  |  1KB  |  88 lines

  1. /* gotoxref.frx
  2.  * Copyright © 1997 Nils Bandener
  3.  * $VER: gotoxref.frx 6.2 (3.10.97)
  4.  */
  5.  
  6. scriptname = "Goto Cross Reference"
  7.  
  8. Options Results
  9.  
  10. fiasco_port = address()
  11.  
  12. Signal on Syntax
  13. Signal on Halt
  14. Signal on Break_C
  15. Signal on Failure
  16.  
  17. LockGUI
  18.  
  19. CalculateFormula '"active(xrefs)"'
  20.  
  21. if result ~= -1 then
  22. do
  23.     GetField 'xrefs listentry ' || result || ' var pat'
  24.  
  25.     NewSearchInfo 'Name MMEncSI'
  26.     SetSearchField 'SearchInfo MMEncSI FieldID Term Pattern ' || pat
  27.     Find 'SearchInfo MMEncSI Record 0'
  28.  
  29.     if rc = 0 then
  30.     do
  31.         ActiveRecord 'Record ' || result
  32.     end
  33. end
  34. else
  35. do
  36.     RequestChoice 'Title "Goto Cross Reference" "No cross reference selected" "Cancel"'
  37. end
  38.  
  39. bail_out:
  40.  
  41. Interpret Address fiasco_port
  42.  
  43. UnlockGUI
  44. /* ResetStatus */
  45.  
  46. exit
  47.  
  48. syntax:
  49. failure:
  50.  
  51. if show("Ports", fiasco_port) then
  52. do
  53.     Interpret Address fiasco_port
  54.  
  55.     RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
  56. end
  57. else
  58. do
  59.     say "Error" rc "in line" sigl ":" errortext(rc)
  60.     say "Enter to continue"
  61.     pull dummy
  62. end
  63.  
  64. call bail_out
  65.  
  66. halt:
  67. break_c:
  68.  
  69. if show("Ports", fiasco_port) then
  70. do
  71.     Interpret Address fiasco_port
  72.  
  73.     RequestChoice '"Script Abort Requested" "Abort Script|Continue Script" Title "' || scriptname || '"'
  74.  
  75.     if result = 0 then return
  76. end
  77. else
  78. do
  79.     say "*** Break"
  80.     say "Enter to continue"
  81.     pull dummy
  82. end
  83.  
  84. call bail_out
  85.  
  86.  
  87.  
  88.