Both "uses" clauses produce a compiler error. Is there any possibility doing that?
I can compile this code using pascal compiler like FreePascal.
If it's not possible, then I have to write this code inside one big unit :(
Thanks for the help in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
unitBBB;interfaceusesAAA;// line n.1proceduresampleBBB(myvar : recA);// line n.2implementationproceduresampleBBB(myvar : recA);beginend;end.
This way I can't compile. It shows me an error like: " test.mpsrc(n.1): E204 unexpected token 'uses'
"
I think that I need line n.1 due to param definition of sampleBBB procedure. But if I comment line n.1, it compiles OK.
The problem rises again when I write on unit BBB this:
unitBBB;interfacefunctionsampleBBB(myInt : integer):recA;// line n.3functionsampleBBB2(myInt):array[1..10]ofrecA;// line n.4implementationusesAAA;functionsampleBBB(myInt : integer):recA;beginend;functionsampleBBB2(myInt : integer):array[1..10]ofrecA;beginend;end.
In this case, the compiler returns: " test.mpsrc(n.3): E406 unknown type 'recA' "
For line n.4, the compiler error is: " test.mpsrc(n.4): E406 unknown type 'array'
"
I know I can solve this using:
// The old returned value is retVar now. Passing it by reference// due to being a recordfunctionsampleBBB(myInt : integer;retVar : recA):integer;functionsampleBBB2(myInt : integer;retVar : array[1..10]ofrecA):integer;// line n.5
Line n.3 is solved but line n.5 instead of line n.4 doesn't work. Compiler error shows: " test.mpsrc(n.5): E202 identifier (name) expected
"
I don't know how to solve this problem with arrays.
Thanks for your answer and waiting your helping hand :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
MIDletPascal, and it's pascal dialect, has it's idiosyncrasies and some limitations too. It seems you are facing them, but the bad new is that there is not enough people using MP nowadays to assist you.
Anyway, here is my help this time. The workaround to the issue you couldn't solve is to define a new type:
type
someName = array of recA;
and use that new type in your parameter:
function sampleBBB2(myInt : integer; retVar : someName) : integer;
Btw, and despite the lower amount of developers using MP actively (J2ME as a platform is mostly dead now), I will try to reach the final release of the 3.5 version. It will be really hard, but I will try it.
Thanks and good luck with your MP projects.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I'm working with units and I can't reference a unit inside another:
I want to use this unit here:
Both "uses" clauses produce a compiler error. Is there any possibility doing that?
I can compile this code using pascal compiler like FreePascal.
If it's not possible, then I have to write this code inside one big unit :(
Thanks for the help in advance.
Hi,
Sure, be sure to name your units with at least 3 characters, let's say AAA and BBB.
and
compiles fine here.
Thanks for post.
The problem exists when unit BBB is like:
This way I can't compile. It shows me an error like: " test.mpsrc(n.1): E204 unexpected token 'uses'
"
I think that I need line n.1 due to param definition of sampleBBB procedure. But if I comment line n.1, it compiles OK.
The problem rises again when I write on unit BBB this:
In this case, the compiler returns: " test.mpsrc(n.3): E406 unknown type 'recA' "
For line n.4, the compiler error is: " test.mpsrc(n.4): E406 unknown type 'array'
"
I know I can solve this using:
Line n.3 is solved but line n.5 instead of line n.4 doesn't work. Compiler error shows: " test.mpsrc(n.5): E202 identifier (name) expected
"
I don't know how to solve this problem with arrays.
Thanks for your answer and waiting your helping hand :)
Hi,
MIDletPascal, and it's pascal dialect, has it's idiosyncrasies and some limitations too. It seems you are facing them, but the bad new is that there is not enough people using MP nowadays to assist you.
Anyway, here is my help this time. The workaround to the issue you couldn't solve is to define a new type:
type
someName = array of recA;
and use that new type in your parameter:
function sampleBBB2(myInt : integer; retVar : someName) : integer;
Btw, and despite the lower amount of developers using MP actively (J2ME as a platform is mostly dead now), I will try to reach the final release of the 3.5 version. It will be really hard, but I will try it.
Thanks and good luck with your MP projects.
Thanks for this solution. I'm going to try more small projects with MidletPascal.
I hope this project can walk for some years :)
Thank you for your job developing this project.