alerts and shortcall (was sorry!)
Barry Kahn
barryk at caravanbeads.net
Wed Apr 30 19:09:09 PDT 2008
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
More information about the Qna
mailing list