Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

experiences

2014-01-30
2014-01-30
  • Gergő Pintér
    Gergő Pintér
    2014-01-30

    Hey,

    I've recently found MidletPascal and I tried to use it for a hobby project. I was happy, because I liked Pascal I learned programming in that language and I felt a little nostalgic using this language again.

    But I had to realize that this is not the same language. After 2 days of working I finished my project and I satisfied with the result, but I found MP unpolished, inconsistent (in some point) and a little buggy.

    The compiler warned me the using arrays in record is not implemented. I said okay, using record in record was not warned, project compiled, but the result did not work in MicroEmulator at all.

    Using array as input parameter in function/procedure is not convient in Pascal as well, but I could not managed to use it at all.

    The fact that strings are not char arrays caused some inconvientness, but I could cope with it. :) I cannot index strings as array, but there are Java-like getter/setter functions for this goal.
    In Pascal indexes start from 1. Not from zero. I found some inconzistency at this point. String[0] would be the lenght. getChar and setChar uses zero first.

    As far as I remember, converting an integer to string function was called intostr in Pascal, integertostring is damn long to write and it is not 'Pascalish' at all.

    My biggest problem was the character encoding. Yeah, I read in the forums that 'will' be implemented in MP4.0, but that was not much help. I wanted to use Hungarian accents in text, that are availabe in extended ascii codetable. I did some 'reverse engineering' with chr() funcion and I managed to determine which values produces them (chr(252) is ü for example), so I planned to write a function that replaces characters.
    I found that getChar('ü') won't give me what I want for some reason. If I user ord(getChar('ü')) I got a 65532. Not problem, 65532-65280=252 and with this rule it works with every charachter, but if I wanted to use this method on the real text, it produced some weird (indeterminisric) result. Or at last I could have not found the rule...

    Finally I used a very ugly workaround: I write numbers to the source code where I want to see accents and I replace them to the right chr(value).

    Overall, the IDE is great, I love the old fashioned blue-yellow theme and it works great even under WINE. Compiler is not the best, but works mostly well, so thanks for the fish... (for the work to make it).

    I would not use it for a complex project, but it was great to play with it a litte.

    Gergő