| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | [TSEPro] Re: Line terminators |
From: Fred Holmes
@Date: Wed, 26 Feb 2003 08:56:10 -0500
@Sender: semware-owner{at}sawasdi.apana.org.au
I started to reply to this that one could just Query(EOLType) and use the
return value in a clone of the Semware-supplied showcurr.s macro that puts
the hex value of the current character on the status line at the right
end. But when I tried it, if an EolType is not specified, Query(EOLType)
just returns 0 for "As Loaded" without telling you what EOL type
the loaded
file is actually using in the disk file. I don't find anything in the
catalog of editor variables that would do that? But clearly it has to be
saved in some variable when the file is loaded so that it can be used when
the file is saved.
Here's a quick macro that came from James C. Sewall in 1996 for TSE for
DOS, to pop up a menu to set the EOLType. It should run unmodified in TSE
4, I think. (This setting can also be made from the TSE Options menu, a
couple of levels down, of course.)
/*********************************************************
EolMenu will present the user with a selectable menu
of choices for a current End Of Line mode. This is
useful if you edit Dos and Unix style files.
*********************************************************/
menu EolMenu()
Title = "Select Mode:"
"&Unix Style [LF]"
"&Dos Style [CR/LF]"
"&Mac Style [CR]"
end
proc Main()
integer rc
GotoXY(5,10)
rc = EolMenu()
case rc
when 1
Message("Unix Style Selected [LF]")
Set(EOLType,2)
when 2
Message("Dos Style Selected [CR/LF]")
Set(EOLType,3)
when 3
Message("Mac Style Selected [CR]")
Set(EOLType,1)
otherwise
Message("Aborted EOL change.")
endcase
end // Main()
Fred Holmes
At 10:47 PM 2/25/2003, DaveG wrote:
>Line terminatorsI work in a mixed DOS/UNIX environment. I use "As
Loaded"
>to typically avoid issues, but I occasionally move files from one
>environment to the other. I need to know what the current termination is
>and to be able to change it. In the past when my drive mappings were more
>constant, I could hook a macro to set it based on the drive, but no more.
>Changing it is not the problem. Learning what the current status is and
>displaying it is the problem. The hex mode display doesn't help as the CR
>or CR/LF are not displayed---why not?
>
>I'm thinking about an indicator in the line below the message line, maybe
>a D for DOS files and a U for UNIX files. Has anyone already done any
>work on determining what the current files line terminator is and
>displaying the information? If not, can anyone give me any clues on how
>to determine the terminator character(s)?
--
TSEPro Mailing List
List Maintenance: www.semware.com/html/list.htm
---
[sawasdi.apana.org.au] (3:800/846.13)
* Origin: apana>>>>>fidonetSEEN-BY: 633/267 270 @PATH: 800/846 1 640/954 774/605 123/500 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
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™.