Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? TEXT/ENDTEXT but with environment variable expansion?

Jul
576
10
TEXT / ENDTEXT is great, but I need the same thing with env var expansion.

Or even one that... works with emoji/unicode?
 
Fun fact: You can use here-document redirection with TYPE:

Code:
type <<- endtext
    #define VER_MAJOR %VER_MAJOR
    #define VER_MINOR %VER_MINOR
    #define VER_BUILD %VER_BUILD
    #define VER_PATCH %VER_PATCH
    #define VER_FULL  "%VER_FULL"
    #define VER_WHEN  "%_isodate %_time"
    #define VER_WHERE "%computername"
    #define VER_PLATFORM  "%platform"
    #define VER_FILENAME  "%outfile"
    #define VER_COPYRIGHT_YEAR "%_year"
endtext
 
I've only ever used this stunt with plain ASCII text. You might be able to embed fancy Unicode characters in your batch file, if it's saved as UTF-8 or UTF-16. Or alternatively, use @CHAR or @UCHAR or the like.
 
I've only ever used this stunt with plain ASCII text. You might be able to embed fancy Unicode characters in your batch file, if it's saved as UTF-8 or UTF-16. Or alternatively, use @CHAR or @UCHAR or the like.
Your suspicions are dead on.

This is why we need a <<:u8 ... I don't know why there's >:u8 and |:u8 but not <:u8 ... this is exactly where i'd use it, if i am understanding.


1731436235712.webp

Code:
type <<- endtext


  Welp.
 
%big_top%'   {TCC FORUM WONT SHOW THE CURSIVE CHARACTERS HERE},
%big_bot%'   {TCC FORUM WONT SHOW THE CURSIVE CHARACTERS HERE},
%big_off

%big_top%%@cursive[let's test it out then]
%big_bot%%@cursive[let's test it out then]
%big_off


%@colorful_string[Heyooo this working? ]

raw   emoji={TCC FORUM WONT SHOW THE emoji CHARACTERS HERE}
raw unicode={TCC FORUM WONT SHOW THE unicode CHARACTERS HERE}
env   emoji=%CHECK% %STAR% %WRENCH%
env unicode=%ARROW%

endtext
 
This is why we need a <<:u8 ... I don't know why there's >:u8 and |:u8 but not <:u8 ... this is exactly where i'd use it, if i am understanding.

< and << are for input redirection. There are no encoding specifiers because TCC can decide for itself what kind of text it's receiving.

In particular, << reads text from the current batch file. TCC already knows how the current batch file is encoded — otherwise it wouldn't be able to execute it!
 
welll i guess.... how i make thing-y do-y??? hahaha :)
 
Back
Top