Hi Jerome, thanks for adding localization to VECHO, but:

> vecho /t %FLANG% HELLO %TFH% "%OS_NAME% %OS_VERSION%" %TFF%
> 
> At the point that line is invoked,
> %FLANG% points to a file called A:\FDSETUP\SETUP\EN\STAGE300.DEF
> %TFF% and %TFH% are color names Black and Red.

You could read a variable %V8LANGFILE% directly from the environment,
as using the file name as command line option uses up possibly dozens
of bytes of precious space in the command line ...

An even nicer idea might be making VECHO use a style more similar to
what existing localized tools for FreeDOS already use: A file called
VECHO.XX where XX is the current value of %LANG%, in any directory of
the semicolon-separated list of %NLSPATH%, containing lines similar to

1.42:"Welcome to the installation program for" /f Red

and where you would invoke VECHO roughly as follows:

VECHO /NLS:1.42 "%OS_NAME% %OS_VERSION%" /f Black "."

In other words, /NLS:code inserts a message from the NLS file, here
omitting the %NUMBER style variable support for a bit more simple
processing. You could instead use multiple /NLS:... options such as:

VECHO /NLS:1.42 "%OS_NAME% %OS_VERSION%" /NLS:1.43

... where (obviously) message 1.43 would have to be defined as:

1.43:/f Black "."

Note that NUMBER.NUMBER style codes are what the Catgets/Kitten message
files traditionally use. Even if you only modify your VECHO to search
the NLSPATH directories for a VECHO.%LANG% file while keeping the file
format of your ".DEF" files for that, you still have advantages: This
style would avoid having to pass the /t %FLANG% option manually and it
will make it easy to have multiple VECHO.* files for various languages
prepared without needing extra batch processing to select one :-)

> vecho "Welcome to the installation program for " /f Red “FreeDOS 1.1a" /f 
> Black "."
> 
> There main reasons I built it into vecho were: 
> 
>       It and maybe vstr are the only things that will ever need it.
>       Performance and Compatibility, no piping or shelling needed.

Indeed :-) Thanks!

>       Longer text supported. (127 max command line, 96 in batch filed can be 
> expanded up to 256 characters.)

Why 256? Message files in theory support arbitrary line lengths :-)

Note that the Catgets / Kitten files also support "# this is a comment"
style lines (they have to start with the # char) for extra structure.

Cheers, Eric

PS: If you compare VECHO to LOCALIZE, you will see that LOCALIZE also
has a special syntax for a fallback message which is used if either no
message file is found or the selected message is not found in that. It
can also help with readability of batch files to have fallback texts.



------------------------------------------------------------------------------
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to