alerts and shortcall (was sorry!)

Jay Schille jayschille at gmail.com
Wed Apr 30 20:17:10 PDT 2008


I'm glad it works, Barry.

You don't need the "stop" at the end of your version if you're not 
using shortcalls--that just keeps the procedure from repeating the 
shortcalls.

In fact, calls and shortcalls are really only useful for clumps of 
statements that you need to use more than once. Your version is more 
succinct without calls or shortcalls.

Why shortcall probably didn't work is that the shortcall format needs 
a colon after the statement, like
	AppendToFile:
	 statement 1
	statement 2 etc.
	rtn




>Thanks for the quick help, Jay. I got this version to work:
>
>alert 1013,"Add to existing data? (No will replace)"
>if info("dialogtrigger") contains "yes"
>      OpenFile "DB_9 all_items"
>      OpenFile "+ at theExportText"
>else
>     OpenFile "DB_9 all_items"
>      OpenFile "&@theExportText"
>     endif
>     stop
>
>But when I tried to use the version with the shortcalls I got a 
>"missing label" error and it wouldn't compile. It's not critical for 
>this since my Panorama efforts (although amazingly useful to my 
>business) are very elementary. But if you can see what's missing, 
>please let me know. And I like the alerts--I didn't even know they 
>existed.
>
>bk
>
>
>
>>  Barry,
>>
>>  I tried your code, and if the variable theExportText is not in focus,
>>  "Sorry, the file won't open" appears.
>>  So, the variable theExportText needs to be a local or global variable
>>  for the procedure to work.
>>
>>  Here's how I would do it:
>>
>>  local theExportText  /* using the lowest level variable that does
>>  what you want */
>>  alert 1013, "Add to existing data? (No will replace)"
>>  /* why use the clipboard when you don't have to? Use the alert
>>  statements instead. */
>>
>>  if info("dialogtrigger") contains "yes"
>>       /* Why shortcall? Shortcall keeps the mini-procedure with the
>>  procedure that calls it */
>>       shortcall AppendToFile
>>  else
>>       shortcall ReplacetheFile
>>  endif
>>  stop /* keeps the procedure from repeating the shortcalls */
>>
>  > AppendToFile:
>>  OpenFile "DB_9 all_items"
>>  /* Window "DB_9 all_items" This isn't necessary: OpenFile makes that
>>  file's sheet the active window. */
>>  OpenFile "+ at theExportText"
>>  rtn
>>
>>  ReplacetheFile:
>>  OpenFIle "DB_9 all_items"
>>  OpenFile "&@theExportText"
>>  rtn
>>
>>>
>>>  yesno "Add to existing data? (No will replace)"
>>>  if clipboard() contains "Yes"
>>>  call AppendToFile
>>>  else
>>>  call ReplacetheFile
>>>  endif
>>>
>>>  AppendtoFile is this:
>>>
>>>  OpenFile "DB_9 all_items"
>>>  Window "DB_9 all_items"
>>>  OpenFile "+ at theExportText"
>>>
>>>  and the ReplacetheFile replaces the + with the &.
>>>
>>>
>>>  When I run it, I get "Sorry, the file won't open" -- although the
>>>  target DB does become the front window.
>>>
>>>  Suggestions very welcome--as usual, I bet it's something simple.
>>>
>>>  And if the formatting comes through messed up again, my apologies 
>>>  in advance.
>>>
>>>  Thanks,
>>>  bk
>>>
>>>
>>
>>  --
>>  Jay Schille
>>  _______________________________________________
>>  Qna mailing list
>>  Qna at provue.com
>>  http://provue.com/mailman/listinfo/qna
>
>
>_______________________________________________
>Qna mailing list
>Qna at provue.com
>http://provue.com/mailman/listinfo/qna


-- 
Jay Schille


More information about the Qna mailing list