--------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200002 Date: 03/27/98 From: CHRIS.SHUFFETT@USA.NET Time: 04:35am \/To: ALL (Read 0 times) Subj: Dos() in TSE 2.8 From: I took a quick crack at this today. Feel free to make suggestions. :-) Press to start the macro again. Put your dos commands in the command window. Press to execute the command line under the cursor. Mark several command lines to immediately execute commands one after the other. Put a dot in front of a command if you want its screen output captured. (ie. redirected to a file) Tip - I like to run ftp << mycmds.ftp from the tse dos prompt. where mycmds.ftp contains something like: open ftp.semware.com anonymous dir First edit mycmds.ftp. Next then select mycmds.ftp then press then add ftp << in front of mycmds.ftp and hit enter. Put in the password when prompted. Also, regarding the caps problem. Yup it happended to me. I found that if I left caps on in the Win 95 password screen that caused it. integer winid1 = 0 ,winid2 = 0 ,tmpbuf1 = 0 ,tmpbuf2 = 0 string fn[80] = "" proc execcmd() integer sub1 = 0 ,isblk = isBlockInCurrFile() string cmd[255] = "" if cmd == "" endif if winid2 <> WindowId() return() endif if isblk PushPosition() GotoBlockBegin() sub1 = Query(BlockEndLine) - Query(BlockBegLine) + 1 else sub1 = 1 endif repeat if isblk PushBlock() endif if GetText(1,1) == "." cmd = GetText(2,CurrLineLen()) if isblk msgbox("DOS Command",cmd) endif Dos(Format(cmd, ">", fn), _DONT_PROMPT_|_TEE_OUTPUT_) GotoBufferId(tmpbuf1) EndFile() AddLine() AddLine(cmd) AddLine() InsertFile(fn) UnMarkBlock() EraseDiskFile(fn) FileChanged(FALSE) else cmd = GetText(1,CurrLineLen()) if isblk msgbox("DOS Command",cmd) endif Dos(cmd) GotoBufferId(tmpbuf1) EndFile() AddLine() AddLine(cmd) FileChanged(FALSE) endif GotoBufferId(tmpbuf2) if isblk PopBlock() Down() if GotoWindow(winid1) EndFile() GotoWindow(winid2) UpdateDisplay(_ALL_WINDOWS_REFRESH_) endif endif sub1 = sub1 - 1 until sub1 == 0 if isblk PopPosition() endif if GotoWindow(winid1) EndFile() GotoWindow(winid2) endif FileChanged(FALSE) UpdateDisplay(_ALL_WINDOWS_REFRESH_) end proc main() fn = MakeTempName("", ".tmp") if winid1 == winid2 endif if fn == "" endif if isZoomed() ZoomWindow() endif if HWindow() winid1 = WindowId() if not GotoBufferId(tmpbuf1) tmpbuf1 = CreateBuffer("Capture") endif else return() endif if HWindow() winid2 = WindowId() if not GotoBufferId(tmpbuf2) tmpbuf2 = CreateBuffer("Command") endif else AbandonFile() CloseWindow() return() endif end main() execcmd() ____________________________________________________________________ Get free e-mail and a permanent address at http://www.amexmail.com --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200003 Date: 03/27/98 From: "CHRIS ANTOS (EXCHANGE)" Time: 01:12pm \/To: ALL (Read 0 times) Subj: Re: UPDATING variables within a ASK() St13:12:3603/27/98 From: "Chris Antos (Exchange)" right. so if you're not using environment variables, then try the other thing i suggested. write your own routine to parse the user's string and replace things in it. there has never been any other way to do such things. obviously, a string will not magically get updated with correct values replacing STATION because this is an invented semantic. so psuedo code for a routine would be something like: string stUser string stTemp prompt user, put user's response in stUser. loop thru files, for each file: stTemp = stUser walk thru stTemp looking for the replacement character you define when found, take the word following it and look it up (to find end of word, save off the index where the word begins, then walk forward some more looking for whatever you define as end of word) replace the word in stTemp with the looked-up value eg, use DelStr and InsStr Dos(stTemp) endloop //chris -----Original Message----- From: Ciccotto, Domenick (Exchange) [mailto:DCICCOTTO@Bear.COM] Sent: Thursday, March 26, 1998 2:16 PM To: Chris Antos (Exchange); 'Dom Ciccotto'; Semware 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 < Set F12 to PopUP a Task Menu and make Settings > < Set F5 to Start Tasks as of this Point on the list > 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 > < Set F12 to PopUP a Task Menu and make Settings > > < Set F5 to Start Tasks as of this Point on the list > > 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) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200004 Date: 03/28/98 From: "STEVE WATKINS" Time: 01:26am \/To: ALL (Read 0 times) Subj: 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 > < Set F12 to PopUP a Task Menu and make Settings > > < Set F5 to Start Tasks as of this Point on the list > > > 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 >> < Set F12 to PopUP a Task Menu and make Settings > >> < Set F5 to Start Tasks as of this Point on the list > >> 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) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200005 Date: 03/27/98 From: "CHRIS ANTOS (EXCHANGE)" Time: 08:07am \/To: ALL (Read 0 times) Subj: Re: UPDATING variables within a ASK() St08:07:5003/27/98 From: "Chris Antos (Exchange)" 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 < Set F12 to PopUP a Task Menu and make Settings > < Set F5 to Start Tasks as of this Point on the list > 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 --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200006 Date: 03/27/98 From: "CARLO HOGEVEEN" Time: 08:05am \/To: ALL (Read 0 times) Subj: Re: Set/GetGlobalStr - speed/limit ? From: "Carlo Hogeveen" -----Original Message----- From: Chris Antos (Exchange) To: 'dBit AS' ; tsepro@semware.com Date: Wednesday, March 25, 1998 6:59 PM Subject: RE: Set/GetGlobalStr - speed/limit ? >i think a better way to do arrays is to use a buffer. use CreateTempBuffer, >and make each line be an element in the array. > >or in the case of your customer.lst, i think it's already in an array >format, really. just create a temp buffer and load your customer.lst file. >you can use lFind("10005", "^g") to find record 10005 (the ^ means the >string must appear at the beginning of the line which in your case seems to >be how customer.lst is formatted). Actually, this is how setglobalstr() and getglobalstr() internally work, with a hidden buffer, in which the variable name (alias the key value) is the first word on each line (alias reacord), so that part would be pointless to program ourselves. To answer part of the original question: because getglobalstr() and setglobalstr() work with a hidden file, the number of session global variables you can add is only limited by internal memory and TSE's disc swap space. > if the file is really large and is in >sorted order, you can even write your own binary search routine to improve >search speed. Yes, here you can beat getglobalstr(). Setglobalsstr() adds new variables (keys) to the begin of the hidden buffer, so getglobalstr() can not do a binary search and is "slow". > >//chris > Carlo > > > >-----Original Message----- >From: dBit AS [mailto:dbit@sn.no] >Sent: Wednesday, March 25, 1998 3:02 AM >To: tsepro@semware.com >Subject: Set/GetGlobalStr - speed/limit ? > > >I have tried using the GetGlobalStr function for a kind of "associative >arrays" (like Perl). > > EditFile("customer.lst") ---> 10001Customer name # 1 > Repeat 10002Customer name # 2.... > Key = GetText(1,5) > Data = GetText(6,30) > SetGlobalStr(Key,Data) > StopIt() > Message(CurrLine()) > Until Not Down() > >After about 255 (I guess) loops this slows down significantly. Is there >a smarter way to accomplish this ? How many SetGlobalStr/Int variables >can be created - are there any limit at all ?? > >By the way: I finally got my 2.5 .UI converted to 2.8 - ready for 3.0 :) > >- SOI - > > --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200007 Date: 03/27/98 From: "CICCOTTO, DOMENICK (EXCHANGE)" Time: 08:45am \/To: ALL (Read 0 times) Subj: Re: UPDATING variables within a ASK() St08:45:4403/27/98 From: "Ciccotto, Domenick (Exchange)" STATION is NOT an environment variable it is simply one line from a List of stations (Text File) as shown below. proc main < Set F12 to PopUP a Task Menu and make Settings > < Set F5 to Start Tasks as of this Point on the list > 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 > < Set F12 to PopUP a Task Menu and make Settings > > < Set F5 to Start Tasks as of this Point on the list > > 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 r 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) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200008 Date: 03/29/98 From: JOACHIM BECKER Time: 02:35am \/To: ALL (Read 0 times) Subj: None From: Joachim Becker UNSUBSCRIBE --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200009 Date: 03/28/98 From: NICK ALLAN Time: 06:37pm \/To: ALL (Read 0 times) Subj: help files c6a90001 From: Nick Allan Hi all A simple question, how do I create help files, ie the ones like tsehelp.hlp I'd rather not use a lot of helpdefs if I can avoid it. Please point me to the section of the manual that explains this as I can't find it. thanks in advance for any help. Regards Nick guardian@silas.cc.monash.edu.au Nallan@bigfoot.com --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: F4200010 Date: 03/29/98 From: PHILIP THORNTON Time: 09:24am \/To: GERRIT KUEHN (Read 0 times) Subj: inserting file Message <24 Mar 1998 22:48> Gerrit Kuehn (2:241/1130.16) wrote to *.*: GK> Hallo *.*! GK> When I insert a file into a TSE-document, I'd like to have added two GK> lines like this: GK> -filename.begin----------------------------------------------------- GK> ---------- GK> [...inserted_file...]