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

  1. /* delpicture.frx
  2.  * Removes a picture entry from Fiasco's picture database
  3.  * Copyright © 1996-1997 Nils Bandener
  4.  * $VER: delpicture 6.2 (6.10.97)
  5.  */
  6.  
  7. Options Results
  8. Options FailAt 21
  9. Parse Arg num
  10.  
  11. scriptname = "DelPicture"
  12.  
  13. fiasco_port = address()
  14.  
  15. Signal on Syntax
  16. Signal on Halt
  17. Signal on Break_C
  18. Signal on Failure
  19.  
  20. LockGUI
  21.  
  22. GetField "Name_" || num
  23. name = result
  24.  
  25. if length(name) > 0 then
  26. do
  27.  
  28.     GetField "DT_" || num
  29.     thumbnail = result
  30.  
  31.     SetField 'DT_' || num '""'
  32.  
  33.     SetField 'Name_' || num '""'
  34.  
  35.     Address Command "Delete" thumbnail "Quiet"
  36.  
  37.     GetField "Cnt"
  38.     SetField "Cnt" result - 1
  39. end
  40.  
  41. bail_out:
  42.  
  43. Address Value fiasco_port
  44.  
  45. UnlockGUI
  46.  
  47. exit
  48.  
  49. syntax:
  50. failure:
  51.  
  52. if show("Ports", fiasco_port) then
  53. do
  54.     Interpret Address fiasco_port
  55.  
  56.     RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
  57. end
  58. else
  59. do
  60.     say "Error" rc "in line" sigl ":" errortext(rc)
  61.     say "Enter to continue"
  62.     pull dummy
  63. end
  64.  
  65. call bail_out
  66.  
  67. halt:
  68. break_c:
  69.  
  70. if show("Ports", fiasco_port) then
  71. do
  72.     Address Value fiasco_port
  73.  
  74.     RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
  75. end
  76. else
  77. do
  78.     say "*** Break"
  79.     say "Enter to continue"
  80.     pull dummy
  81. end
  82.  
  83. call bail_out
  84.  
  85.  
  86.