TIP: Click on subject to list as thread! ANSI
echo: qedit
to: ALL
from: `STEVE WATKINS`
date: 1998-03-28 01:26:00
subject: Re: UPDATING variables within a ASK() St01:26:0203/28/98

From: "Steve Watkins" 
Is the problem that you want to read the information from the buffer into a
string?  If so, see GetText().
Steve Watkins
SemWare Technical Support
-----Original Message-----
From: Ciccotto, Domenick (Exchange) 
To: 'Chris Antos (Exchange)' ; 'Dom
Ciccotto' ; Semware 
Date: Thursday, March 26, 1998 5:31 PM
Subject: RE: UPDATING variables within a ASK() String
>
>STATION is NOT an environment variable it is simply one line from
>a List of stations  (Text File)  as shown below.
>
> proc main
>     
>     
>
>     EditFile()       <---  Loads the list of stations
>
> end
>
>The idea is to load a text file with station names then Hit a key
>to pop-up a list of tasks, pick the Task(s) to do.
>
>Position your cursor on the list.
>The second key (F5) says... Single station,  Next x stations, rest of
>list.
>
>This works perfectly for about 25 of the most boring tasks.
>But when I tried to get fancy and made an entry of
>   "RUN A Command Line Util Against the List."
>I found my self with the problem originally stated.
>
>If I go into the macro and "Hard code" the DOS() command with a string
>and my variable station.....
>  DOS("DIR "+ rSTATION + "C$\*.*")
>        NO PROBLEM.
>
>But when I try to do a "ON THE FLY"  ASK("ENTER Command : ", myCOMMAND)
>
>and try to do a   DOS(myCOMMAND)   the "STATION" within the string
>myCOMMAND never gets updated (as it goes down the list of stations).
>
>How can I  reEval / Freshen  a string ???
>String = "DIR "+ rSTATION + "C$\*.*"
>
>
>     Thanks
>   Dom Ciccotto
>
>
>
>
>> -----Original Message-----
>> From: Chris Antos (Exchange) [SMTP:chrisant@Exchange.MICROSOFT.com]
>> Sent: Thursday, March 26, 1998 4:38 PM
>> To: 'Dom Ciccotto'; Semware
>> Subject: RE: UPDATING variables within a ASK() String
>>
>> i think you mean "%" not "&".  if "STATION" is an environment variable
>> set
>> to "foo", then DOS("dir %STATION\*.*") would be executed as "dir
>> foo\*.*".
>> is that what you mean?
>>
>> or you can write a routine that goes thru your string and looks for
>> "&"
>> and replaces it with the value of GetGlobalStr("") or with
>> GetEnvVar("")?  then the user could generically enter any command
>> such
>> as "dir &WHIFFO &JACKO &PLUGH" and each of those would be replaced
>> with the
>> appropriate thing.  but i think simplest is to simply use the built-in
>> DOS
>> functionality of replacing %FOO with the value of the environment
>> variable
>> FOO.
>>
>> //chris
>>
>>
>>
>>
>> -----Original Message-----
>> From: Dom Ciccotto [mailto:dciccotto@worldnet.att.net]
>> Sent: Thursday, March 26, 1998 4:10 AM
>> To: Semware
>> Subject: UPDATING variables within a ASK() String
>>
>>
>> The following has been a nagging problem.
>>
>> How to update a string (taken from the ASK function) which has
>> variables built into it.
>>
>> I hope the following makes sense.
>> It is the outline of a macro which I use to perform many tasks against
>> a list of  NT workstations/servers.
>> ============================================
>>
>> proc main
>>     
>>     
>>     EditFile()       <---  a Load the list of stations
>> end
>>
>> What I do
>> =======
>> I get a station name and store it to STATION and rSTATION
>> (rSTATION= "\\"+STATION+"\")
>> The Task Menu is then used to Turn on/off things like:
>>   Check Backup Logs,  Check Time/Date on "Key" files,
>>   Running command line utils substituting in the station name ....etc.
>>
>> What I have not been able to do.
>> ======================
>> If I Hit  and choose "Run a DOS Command Line Against
>> the Station List.  The only way I've been able to do it is.
>>
>> ASK( "Enter Your PRE-Station Command : ", PreStationCommand )
>> ASK( "Enter Your Post-Station Command : ", PostStationCommand )
>>
>> Then when I Hit  it loops the list running
>>      DOS( PreStationCommand+" " + rSTATION + PostStationCommand)
>>       Simple example:
>>           PreStationCommand="DIR"   PostStationCommand= "C$\*.*"
>>
>> HOW CAN I TYPE SOMETHING IN ASK() AND HAVE IT UPDATE
>>
>> In early DOS programs it was called Macro Substitution and used a "&".
>>
>> The command string would be  Command="DIR  &STATION\C$\*.*"
>>  and then the program would run   DOS(Command)
>>
>>
>>    Dom Ciccotto
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>--
>***************************************************************************
****
>Bear Stearns is not responsible for any recommendation, solicitation, offer
or
>agreement or any information about any transaction, customer account or
account
>activity contained in this communication.
>***************************************************************************
****
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.