Math Parser

I think Im Dead
30 Sept 2003, 16:57
Quest's math parser is capable, but it'd really be nice to see it fleshed out. I'm thinking it would only need to go to two decimal spaces, I can't really imagine needing anything more than that ever, though there is the ideal of, if you are going to do something do it right, and it may make more sense to just have a fully functional "calculator" built in.

Also, it might be nice if it had it's own syntax or something, though at this point I'm not really sure how to do it well. I'd say a function, ie; $math(4+2/3*8)$ but then there may be complications(perhaps it could have a built in feature to go by PEMDAS) but this also brings the problem of not being able to invoke other functions inside of it.

I don't know, just a suggestion.

kewldude606
30 Sept 2003, 21:00
I wish that Quest was able to handle more than 2 numbers and an operation at a time.
So, you could go like:
set numeric <NNN;%AAA%+%ZZZ%+%DDF%+%YTYTY%>

Instead of having to go:
set numeric <NNN;%AAA%+%ZZZ>
set numeric <NNN;%NNN%+%DDF%>
set numeric <NNN;%NNN%+%YTYTY%>

paul_one
30 Sept 2003, 22:06
PEMDAS??
That's kinda weird because I can find both PEMDAS and BODMAS...
(link to BODMAS here:)
http://www.easymaths.com/What_on_earth_is_Bodmas.htm

I prefer BODMAS myself but to each their own!

I think Im Dead
30 Sept 2003, 23:58
Eh, I was just referring to whatever trick it was we learned in grade school to know the order in which to do math operations first to last, they are the same thing. Parenthesis, Exponents, Division, Multiplication, Addition, Subrtraction...

codingmasters
01 Nov 2003, 04:07
How does Quest calculate sums?

Matthew G.

paul_one
01 Nov 2003, 11:38
Like so:
[number] <operand> [number]

a number can be a numeric variable or a plain number, an operand is either + - * / like in BASIC.
Just can't use ()'s or have more than one operand.

codingmasters
01 Nov 2003, 23:21
Now tell me how to do it in QDK

Matthew G.

GameBoy
02 Nov 2003, 14:47
codingmasters wrote:Now tell me how to do it in QDK please

Matthew G.

paul_one
02 Nov 2003, 18:13
If you know anything about programming (which it looks like you DONT) then you need to assign the result to a variable.

Create a variable in the startscript in QDK, have the value as:
"2 * 4" and when you play the game, use the "debug" menu in Quest to look at the numeric variables. You'll see the variable equals 8!

codingmasters
02 Nov 2003, 20:18
Thanks for that. And by the way, Ido know a lot about programming

Matthew G.

GameBoy
03 Nov 2003, 15:44
if thats the case why are you asking in previous threads, how to add music to an application?

paul_one
03 Nov 2003, 21:25
Hmmm - I didn't find out until I started messing around at college.

VB was a huge leap until I realised that instead of "print" or whatever you use the '.' at the end of objects to make them do stuff and assign stuff.

To make music play look in a VB tutorial site - it'll explain all about the media player component.

codingmasters
03 Nov 2003, 21:29
As i said in previous threads, I managed to get a VB CD on Sunday with over 2000 code snippets. So I don't need to

Matthew G.

paul_one
03 Nov 2003, 21:41
Code snippets are OK if you're me ;) .
Probably not you though.

codingmasters
03 Nov 2003, 21:42
Why wouldn't they? With all this code, I could put together a mega program. Just you wait

Matthew G.

paul_one
03 Nov 2003, 21:51
Just cutting code snippets is totally different from "understanding" them.
Getting snippets is useless, you need to look and experiment. Code snippets are rubbish, the VB help files are the best.

codingmasters
03 Nov 2003, 21:53
I know what you are syaing.

1. I don't have the MSDN collection stored on my computer

2. I won't use all the code there, and I'm going to have to edit it for my own needs anyway. I do understand it

Matthew G.

paul_one
03 Nov 2003, 21:57
I don't have the MSDN collection - I have two help files I stole from college :D.

codingmasters
03 Nov 2003, 22:03
Well then. i don't have help files either. It would be nice if you could send them to me

Matthew G.

paul_one
03 Nov 2003, 22:05
Why not just use the online help files?

codingmasters
03 Nov 2003, 22:06
I've looked through them, and i can't find anything. I use VB 6 and most of the stuff on there is for VB.NET

Matthew G.

paul_one
03 Nov 2003, 22:08
you're looking in the wrong part.
Look for visual studio and VB 6 - or something like that.

codingmasters
03 Nov 2003, 22:09
I have looked for it. Give me a URL

Matthew G.

paul_one
03 Nov 2003, 22:11
Too lazy. Maybe when I go on there next.

codingmasters
03 Nov 2003, 22:14
isn't that just typical

Matthew G.

paul_one
03 Nov 2003, 22:19
Yup. It's very typical for me since I'm very lazy.

I found the VB6 online help files in about 5 minutes when they updated to .net. Don't know what can be so hard about finding them.

codingmasters
03 Nov 2003, 22:22
Then how do you get back there each time? If you bookmarked it, just get the URL off there

Or, just give me a base URL and i'll try and find it from there (NOT msdn.microsoft.com)

Or just continue to be a lazy guy

Matthew G.

paul_one
03 Nov 2003, 22:24
I re-search for it every time. I find it quite easily too.

codingmasters
03 Nov 2003, 22:25
Well that's just silly

Matthew G.

paul_one
03 Nov 2003, 22:30
How? I don't waste 1K on my hard drive and I don't find it hard to go "click, click, click, done".