I worked it out that as i also had a wait dialog open i needed to code as follows:-
sys_focus_put()
ui_modeless_dlg_setfocus(vWAITTITLE)
Thanks for all the help
Announcement
Collapse
The Alpha Software Forum Participation Guidelines
The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
Moderators may also rename posts and threads if they are too generic or do not property reflect the content.
Moderators may move threads if they have been posted in the incorrect forum.
Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.
The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.
Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.
Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.
Bonus TIPS for Successful Posting
Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.
When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.
The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.
When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.
A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.
If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.
When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.
Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
- Be professional in your conduct
- Be kind to others
- Be constructive when giving feedback
- Be open to new ideas and suggestions
- Stay on topic
Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
- Spam.
- Vulgar language.
- Quotes from private conversations without permission, including pricing and other sales related discussions.
- Personal attacks, insults, or subtle put-downs.
- Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
- Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
- Sexually explicit or violent material, links, or language.
- Pirated, hacked, or copyright-infringing material.
- Encouraging of others to engage in the above behaviors.
If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
- Remove the Post or Thread - the content is removed from the forum.
- Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
- Temporarily Ban the User - user is banned from forum for a period of time.
- Permanently Ban the User - user is permanently banned from the forum.
Moderators may also rename posts and threads if they are too generic or do not property reflect the content.
Moderators may move threads if they have been posted in the incorrect forum.
Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.
The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.
Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.
Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.
Bonus TIPS for Successful Posting
Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.
When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.
The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.
When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.
A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.
If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.
When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.
Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less
Run a Script in the background
Collapse
X
-
sys_focus_put() is the default, that documentation says should be :-
Optional. Default = Alpha Anywhere window. The name of the window to receive focus.
Leave a comment:
-
I presume that you have a target, a bit like below, in yourSys_focus_put() command?
From the Help Text;
sys_focus_put("Notepad - README.TXT")
Leave a comment:
-
Originally posted by Terrymorgan View PostUnfortunately "sys_focus_put()" is not returning to the Alpha Window, leaving the user on the web browser that has opened the URL. How can i force the return to the alpha Window.
or
Is it possible to use something like HTTP POST to run an A5w page without opening the page or just writing the code into an HTTP POST?
I don't use desktop and not sure exactly what SYS_FOCUS_PUT does but assume the Alpha UI needs to be running.
The alpha documentation indicates many system functions are not available in web apps so might be a limitation.
https://documentation.alphasoftware....20Function.xml
You can use HTTPPost or HTTP Get and call the a5w page direct from a scheduler with parameters if required.
You can also debug the running processes to verify if the alpha window is running using tools available from
https://learn.microsoft.com/en-us/sy...ocess-explorer
Leave a comment:
-
Since rebuilding the indexes should be done with nobody using the system, why not do the rebuild just before that automatic safe shutdown?
With that said, we are giving the best answers considering you are withholding much of the information about the problem you’re trying to solve. Kinda like telling your tp
fix your car saying it ain’t working right and refusing to give access to your car.
Leave a comment:
-
Too much focus on the index rebuild, as this is just one of 50 items that are run from my own scheduler which work with all sorts of timing, frequency & scripts.
Some time ago i moved to an automatic (safe) shut down of the app each evening, which the prevented the 3am option to rebuild indexes.
Now i have the some of the scheduled scripts running from A5W pages well i am looking for help with post #19
Thanks
Leave a comment:
-
Sorry Terry, looks a bit like a design issue.
@Gregg, I sort of suggested a startup or run down index update.
Leave a comment:
-
why not schedule the index rebuild for say 3am. A better option would be to move the data to sql, then zap and repop the dbf an hour before people start working.
Leave a comment:
-
This particular table is inclined to add records that do not appear in the index, and cannot therefore be found by index until such time the indexes have been fixed.
i have a button to do this but all users, have to come out of the system to do this, which is inconvenient
The example code I gave, as one of many scheduled scripts, as part of my scheduler runs first thing each day for the first user who logs on, so there is no one else in the table at that time.
i have added the in use trap in case something like a back up is running
Thanks
Leave a comment:
-
Terry, please can you let us know why you have a need to update indices during user activity?
It is unusual to do that as only really oddball situations necessitate a rebuild, and I tend to put a rebuild button in the app - if only a single user - and as an emergency.
if its a record locking issue in a multi user application, there are ways to handle that.
Leave a comment:
-
I tried a few things but have settled with putting the scripts into "a5W" pages & then opening these, which just run outside of Alpha (Desktop), returning full control to the user whist these run.
Two questions:-
This is an example script, to open the URL:-
vURL = vAPPSERVERPATH+"scheduler/scheduleditem0031.a5w"
save_to_file("Being Run from Web Page "+vURL+crlf(),vSCHEDULERLOGFILE,.t.)
sys_open(vURL)
xbasic_wait_for_idle()
sys_focus_put()
Unfortunately "sys_focus_put()" is not returning to the Alpha Window, leaving the user on the web browser that has opened the URL. How can i force the return to the alpha Window.
or
Is it possible to use something like HTTP POST to run an A5w page without opening the page or just writing the code into an HTTP POST?
Thanks
Leave a comment:
-
I am working on the Thread example given, and will update.
As an example i rebuild the indexes daily for certain tables and here is some example code:-
vFILENAME = vDBPATH+"Notifications.dbf"
if table.in_use(vFILENAME,.t.)
' ui_msg_box("Notifications","table in Use",UI_OK)
save_to_file("Unable to ReBuild Indexes for Notifications as file is in use"+crlf(),vSCHEDULERLOGFILE,.t.)
else
t = table.open(vFILENAME,FILE_RW_EXCLUSIVE)
t.index_create_begin("Autonumber","Autonumber","","U")
t.index_add("CreatedDate","CreatedDate")
t.index_add("CreatedTime","CreatedTime")
t.index_add("NotCleared","Recno()","ut(status)<>'CLEARED'")
t.index_add("NotificationNo","NotificationNo","","U")
t.index_add("Operator","Operator")
t.index_add("Reference","Reference")
t.index_add("Status","Status")
t.index_add("Uniquequoteno","Uniquequoteno")
t.index_add("Recno","Recno()","","U")
index_pointer = t.index_create_end()
t.close()
save_to_file("Indexes ReBuilt for Notifications"+crlf(),vSCHEDULERLOGFILE,.t.)
end if
Thanks
Leave a comment:
-
Thanks.
That's why an "interference diagram" is useful when developing any software.
Saves all sorts of issues down the line.
Leave a comment:
Leave a comment: