--------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00002 Date: 06/26/97 From: "JAMES C. SEWELL" Time: 06:10am \/To: ALL (Read 0 times) Subj: SAL programming From: "James C. Sewell" Suggestion: Add integer arrays to SAL Question 1: What is the range for BufferId()'s? Question 2: What is the best way to emulate integer arrays? Question 3: What is a better way to implement my function? I need to set a flag on/off for each of the buffers in my ring. GetBufferId() gives me a reference number for the buffer, but that is a seemingly random number that starts out around 20 or so... usually. My first thought, before realizing the unpredictability of these buffer numbers, was to have a string[10] and for each buffer set string[buffer number] to "1" or "0". This works, but considering the id's I'd have to make string's size really big and I prefer not to do that. Besides that, what if a buffer id is bigger than 255 (the biggest string)... then my routine fails and someone loses data. A Bad Thing. Open to suggestions... Jim This answer, and my routine, may be a good tutorial in the near future... --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00003 Date: 06/26/97 From: "CHRIS ANTOS (EXCHANGE)" Time: 06:26am \/To: ALL (Read 0 times) Subj: RE: SAL programming From: "Chris Antos (Exchange)" you may be able to use the framework in my FS macro for that. it's on the ftp site, or if you want it i have a slightly newer version that fixes a couple obscure bugs. my guess is you're really interested in settings per buffer (ie, filename) not per bufferid? //chris | -----Original Message----- | From: James C. Sewell [SMTP:jims@MPGN.COM] | Sent: Wednesday, June 25, 1997 12:40 PM | To: tsepro@semware.com | Subject: SAL programming | | Suggestion: Add integer arrays to SAL | | Question 1: What is the range for BufferId()'s? | | Question 2: What is the best way to emulate integer arrays? | | Question 3: What is a better way to implement my function? | | | I need to set a flag on/off for each of the buffers in my ring. | GetBufferId() gives me a reference number for the buffer, but | that is a seemingly random number that starts out around 20 or | so... usually. | | My first thought, before realizing the unpredictability of these | buffer numbers, was to have a string[10] and for each buffer set | string[buffer number] to "1" or "0". This works, but considering | the id's I'd have to make string's size really big and I prefer | not to do that. Besides that, what if a buffer id is bigger than | 255 (the biggest string)... then my routine fails and someone loses | data. A Bad Thing. | | Open to suggestions... | Jim | | This answer, and my routine, may be a good tutorial in the near | future... --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00004 Date: 06/26/97 From: "JAMES C. SEWELL" Time: 06:11am \/To: ALL (Read 0 times) Subj: Re: Maintenance Release upgrade From: "James C. Sewell" Back on Jun 13th I responded to a posting from Fred Holmes. Unfortunately I sent it to tse-pro instead of tsepro . I think the principal may help others with future upgrades so I am going to resend it here to the right address. At 08:00 AM 6/13/97 -0500 FRED HOLMES, whom God loves, said: >It would be nice to also have >a detailed recipe for accomplishing the maintenance release >upgrade from 2.50a . . . to 2.50e The unfortunate part of it is that depending on how much you have customized your TSE a ecipe could be either disaster or astonishing success. In my case I've changed the UI so uch that a recipe would kill me. One thing I did to help this is the following (assuming you are using the TSE.UI file): 1. Take any functions that you have added to the UI and put them in another file. Mine is JCS.UI (my initials.) 2. Put the line #include ["jcs.ui"] // Custom ui code. somwhere near the top of the TSE.UI file. 3. Put a comment at the top of JCS.UI reminding me of all the changes I have to make to TSE.UI that can't be moved to a different file. Example: I have hooks that need to be called in the whenloaded() routine so I just copy the code to the comment and it's cut-and-paste to restore it to the new version TSE.UI when it comes in. This saves a LOT of time and work when I get a new version. All I have to do is to add he #include line and cut/paste 5 lines for my other customizations. Hope it helps! Jim --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00005 Date: 06/26/97 From: "JAMES C. SEWELL" Time: 06:13am \/To: ALL (Read 0 times) Subj: Macro tidbit From: "James C. Sewell" Here's another one I sent to the wrong address... sorry if it's a dupe but I don't think it went out. Here's a little trivial macro I just wrote I though I'd share. If you have ever accidentally WrapPara'd your C program then this is for you. Many times my fingers do what they want and hit wrong keys and I really hate paragraph-wrapped programs! :) proc mWrapPara() string ext[25] ext=CurrExt() case (Lower(ext)) when ".c", ".cpp", ".s", ".si", ".ui" return() endcase WrapPara() end mWrapPara() Put this into a macro you autoload, if you have one for such things, or make a new one and autoload it. Hope it helps Jim --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00006 Date: 06/26/97 From: "JAMES C. SEWELL" Time: 06:14am \/To: ALL (Read 0 times) Subj: New manuals From: "James C. Sewell" Last of the misaddressed messages... The new manuals are great, especially considering the price! Here's my observations for what they're worth: The print is cleaner and the font sharper. The older manual seems a bit blurry. The pages appear higher quality... but this may be the age of my originals turning them yellow. The newest things are documented up to v2.6 for the Win/95 version and 2.5 for Dos. There are markers that clearly show which lines apply to Dos and which to Win95 where appropriate. Considering these changes and the age of my originals I'm glad I spent the $16.00 (including shipping) to get the new ones. This isn't necessarily a sales pitch, but I wondered what the differences were and thought you guys might like to hear about it. Jim --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00007 Date: 06/26/97 From: DAVID MARCUS Time: 06:53am \/To: ALL (Read 0 times) Subj: Re: SAL programming From: DavidMarcus@MindSpring.com (David Marcus) James C. Sewell wrote on Wed, 25 Jun 1997 15:40:04 -0400: >Open to suggestions... These macros create an array (self-sizing upon writes) and write and read. he array is actually a temp buffer indexed by line number. Note - this is off the top of my head - may need edit before compile. integer proc CreateArray() integer rc PushPosition() if not CreateTempBuffer() KillPosition() return(FALSE) else rc = GetbufferID() PopPosition() return(rc) endif end integer proc WriteIntegerToArray(INTEGER value_to_write, INTEGER, array_position, INTEGER array_bufferID) PushPosition() if not gotoBufferID(array_bufferID) KillPosition() return(FALSE) endif while array_position() > numLines() EndFile() AddLine() endwhile GotoLine(array_position) DelToEOL() InsertText(Str(value_to_write), _INSERT_) PopPosition() return(TRUE) end integer proc WriteStringToArray(STRING string_to_write, INTEGER, array_position, INTEGER array_bufferID) PushPosition() if not gotoBufferID(array_bufferID) KillPosition() return(FALSE) endif while array_position() > numLines() EndFile() AddLine() endwhile GotoLine(array_position) DelToEOL() InsertText(string_to_write, _INSERT_) PopPosition() return(TRUE) end integer proc ReadIntegerFromArray(INTEGER array_position, INTEGER array_bufferID) integer rc // return MAXINT if no array or position greater than size or array // return MININT if position not initialized PushPosition() if not gotoBufferID(array_bufferID) or not GotoLine(array_position) KillPosition() return(MAXINT) endif if CurrLineLen() = 0 PopPosition() return(MININT) else rc = val(GetText(1,CurrLineLin())) PopPosition() return(rc) endif end string proc ReadStringFromArray(INTEGER array_position, INTEGER array_bufferID) string rc[255] // set to largest possible string // return str(MAXINT) if no array or position greater than size of array PushPosition() if not gotoBufferID(array_bufferID) or not GotoLine(array_position) KillPosition() return(str(MAXINT)) endif RSFArc = GetText(1,CurrLineLin())) PopPosition() return(rc) end ============================================ David R. Marcus - Documentation Manager IQ Software Corporation (www.iqsoftware.com) davidm@iqsc.com DavidMarcus@MindSpring.com --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00008 Date: 06/26/97 From: DOM CICCOTTO Time: 02:59pm \/To: ALL (Read 0 times) Subj: Running and setting the DOS() function f14:59:3206/26/97 From: Dom Ciccotto I have a macro which takes a list of NT stations and performs operations ("ping" etc) on each and writes the results on the line next to the station name. I thought it would be a good idea to include a menu option to add an "on the fly" command that could be excuted against the list. Example: String Run_This[75] ASK("Enter the command to run against each station", Run_This) DOS(Run_This) What I would like is to enter the following into the ASK : "Copy \\MAIN_SERVER\C$\The_DIR\*.EXE \\" + STATION + "\C$\MY_DIR" I need station to be reevaluated each time it "pulls" a new station name. Even though the "ASK" is entered before the macro starts "pulling" the station names from the list. In dBASE/Clipper this would be done with DOS( &RUN_THIS) The & reevaluates the VAR each time. Is there a way in SAL ???? Thanks Dom Ciccotto --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00009 Date: 06/26/97 From: ERIC STORK Time: 07:51am \/To: ALL (Read 0 times) Subj: Re: Macro tidbit From: Eric Stork At 03:43 PM 6/25/97 -0400, Jim Sewall offered a solution for: > If you have >ever accidentally WrapPara'd your C program then this is for you. Many >times my fingers do what they want and hit wrong keys and I really hate >paragraph-wrapped programs! > Jim's solution looks good as far as it goes -- but one can have this problem with _any_ file, not just with ".c", ".cpp", ".s", ".si", ".ui" files. For that reason, since QEDIT days. I've used the following pair of macros: The first saves my file _before_ wrapping a paragraph, and the second lets me restore that file as it was just prior to an undesired wrap. The key assignments are the one's I use; change to suit you. / / proc mReformPara() // mapped to @Grey* SaveFile() WrapPara() ScrollToRow(Query(WindowRows)/2) // MakeCtrOfScreen end mReformPara_Plain / / proc mRestoreFile() // mapped to @[ BegFile() MarkLine() EndFile() MarkLine() DelBlock() InsertFile(CurrFilename()) UnMarkBlock() end mRestoreFile / / The below is Jim's approach, for reference: >proc mWrapPara() > string ext[25] > > ext=CurrExt() > case (Lower(ext)) > when ".c", ".cpp", ".s", ".si", ".ui" > return() > endcase > > WrapPara() >end > > mWrapPara() > Eric ---------- Eric Stork e-mail address: estork@erols.com --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00010 Date: 06/26/97 From: "CARLO HOGEVEEN" Time: 10:05am \/To: ALL (Read 0 times) Subj: Re: SAL programming From: "Carlo Hogeveen" <0hogeveen01@flnet.nl> Arrays can be simulated in TSE with: setglobalint(array_name + str(index_value), new_element_value) and: if existglobalvar(array_name) old_element_value = getglobalint(array_name + str(index_value)) else old_element_value = 0 endif Hint: To assure that array_name will always be unique across macro's, start array_name with the macro_name. The same method can be used to create: - arrays of strings. - arrays of struktures, by adding field_names to the array_name. - multidimensional arrays, for example seperating the multiple indexes by an underscore. DelGlobalVar("Carlo") ---------- : From: James C. Sewell : To: tsepro@semware.com : Subject: SAL programming : Date: woensdag 25 juni 1997 21:40 : : Suggestion: Add integer arrays to SAL : : Question 1: What is the range for BufferId()'s? : : Question 2: What is the best way to emulate integer arrays? : : Question 3: What is a better way to implement my function? : : : I need to set a flag on/off for each of the buffers in my ring. : GetBufferId() gives me a reference number for the buffer, but : that is a seemingly random number that starts out around 20 or : so... usually. : : My first thought, before realizing the unpredictability of these : buffer numbers, was to have a string[10] and for each buffer set : string[buffer number] to "1" or "0". This works, but considering : the id's I'd have to make string's size really big and I prefer : not to do that. Besides that, what if a buffer id is bigger than : 255 (the biggest string)... then my routine fails and someone loses : data. A Bad Thing. : : Open to suggestions... : Jim : : This answer, and my routine, may be a good tutorial in the near : future... --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13) --------------- FIDO MESSAGE AREA==> TOPIC: 152 QEDIT Ref: EAY00011 Date: 06/26/97 From: "CARLO HOGEVEEN" Time: 10:23am \/To: ALL (Read 0 times) Subj: Re: SAL programming From: "Carlo Hogeveen" <0hogeveen01@flnet.nl> Oops! The "if existglobalvar(array_name)" should ofcourse be "if existglobalvar(array_name + str(index_value))" ---------- : From: Carlo Hogeveen <0hogeveen01@flnet.nl> : To: tsepro@semware.com; James C. Sewell : Subject: Re: SAL programming : Date: donderdag 26 juni 1997 1:35 : : : Arrays can be simulated in TSE with: : : setglobalint(array_name + str(index_value), new_element_value) : : and: : : if existglobalvar(array_name) : old_element_value = getglobalint(array_name + str(index_value)) : else : old_element_value = 0 : endif : : : Hint: To assure that array_name will always be unique across macro's, : start array_name with the macro_name. : : The same method can be used to create: : - arrays of strings. : - arrays of struktures, by adding field_names to the array_name. : - multidimensional arrays, for example seperating the multiple : indexes by an underscore. : : : : DelGlobalVar("Carlo") : : : : ---------- : : From: James C. Sewell : : To: tsepro@semware.com : : Subject: SAL programming : : Date: woensdag 25 juni 1997 21:40 : : : : Suggestion: Add integer arrays to SAL : : : : Question 1: What is the range for BufferId()'s? : : : : Question 2: What is the best way to emulate integer arrays? : : : : Question 3: What is a better way to implement my function? : : : : : : I need to set a flag on/off for each of the buffers in my ring. : : GetBufferId() gives me a reference number for the buffer, but : : that is a seemingly random number that starts out around 20 or : : so... usually. : : : : My first thought, before realizing the unpredictability of these : : buffer numbers, was to have a string[10] and for each buffer set : : string[buffer number] to "1" or "0". This works, but considering : : the id's I'd have to make string's size really big and I prefer : : not to do that. Besides that, what if a buffer id is bigger than : : 255 (the biggest string)... then my routine fails and someone loses : : data. A Bad Thing. : : : : Open to suggestions... : : Jim : : : : This answer, and my routine, may be a good tutorial in the near : : future... --- * Origin: apana<<<<<<>>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)