Qbasicnews.com

Full Version: n00b Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi
i'm nkk

i am making a program called "mathemagic" in pure Qbasic
and i wanted to know how to make a console...

what i mean it this..

if user types "1+1" then it should give 2
i wanted to know different possibilities for this....


nkk
jeez dude, don't go into to much detail, each character is one byte and they add up you know. i don't think sumo wants to go over his bandwidth because you decided to type up the encylopaedia.

ok, sorry, i just woke up.
what are you talking about? please use details. unless i'm missing something here.

Anonymous

well, you need to learn how to "parse expressions".

Deleter posted a nice recursive descent expression parser a while ago... maybe he will show you when he sees this topic. =)
Basically you need to convert the string into individual numbers: Use MID$() and ASC() to get the ASCII value of each character and then create IF statements that figure out what to do. I agree, Deleter's parser is an awesome example.
red_Marvin's Equator program is my preference (although I've never tried Deleter's).
http://fileanchor.com/17037-d
http://forum.qbasicnews.com/viewtopic.php?t=11145

though recursive stuff can be hard for a newbie to learn...

edit: just realized that uses string indexing, which is not supported in qb, if you want me to rewrite it quick so it works for qb then say so.
well yeah.. if you could spare anytime i would like you to translate it in qb
but i think this will help and even save u from trouble..
i could understand the parser by going through it.....
so thanx for the prompt help =P
i think i will make convert it in qb

keep rocking!

nkk
well and sorry to post this here
i should have posted it in Qbasic general Help..


nkk

Anonymous

Don't worry about it, after all it was your first post...


btw, welcome :^_^:
thank you chaos..
i used qbasic 4.5 for about 1 year
and i learned lot of it..
but what i lacked was a hard disk..Sad(i don't have one..blownup mine)
Pages: 1 2