Blue Bomber wrote:I think the npc codes are alright but I gotta double check. And for some reason when I open it in PGE, it works. Does that say something?
SMBX is written in Visual Basic 6.
All bugs and crashes like "type mismatch" is a data parsing error. Because Redigit wasn't made pre-Parsing input checks, is a big dangerous to send wrong data to parser (converter of string to integer, float point number, boolean, etc.) and causing crash. Visual Basic have a most stupid parser: this parser always check the standard settings and converting decimals "0.5" or "0,5" by those settings. This thing should have a FORCE replacing comma or dot to the correct character for this region to prevent crash.
PGE is written in C++.
When you parse string data in C++ you will never get crash, but you will get the data trash! (for example, you converting string "3.5jj", but when you parse this wrong number, you will get the array of integers. I.e. you was got a not true data, but crash was not appeared! Even if you used only STL or clean C without any smart Qt, GTK+, boost, etc.). C++ always use dot character "0.5" as decimal and it is region independent. Also, into file parsing function I was add lots of pre-parsing checks. For example, if need "0.5" but got "0s.1", file loading will be aborted with error message about wrong file format, but application still opened and works. Also, for float point numbers I was add special parsing feature which allow to use BOTH decimal styles (AND 0.5 AND 0,5), but when you save file, will be used style with a dot.
C++ is a
strict type language, I.e. you can't give to the string variable the double number without converting, will be compilation error. The crash in C++ possible only when:
- Attempt to try get/put data via wrong or null pointer
- Outed of array range.
Because I used the C++ instead of other languages:
because it is one of high-level languages which have compilers which creating the NATIVE executable format, and it's executables working quickly always (unlike .NET or Java which generating interpretable byte-code, but Java is platform-independent, .NET was ported to Linux with Mono project)
(also, in Visual Studio set the Visual C++ compiler is alone which can generate native quickest executable). (but for a lot of reasons, I used MinGW compiler for Windows, because it giving more faster executables and friendly with a cross-platform coding).