Since you've been using many different programming languages, you must be pretty used to this separation anyway. Edit Object has a function to retrieve its numeric value too.
Since you've been using many different programming languages, you must be pretty used to this separation anyway. Edit Object has a function to retrieve its numeric value too.

But the edit object's function only seems to return integers. You need to do val(edittext("Edit 1")) to get a floating point number.
I know the difference between strings and numbers - been using them in other languages before for years, and I know all about variables and arrays, but I'm more used to A=5, B=23, C=A*5, Print C.
Very simplistic, but user friendly.
I know how to use Val(string) and Str$(number). Problem I have is HOW do I do this in MMF2?
Where do I put it? I tried A=whatever, but I get an error.
The manual tells WHAT a command does, but not HOW to do it.
This all sounds counter-intuitive to me. I need to store numbers in an array at the beginning. The manual does NOT give examples on HOW to do this.
I want to multiply 2 numbers together, both taken from 2 combo boxes that only contains numbers. I tried multiplying the contents of the boxes called length and width, and outputting to an Edit Box. But, this does not work and I have no idea why.
I need a step by step on How to do this, but more importantly, I need to know Why so I can work this into my hurting brain!
Thanks - novelidea

80% done with that example




You don't define things in the expression editor in MMF2 - instead, assignments like that are done through the event editor. Instead of "C= A * 5", you would directly create an action "Set alterable value C to..." on object "Object" and enter (Alterable Value A("Object") * 5) in the expression editor (or anything else, but I'm using the same letters you have for clarity).
So, to retrieve the contents of two combo boxes and put the product into an edit box, use "Set text" on the Edit box and set it to:
(I don't know offhand the exact expression for getting the currently entered contents of a combo box object, but that's the general idea.)Code:Str$(val(Contents of "length") * val(Contents of "width"))

...
>=( MMF2 crashed and I didn't save.
Sorry, that example isn't happening.




novelidea,
I've created a rough app that does what you have asked for. You can find it in the File Archive forum.
Steve
Thank you all for your help. I've downloaded the file from drnebula and I'll be looking it over this weekend. Also, thanks to DavidN, I think I got what you mean.
novelidea




novelidea,
I realized that I forgot to include the $0.20 per square foot in the calculations. I've uploaded a new file to include this. I've also started to limit the values that the counters and edit boxes can have to 1-50, so you can see how to do this.
Steve