Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread Sven Barth
On 28.03.2014 02:04, fredvs wrote: Your code is working PERFECTLY and trust me, even at StackOverflow.com, they do not know your trick, there are lot of questions for that without any working answer. Your GENIUS trick is to export name = Java_MyLib_MyProcedure. I do not know if that could be

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread leledumbo
PS: Hum, why did you use = env,jcls: pointer; as arguments, is it needed for Java ? I have try without and it works too... It's JNI requirement, I wonder it could work without as it may corrupt the stack. The first parameter is the JVM environment, the second is the Java object (or class

[fpc-pascal] function mapping to array?

2014-03-28 Thread Xiangrong Fang
Hi All, Is the following possible: type TFunc=function(x: Double): Double; procedure apply(f: TFunc; var x: array of Double); var i: Integer; begin for i := 0 to Length(x) - 1 do x[i] := f(x[i]); end; apply(@sqrt, x); -- how can I apply() to built-in functions? Thanks! Xiangrong

Re: [fpc-pascal] function mapping to array?

2014-03-28 Thread Jonas Maebe
On 28/03/14 09:04, Xiangrong Fang wrote: apply(@sqrt, x); -- how can I apply() to built-in functions? Write a wrapper function for them. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] reference counting of multi-dimensional array

2014-03-28 Thread Jonas Maebe
On 28/03/14 02:50, Xiangrong Fang wrote: var a2: array of array of Integer; i, j: Integer; begin SetLength(a2, 3); for i := 0 to 2 do begin SetLength(a[i], 3); for j := 0 to 2 do a[i][j] := 1; end; a2 := nil; -- will this free all memory of a[0]...a[2]? end; Yes.

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread Helmut Weber
I don't understand you argument. Java is quite similar to C or C++. So who develops in Java and wants to import a native library would use C or C++, not Pascal. Best, Helmut - Original Message - From: fredvs fi...@hotmail.com To: fpc-pascal@lists.freepascal.org Sent: Thursday, March

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread Mattias Gaertner
On Fri, 28 Mar 2014 09:55:47 +0100 Helmut Weber h-g-we...@t-online.de wrote: Java is quite similar to C or C++. What kind of Java are you talking about? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] FPC 2.6.4 for GO32

2014-03-28 Thread Pierre Free Pascal
-Message d'origine- De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal- boun...@lists.freepascal.org] De la part de Lubomír Cabla Envoyé : mercredi 26 mars 2014 21:05 À : FPC-Pascal users discussions Objet : Re: [fpc-pascal] FPC 2.6.4 for GO32 First the good news:

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread Helmut Weber
For me the Java Programming Language (J. Gosling, Sun, Oracle) seems to me quite uniquely defined. As a developper I personally use the compiler Oracle JVM 1.7.0_03 for Windows. Helmut - Original Message - From: Mattias Gaertner nc-gaert...@netcologne.de To:

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread fredvs
And then there are even specific tutorials if you look for JNI tutorial and maybe some language name and with the advent of Android this got even more, because this is the way how you interface native with Java code there... Hum, have you really test those tutorials ? You must be a very good

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread leledumbo
Hum, have you a idea how to deal with Pchar and Callback-Procedure ? Welcome to real JNI programming :) For this, you can no longer ignore the first 2 parameters. PChar can't be passed to Java AFAIK (it will violate Java safety rule). However, there's another way around: expect a jstring instead

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread fredvs
It's JNI requirement, I wonder it could work without as it may corrupt the stack. The first parameter is the JVM environment, the second is the Java object (or class in case of static method), the rest is actual parameters to the function. Yep, you are right, it was working only for function

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread fredvs
Welcome to real JNI programming :) Yep, i will study deeply JNI and the JNI Pascal wrapper. See you later. ;-) Thanks. - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Access-fpc-libraries-with-Java-tp5718791p5718810.html Sent from the

Re: [fpc-pascal] FPC 2.6.4 for GO32

2014-03-28 Thread Lubomír Čabla
I have only good news... The window list with ALT+0 works, good job, thank you. Yes, I am using the option -Cr just for debugging purpose. Did you try to use -O- to recompile all rtl/packages to rule out optimization error? Not yet, because I found the cause of the freezing program FP.EXE when