Forum > Android

for FPC JVM users: Small tool to help converting R.java to Pascal

(1/1)

Leledumbo:
I've developed a small tool to help converting the autogenerated R.java to Pascal. It's made in a quick and dirty way, but it works. It could be added to build script to automatically do the conversion before compiling.

It takes 1 command line parameter which is the path to R.java and outputs the result to standard output, so you might want to redirect it to a file. Note that the tool doesn't care whether one of the classes' name is a Pascal reserved word, please modify the source code as necessary if you want to avoid it (e.g. when a class name is string, convert is to strings).

truetom:
Very Good!Thanks a lot!but i can't compile it .when i compile it at FPC 2.4.4 , I have lot of error which like this :

Rj2p.pas(128,31) Error: Ordinal expression expected
Rj2p.pas(129,20) Error: Constant and CASE types do not match
Rj2p.pas(129,20) Error: Ordinal expression expected
Rj2p.pas(130,20) Error: Constant and CASE types do not match
Rj2p.pas(130,20) Error: Ordinal expression expected
Rj2p.pas(130,20) Error: duplicate case label
Rj2p.pas(131,20) Error: Constant and CASE types do not match
Rj2p.pas(131,20) Error: Ordinal expression expected
Rj2p.pas(131,20) Error: duplicate case label
Rj2p.pas(132,20) Error: Constant and CASE types do not match
Rj2p.pas(132,20) Error: Ordinal expression expected
Rj2p.pas(132,20) Error: duplicate case label
Rj2p.pas(133,20) Error: Constant and CASE types do not match
Rj2p.pas(133,20) Error: Ordinal expression expected
Rj2p.pas(133,20) Error: duplicate case label
Rj2p.pas(134,20) Error: Constant and CASE types do not match
Rj2p.pas(134,20) Error: Ordinal expression expected
Rj2p.pas(134,20) Error: duplicate case label
Rj2p.pas(337) Fatal: There were 18 errors compiling module, stopping

Which FPC version can compile it ?

OK, i have compile it at FPC 2.6.0 , so i have make it . thanks !

Leledumbo:
I use the "case <String variable> of" feature, which is not available in 2.4.4. Maybe I should put:

--- Code: ---{$if fpc_fullversion < 20600}
  {$error FPC 2.6.0 or greater required!}
{$endif}

--- End code ---
at the top of the source.

Navigation

[0] Message Index

Go to full version