Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 09 NOV 2007 04:31:26AM Chang Lee Churn wrote:

Currently, I have my AREV system running on Windows NT 4.0 platform.

I'm facing a big problem now is that when I assign the printer for my PC.

I have to use the command "NET USE LPT1 \\abc07\Epson " to route the print ouf of LPT1 to the printer that is physically connected to the computer abc07.

I have a plan which works like this :

1) I will get the PC name eg. abc06 , (is it possible to do it from AREV itself? or I need to have the PC name stored in a text file and AREV will extract the PC name stored in text file??)

2) from this name, I will have a string that changes the PC name accordingly , from "NET USE LPT1 \\abc07\Epson" to

"NET USE LPT1 \\abc06\Epson" ?

then i'll use the string with PCPERFORM .

Would this plan work out?

Please suggest better solutions if you have any.

BTW, the AREV i'm running now is AREV 2.01.


At 09 NOV 2007 08:13AM Steve Smith wrote:

If the PCNAME=abc06 is set in the DOS environment you can

PCPERFORM "SET ] junk.txt"

then OSREAD the contents of the file, and parse for the variable name.

Or else you can possibly use the DOS get environment function ($GETENV.VRB) I wrote a few years back (1989) for AREV. Load it into your BP file from TCL with

COPY DOS $GETENV.VRB TO:(BP $GETENV

Then

CATALOG BP GETENV

Then in your basic program

DECLARE FUNCTION GETENV

ENVIRONMENT=GETENV()

See

http://www.state-of-the-art.com.au/util7.zip


At 09 NOV 2007 10:42AM Victor Engel wrote:

Perhaps there is a variable already available. On my computer here, there is a variable COMPUTERNAME that is set in the DOS environment.


At 09 NOV 2007 02:51PM Karen Oland wrote:

You can get the computername out of the environment (if not already set for you, you'll need to add a variable – computername is often used, userdomain is used for 2000 and xp).

Don't forget you'll need to delete any assignment on LPT1 first, then execute your assignment to the desired port.

Just looking at our old code, looks like we used catalyst calls to run the net use (or other network) commands (code =E, then the OS command as the command portion). I modified the built in printer definition window to hold the code/command fields and just let the user add what was needed (so they could have multiple copies of the HP laserjet, for example, each going to a specific network port/print queue). The code does a bit more (processing multiple code/commands at the start and end of the print jobs, adding printer codes as well, etc), but you have the basic idea in your post.


At 10 NOV 2007 10:49PM Steve Smith wrote:

Yeah, but if the PC is across network, then presumably SERVERNAME won't be the local PC, and the environment won't indicate where the relevant printer lives. </QUOTE> —- === At 12 NOV 2007 10:22AM Victor Engel wrote: === <QUOTE>The original post described what I assumed was a peer-to-peer network for printer resources. If that is not the case, then you're right. Or maybe I'm just misunderstanding the scenario. </QUOTE> View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/0baf852052fcc2698525738e00345104.txt
  • Last modified: 2023/12/28 07:39
  • by 127.0.0.1