Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
 
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

Welcome and questions

 
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler
View previous topic :: View next topic  
Author Message
SonicARG



Joined: 17 Feb 2009
Posts: 1

PostPosted: Wed Feb 18, 2009 5:27 pm    Post subject: Welcome and questions Reply with quote

Hello everyone! I'm SonicARG and I want to say hello to all people in this forum. I hope I can solve all my problems and meet mates here.
Before I begin, I have to tell you I'm from Argentina ( Razz if you haven't noticed that...) so maybe I'll have some bad writing; don't bother: I'm an English learner, I can make mistakes... Laughing
Well, let's get back to the point: help me! Laughing
I wanted to know if these situations are possible for batches:
Arrow 1. Is it possible for a batch to write the content of a file (supposing <=2kB) in the screen?
Arrow 2. I know that batch variables can be stored in files, but is it possible that a variable can be set from the content of a file? See this example:
Quote:
Supose I'm doing a game I need record hiscores. I got the file bestscore.num (*.num to remind me I'm introducing a number) and I got bestscore.str (*.str to remind me I'm introducing a text string). I want the file, when I ask it to show this data. How do I do it?
Supose I want to write ECHO Today's High Score: %hiscorename% who made %hiscore% points. (Please note that hiscorename=bestscore.str and hiscore=bestscore.num)

Arrow 3. Is it possible for a batch to do the same action as before but with the *.ini style?
Quote:
Taking back the last example, I got bestscore.ini instead of the two files. Inside it, I got:

HiScore=10000
HiScoreName=Machine

Is it possible for a batch to read the variable after the "="? (Go to Line 1, Column 8 and read %hiscore% and so on?)

Arrow 4. Is it possibe for a batch to write ASCII characters both ofr the screen and for files? (for example: char 1 = ☺, char 2 = ☻, and so on) How can be implemented it?

That are my questions by now. Hope you can help me!
Thanks!
SonicARG

///EDIT MESSAGE///
Problems 2 & 3 were solved: I got several programs that solved them and helped me a lot. Just have a look at http://www.fpschultze.de/ for loads of programs ready for DOS.
Thanks anyway! I'm still waiting for #1 & #4.
SonicARG
Back to top
support
Site Admin


Joined: 13 Feb 2004
Posts: 378

PostPosted: Mon Mar 16, 2009 10:55 pm    Post subject: Reply with quote

Just a quick answers:

1. TYPE file.txt
2. SET /P VAR=string <file.txt
Back to top
blasch



Joined: 03 Sep 2009
Posts: 3

PostPosted: Thu Sep 03, 2009 7:56 pm    Post subject: Reply with quote

Support has answered question 1

here is question 4.

you need to determine the dos code page of the characters you wish to print or sent to a file.

the two in your example are found in the dos standard code page 437.

you can determine which code page is active in your shell by issuing the chcp command

you will get something like this

C:\>chcp
Active code page: 437

to print characters in your examples you will need to enter a special series of 4 numbers on your computer's number pad while holding the alt key down to express the character, which I'll express thusly {alt+0001} which translates to hold the ALT key and type 0001 on your number pad. Depending on the shell or text editor you might see a funky text or no text at all, then press enter or save the file as a batch and run to test.

for char 1 = ☺
in your shell or text editor issue the following command
echo {alt+0001}

for
char 2 = ☻
in your shell or text editor issue the following command
echo {alt+0002}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2011 phpBB Group