• Welcome to Valhalla Legends Archive.
 

MS-DOS String Parsing

Started by Yegg, May 20, 2005, 04:04 PM

Previous topic - Next topic

Yegg

I'm pretty sure this is the correct forum section for this topic. I'm working on a small project in MS-DOS, and I need to split the input given by a user into separate strings, to better clarify this, I would like to declare each character in the string with its own variable. Is DOS capable of reading the 1st character of a string, the 2nd character of a string, the 3rd, and so on. So for instance, can you simply echo back the 4th character of the string that was input by the user? Or is this impossible?

Kp

Sure.getc(); getc(); getc();
c = getc();
printf ("%c", c);
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Yegg

Thanks for the very complex response, it was so big and informative I wasn't sure if I could read the whole thing. Anyone else?

Maddox

This reminds me of another recent thread.
asdf.

Warrior

Yegg, we have different definitions of Complex it seems </melaughingatsarcasmovertheinternet>
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Kp

Quote from: Yegg on May 20, 2005, 05:27 PM
Thanks for the very complex response, it was so big and informative I wasn't sure if I could read the whole thing. Anyone else?

Well, if you're going to be writing MS-DOS code, you need to keep it simple.  Remember the memory limit.  So, I gave you simple code.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Newby

- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

R.a.B.B.i.T


Yegg

Kp, I believe that "Sure", is not a valid answer in this case... The language is just DOS, I don't see what else you want to know unless it is the version of it, which doesn't seem to matter in this case. Also, I found a link that solved my problem.

Kp

The "Sure" was just an affirmation that you can do it.  The code was a demonstration of how to grab out (and echo) the fourth character.  DOS isn't a language; it's an operating system (specifically, the Disk Operating System!).
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Newby

I'm gonna go out on a limb here and guess he wants it in batch.
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

MyndFyre

Quote from: Newby on May 20, 2005, 09:34 PM
I'm gonna go out on a limb here and guess he wants it in batch.

That would make a lot of difference.  When you post in the "General Programming" forum, and then talk about variables, people expect that you're talking about a programming language.

DOS is not a language, as Kp pointed out, and IMO "batch programming" is something of a misnomer.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mangix

i believe one language of DOS is BASIC which is what VB was based on. and its the language which my dad is an expert on since he used to program in DOS.

and yes DOS isnt a Programming Language as all these people said.

effect

Quote from: Mangix on May 21, 2005, 12:11 AM
he used to program in DOS.

Quote from: Mangix on May 21, 2005, 12:11 AM
yes DOS isnt a Programming Language.

Your such a moron u make me cry!
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

R.a.B.B.i.T

DOS is an OS, not a language.  That being said, DOS is not a language.  But DOS is an operating system.  Is it clear yet?  I think so.  Batch isn't a very good "language" to program in, because you need to call in a LOT of dependencies to make a large program.  Making a batch bot won't be very fun (or easy), and the code for it gets VERY messy VERY fast, trust me, I've tried.  Also, making a bot for DOS, which isn't a language, it's an operating system, specifically for Disks, is hard because batch isn't a very good "language" to program yet, especially for an operating system like DOS, which isn't a language.