Recent

Author Topic: for FPC JVM users: Small tool to help converting R.java to Pascal  (Read 4125 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
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

  • Jr. Member
  • **
  • Posts: 73
    • http://sourceforge.net/projects/laz4android/
Re: for FPC JVM users: Small tool to help converting R.java to Pascal
« Reply #1 on: April 12, 2012, 01:49:26 am »
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 !
« Last Edit: April 12, 2012, 02:16:33 am by truetom »
laz4android : a Lazarus for Android Package.
http://sourceforge.net/projects/laz4android/

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: for FPC JVM users: Small tool to help converting R.java to Pascal
« Reply #2 on: April 12, 2012, 04:19:55 am »
I use the "case <String variable> of" feature, which is not available in 2.4.4. Maybe I should put:
Code: [Select]
{$if fpc_fullversion < 20600}
  {$error FPC 2.6.0 or greater required!}
{$endif}
at the top of the source.

 

TinyPortal © 2005-2018