dbTalk Databases Forums  

Can this be done in D3/NT?

comp.databases.pick comp.databases.pick


Discuss Can this be done in D3/NT? in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
wjhonson
 
Posts: n/a

Default Re: Can this be done in D3/NT? - 02-17-2011 , 10:47 AM






On Feb 16, 8:08*am, sh <sham... (AT) prupipe (DOT) com> wrote:
Quote:
So I'm wondering if anyone has another way of "polling" while a D3
program is sitting at an INPUT statement. Any ideas would be appreciated.

Thanks in advance.

Sholom
Three ways.

One character input, as has been suggested above.
Accuterm which has VB scripting built in, replaces your entire process
from dirt to shirt including launching the Pick application.

Third, the POKE command forces Input to wake up.

Reply With Quote
  #12  
Old   
sh
 
Posts: n/a

Default Re: Can this be done in D3/NT? - 02-17-2011 , 02:00 PM






On 2/17/2011 11:47 AM, wjhonson wrote:
Quote:
On Feb 16, 8:08 am, sh<sham... (AT) prupipe (DOT) com> wrote:

So I'm wondering if anyone has another way of "polling" while a D3
program is sitting at an INPUT statement. Any ideas would be appreciated.

Thanks in advance.

Sholom

Three ways.

One character input, as has been suggested above.
Accuterm which has VB scripting built in, replaces your entire process
from dirt to shirt including launching the Pick application.

Third, the POKE command forces Input to wake up.
POKE works nicely.

Reply With Quote
  #13  
Old   
Ross Ferris
 
Posts: n/a

Default Re: Can this be done in D3/NT? - 02-20-2011 , 06:45 AM



On Feb 18, 1:31*am, sh <sham... (AT) prupipe (DOT) com> wrote:
Quote:
You don't find that an IN FOR 10 (polling every second) isn't a resource
hog?

G'day, Ross.

Sholom
Very light on resources .... IN either gets a character of input OR
times out in 10 seconds and, if nothing else to do, just goes back
looking for a single character input again. We bypass the IN if we are
running a keystroke macro, biut that is another story

Reply With Quote
  #14  
Old   
GlenB
 
Posts: n/a

Default Re: Can this be done in D3/NT? - 02-22-2011 , 09:16 PM



On Feb 16, 11:08*am, sh <sham... (AT) prupipe (DOT) com> wrote:
Quote:
Can the following be done in D3/NT?

We have just installed a Shoretel phone system, and I've integrated it
into our order taking application in D3. What I do is the following:

I've written a VB.NET program that reads the Caller ID when a
salesperson answers the phone and writes it to a little DOS text file.
I've also created an MD in D3 that points to that DOS subdirectory, so
it can treat the DOS text file as a regular mv record.

When the salesperson picks up the phone, the VB.NET program executes and
writes the Caller ID to the DOS file. Then in the D3 order taking
program, the sales person hits a key which causes the program to read
that text file and search for that phone number in the Customer file. If
it finds the exact phone number, it displays the customers record. If it
doesn't find the exact phone number (the customer may have many
extensions or DID numbers), we update this new number into the Customer
file, so the next time the customer calls using that DID number we have
it on record.

All this works fine. However, I'd like to avoid forcing the salesperson
to hit a key to start the search. I'd like the D3 program to "sense"
that the DOS record exists, and start the ball rolling by itself without
user action.

The problem is that at that moment the D3 order taking program is
sitting on an INPUT statement. You can't "tell" an INPUT statement
anything, nor can the system "tell" it anything. It's just waiting for
user input. So I have no way to force the D3 program to "poll" for the
existence of the DOS record while it's sitting at that INPUT statement.

I tried using the "INPUT x FOR 20 THEN ... ELSE..." version of the INPUT
statement to "poll" the DOS file every 2 seconds. While this works
technically, it causes other problems. The "INPUT ...FOR" version
requires that the user finish typing their input within those 2 seconds,
otherwise it reverts the cursor back to position 1. So if a person is
typing "HELLO" and the 2 seconds are up before the "O", the input
becomes "OELL". This clearly won't work.

So I'm wondering if anyone has another way of "polling" while a D3
program is sitting at an INPUT statement. Any ideas would be appreciated.

Thanks in advance.

Sholom
Absolutely and I've done it many times in D3/Linux, for different
purposes. This solution will work on any platform, though. One of the
main uses was for a shipping scale input that queries a socket for
live weight values and also responds to keyboard input while that's
happening. It's pretty nifty watching the numbers change as you affect
the scale, but you can still hit "M" to force a manual entry or <ESC>
to bail the input at any time.

If you have input control in the prompt routine then loop around the
SYSTEM(14) variable until either a trigger file is seen or SYSTEM(14)
returns a value. If SYSTEM(14) has a value then you switch to your
normal keyboard buffer input code and redraw the input mask if needed.
If your prompt routine accepts stacked input from DATA statements then
you'll want to also check for SYSTEM(10) to see if a stack is active
each pass. Stack data does not appear in SYSTEM(14) IIRC so you need
to check both in that case.

LOOP UNTIL EXIT = 1 DO
IF SYSTEM(14) THEN
* CALL YOUR INPUT CODE TO PULL FROM KB BUFFER
END
IF SYSTEM(10) THEN
INPUT STACKED.INPUT.DATA
* RETURN THE STACKED INPUT TO CALLING PROGRAM
END
* SCAN FOR A FILE
* RETURN DATA TO CALLING PROGRAM OR CONTINUE LOOPING
DUMMY=SYSTEM(13) (TIME SLICE RELEASE TO AVOID SPINNING PROCESSES)
REPEAT

GlenB

Reply With Quote
  #15  
Old   
GlenB
 
Posts: n/a

Default Re: Can this be done in D3/NT? - 02-23-2011 , 03:34 PM



On Feb 22, 10:16*pm, GlenB <batch... (AT) bellsouth (DOT) net> wrote:
Quote:
On Feb 16, 11:08*am, sh <sham... (AT) prupipe (DOT) com> wrote:
If your prompt routine accepts stacked input from DATA statements then
you'll want to also check for SYSTEM(10) to see if a stack is active
each pass. Stack data does not appear in SYSTEM(14) IIRC so you need
to check both in that case.


I take that back. You don't need to loop on SYSTEM(10). I don't
think there is a way to stack onto the call once it's active. You only
need to check SYSTEM(10) for an active stack condition at the initial
start-up. If you POKE data to the port the input routine is running on
it will show up in the input buffer under SYSTEM(14).

Quote:
LOOP UNTIL EXIT = 1 DO
* IF SYSTEM(14) THEN
* * * CALL YOUR INPUT CODE TO PULL FROM KB BUFFER
* END
** removed SYSTE(10) check ***

Quote:
* * SCAN FOR A FILE
* * RETURN DATA TO CALLING PROGRAM OR CONTINUE LOOPING
* DUMMY=SYSTEM(13) (TIME SLICE RELEASE TO AVOID SPINNING PROCESSES)
REPEAT

GlenB- Hide quoted text -

- Show quoted text -
GlenB

Reply With Quote
  #16  
Old   
Excalibur21
 
Posts: n/a

Default Re: Can this be done in D3/NT? - 02-25-2011 , 07:01 PM



If you want to poll something and allow input the easiest way is to
use SYSTEM(14) input buffer character buffer count.
So instead of sitting at INPUT sit in a loop checking for the two
circumstances that you want. If the operator enters anything
SYSTEM(14) will be greater than zero so simply GO/RETURN to your INPUT
command however if one of your telephone records turns up load a DATA
statement and GO/RETURN to your INPUT statement.
Peter McMurray

Reply With Quote
  #17  
Old   
x
 
Posts: n/a

Default Re: Can this be done in D3/NT? - 02-25-2011 , 08:00 PM



Sholom,
You have several issues to tackle:
1) You vant to know that some event happened.
2) You want to make the operators aware that an event is pending while
the operator does something unrelated and sits at input prompt.
3) You want to assign the event handling to one operator only.

One possible solution is as follows:
1) Have a phantom that SELECTs the directory in question every so
often, let's say once every 5 seconds.
When an event takes place, set a system LOCK.
2) Broadcast a message to all available operators (ports) using MSG.
3) As soon as an operator starts the responding program, the program
should check for the system lock and continue by clearing it if is set
or othewise stop (if is no longer set that means somebody else took
the call).

Note: When an operator becomes available the program writes the port
number to a file pooled by the phantom.
The phantom then sends messages only to ports shown in this file. Of
course once a call is taken, the program should remove the port number
from the file. The same can be done with system locks if you have
enough available.

Lucian

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.