Re: [fpc-pascal] GLPT v0.1.1 released
On Tue, Oct 9, 2018 at 7:26 AM Ingemar Ragnemalm wrote: > Yet another API for GUI-OpenGL glue? I would suggest that the closer to > an existing API (i.e. GLUT) the better. You are fairly close now so > maybe making it a GLUT replacement is just a matter of renaming? > True, GLPT is close to GLUT, but also to GLFW. I am not trying to create an emulator of any of the two, but rather create something that works perfectly for FPC instead. It should be relatively easy to create a wrapper unit though for GLUT and GLFW users. The same for creating a dynamic library for C users. :) > All your demos are old-style. I can't even see a single shader anywhere. > I think you should use modern OpenGL more. For instance, I have made a > modern version of the dear old Gears demo: > > http://computer-graphics.se/demopage/glut-gears.html > > Great! Can I use it for GLPT? Not converted to C yet, but it is converted to modern OpenGL. I also > have a bunch of other demos that exist in FPC versions that you can have. > Please share anything you can or are willing to. I need use cases to test the library and help new users to get started.. Rgds, Darius ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] GLPT v0.1.1 released
Any work on OpenGL is of interest to me. I am working with it every day, have written two course books, a GLUT replacement and numerous demos, most in C though (because my students don't learn Pascal any more). Two things come to mind: Yet another API for GUI-OpenGL glue? I would suggest that the closer to an existing API (i.e. GLUT) the better. You are fairly close now so maybe making it a GLUT replacement is just a matter of renaming? All your demos are old-style. I can't even see a single shader anywhere. I think you should use modern OpenGL more. For instance, I have made a modern version of the dear old Gears demo: http://computer-graphics.se/demopage/glut-gears.html Not converted to C yet, but it is converted to modern OpenGL. I also have a bunch of other demos that exist in FPC versions that you can have. /Ingemar Den 2018-10-09 kl. 00:46, Darius Blaszyk wrote: Hi all, I just released the first complete version of GLPT. Thanks to Ryan Joseph GLPT now supports Linux, MacOSX and Windows. Anyone interested in the project is invited to test, use, discuss and code. Please submit found or proposed issues on GitHub. https://github.com/daar/GLPT/releases Rgds Darius ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] mips cross compiler libraries (and crti.o) problem
El 8/10/18 a les 16:25, Luca Olivetti ha escrit: 3) putting in the PATH a custom mips-gnu-linux-ld that adds an --rpath=/home/luca/mipslibs/ before calling ld [*] Duh, instead of --rpath I used --library-path and it got me further Free Pascal Compiler version 3.0.4 [2018/10/07] for mips Copyright (c) 1993-2017 by Florian Klaempfl and others Target OS: Linux for MIPSEB Compiling lgmounter.pas Assembling lgmounter Linking lgmounter /usr/bin/mips-linux-gnu-ld: warning: link.res contains output sections; did you forget -T? /usr/bin/mips-linux-gnu-ld: skipping incompatible /usr/lib/x86_64-linux-gnu/crti.o when searching for /usr/lib/x86_64-linux-gnu/crti.o /usr/bin/mips-linux-gnu-ld: cannot find /usr/lib/x86_64-linux-gnu/crti.o lgmounter.pas(274) Error: Error while linking lgmounter.pas(274) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Then I modified link.res to reference crti.o $ mips-linux-gnu-ld link.res /usr/bin/mips-linux-gnu-ld: warning: link.res contains output sections; did you forget -T? /usr/bin/mips-linux-gnu-ld: skipping incompatible /usr/lib/x86_64-linux-gnu/crtn.o when searching for /usr/lib/x86_64-linux-gnu/crtn.o /usr/bin/mips-linux-gnu-ld: cannot find /usr/lib/x86_64-linux-gnu/crtn.o Did the same for crtn.o $ mips-linux-gnu-ld link.res /usr/bin/mips-linux-gnu-ld: warning: link.res contains output sections; did you forget -T? /usr/bin/mips-linux-gnu-ld: /home/luca/mipslibs/crti.o: warning: linking abicalls files with non-abicalls files /usr/bin/mips-linux-gnu-ld: Warning: a.out uses -mhard-float (set by /usr/local/lib/fpc/3.0.4/units/mips-linux/rtl/cprt0.o), /home/luca/mipslibs/crtbegin.o uses -msoft-float /usr/bin/mips-linux-gnu-ld: lgmounter.o: warning: linking abicalls files with non-abicalls files /usr/bin/mips-linux-gnu-ld: synaser.o: warning: linking abicalls files with non-abicalls files /usr/bin/mips-linux-gnu-ld: synafpc.o: warning: linking abicalls files with non-abicalls files /usr/bin/mips-linux-gnu-ld: synautil.o: warning: linking abicalls files with non-abicalls files /usr/bin/mips-linux-gnu-ld: Warning: a.out uses -mhard-float (set by /usr/local/lib/fpc/3.0.4/units/mips-linux/rtl/cprt0.o), /home/luca/mipslibs/crtend.o uses -msoft-float /usr/local/lib/fpc/3.0.4/units/mips-linux/rtl/cprt0.o: In function `_start': (.text+0x60): undefined reference to `__libc_csu_init' (.text+0x64): undefined reference to `__libc_csu_fini' (.text+0x74): undefined reference to `__libc_start_main' lgmounter.o: In function `P$LGMOUNTER_$$_LOG$ANSISTRING': lgmounter.pas:(.text.n_p$lgmounter_$$_log$ansistring+0x9c): undefined reference to `syslog' /usr/local/lib/fpc/3.0.4/units/mips-linux/rtl/dynlibs.o: In function `DYNLIBS_$$_DOLOADLIBRARY$RAWBYTESTRING$$LONGINT': dynlibs.pas:(.text.n_dynlibs_$$_doloadlibrary$rawbytestring$$longint+0x28): undefined reference to `dlopen' /usr/local/lib/fpc/3.0.4/units/mips-linux/rtl/dynlibs.o: In function `DYNLIBS_$$_GETPROCEDUREADDRESS$LONGINT$ANSISTRING$$POINTER': dynlibs.pas:(.text.n_dynlibs_$$_getprocedureaddress$longint$ansistring$$pointer+0x24): undefined reference to `dlsym' /usr/local/lib/fpc/3.0.4/units/mips-linux/rtl/dynlibs.o: In function `DYNLIBS_$$_UNLOADLIBRARY$LONGINT$$BOOLEAN': dynlibs.pas:(.text.n_dynlibs_$$_unloadlibrary$longint$$boolean+0x18): undefined reference to `dlclose' /usr/local/lib/fpc/3.0.4/units/mips-linux/rtl/dynlibs.o: In function `DYNLIBS_$$_GETLOADERRORSTR$$SHORTSTRING': dynlibs.pas:(.text.n_dynlibs_$$_getloaderrorstr$$shortstring+0x20): undefined reference to `dlerror' /usr/local/lib/fpc/3.0.4/units/mips-linux/rtl/dl.o: In function `DL_$$_UNIXGETMODULEBYADDR$POINTER$POINTER$OPENSTRING': dl.pp:(.text.n_dl_$$_unixgetmodulebyaddr$pointer$pointer$openstring+0x60): undefined reference to `dladdr' Bye -- Luca ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] MacOSX Mojave
I meant to mention in my original message that I needed to add OPT=-Fl/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib to the end of the make distclean install I use to compile the trunk compiler. My fpc.cfg also has #ifdef darwin, rather then #ifdef i386. Colin On 08/10/2018 22:19, Michael Ring wrote: I just realized on a freshly set up computer that there is one more issue, I tried to build the trunk x86_64 compiler and compile fails: /bin/mkdir -p x86_64/units/x86_64-darwin /Applications/Xcode.app/Contents/Developer/usr/bin/make ./msg2inc /usr/local/bin/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/Users/ring/devel/fpc/rtl/units/x86_64-darwin -Fix86_64 -FE. -FUx86_64/units/x86_64-darwin -dRELEASE -dx86_64 -dGDB -dBROWSERLOG -Fux86 -Sew -FE. utils/msg2inc.pp ld: file not found: /usr/lib/crt1.10.5.o An error occurred while linking msg2inc.pp(822,51) Error: Error while linking msg2inc.pp(822,51) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted problem is that ppcx64 is called with option -n so fpc.cfg gets ignored. I guess the only way to fix this is to change the makefile itself. Also, one thing I do not understand in /etc/fpc.cfg installed by the 3.0.4a installer, why if -Fl ifdef'ed for i386 only? #ifdef cpui386 -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib #endif Here's the patch for the makefile that worked for me: Index: compiler/Makefile === --- compiler/Makefile (revision 39905) +++ compiler/Makefile (working copy) @@ -4248,7 +4248,7 @@ clean: tempclean execlean cleanall $(addsuffix _clean,$(CPC_TARGET)) $(addsuffix _clean,$(TARGET_DIRS)) distclean: tempclean execlean cleanall $(addsuffix _clean,$(ALLTARGETS)) $(addsuffix _distclean,$(TARGET_DIRS)) $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(COMPILERUTILSDIR)/msg2inc.pp - $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp + $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib msgtxt.inc: $(MSGFILE) $(MAKE) $(MSG2INC) $(MSG2INC) $(MSGFILE) msg msg @@ -4328,7 +4328,7 @@ endif $(COMPILER) version.pas endif - $(COMPILER) pp.pas + $(COMPILER) pp.pas -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib $(EXECPPAS) $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME) .PHONY: cycle fullcycle wpocycle Index: compiler/Makefile.fpc === --- compiler/Makefile.fpc (revision 39905) +++ compiler/Makefile.fpc (working copy) @@ -538,7 +538,7 @@ # $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(COMPILERUTILSDIR)/msg2inc.pp - $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp + $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib # The msgtxt.inc only depends on the error?.msg file, not on msg2inc, # because that one will be new almost everytime @@ -641,7 +641,7 @@ endif $(COMPILER) version.pas endif - $(COMPILER) pp.pas + $(COMPILER) pp.pas -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib $(EXECPPAS) $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME) Michael Am 07.10.18 um 19:38 schrieb Jonas Maebe: On 06/10/18 16:01, C Western wrote: Possibly unwisely, I updated by Mac to Mojave. I found that things (including 32 bit apps) worked, but: I had to add -Fl/Applications/Xcode.app/Con tents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib to my fpc.cfg to avoid "/usr/lib/crt1.o not found" errors. It seems as though the startup files are no longer in /usr/lib I've created an FPC 3.0.4a release for macOS yesterday that adds the appropriate directives to /etc/fpc.cfg (no changes to the compiler). Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] MacOSX Mojave
I just realized on a freshly set up computer that there is one more issue, I tried to build the trunk x86_64 compiler and compile fails: /bin/mkdir -p x86_64/units/x86_64-darwin /Applications/Xcode.app/Contents/Developer/usr/bin/make ./msg2inc /usr/local/bin/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/Users/ring/devel/fpc/rtl/units/x86_64-darwin -Fix86_64 -FE. -FUx86_64/units/x86_64-darwin -dRELEASE -dx86_64 -dGDB -dBROWSERLOG -Fux86 -Sew -FE. utils/msg2inc.pp ld: file not found: /usr/lib/crt1.10.5.o An error occurred while linking msg2inc.pp(822,51) Error: Error while linking msg2inc.pp(822,51) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted problem is that ppcx64 is called with option -n so fpc.cfg gets ignored. I guess the only way to fix this is to change the makefile itself. Also, one thing I do not understand in /etc/fpc.cfg installed by the 3.0.4a installer, why if -Fl ifdef'ed for i386 only? #ifdef cpui386 -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib #endif Here's the patch for the makefile that worked for me: Index: compiler/Makefile === --- compiler/Makefile (revision 39905) +++ compiler/Makefile (working copy) @@ -4248,7 +4248,7 @@ clean: tempclean execlean cleanall $(addsuffix _clean,$(CPC_TARGET)) $(addsuffix _clean,$(TARGET_DIRS)) distclean: tempclean execlean cleanall $(addsuffix _clean,$(ALLTARGETS)) $(addsuffix _distclean,$(TARGET_DIRS)) $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(COMPILERUTILSDIR)/msg2inc.pp - $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp + $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib msgtxt.inc: $(MSGFILE) $(MAKE) $(MSG2INC) $(MSG2INC) $(MSGFILE) msg msg @@ -4328,7 +4328,7 @@ endif $(COMPILER) version.pas endif - $(COMPILER) pp.pas + $(COMPILER) pp.pas -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib $(EXECPPAS) $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME) .PHONY: cycle fullcycle wpocycle Index: compiler/Makefile.fpc === --- compiler/Makefile.fpc (revision 39905) +++ compiler/Makefile.fpc (working copy) @@ -538,7 +538,7 @@ # $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(COMPILERUTILSDIR)/msg2inc.pp - $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp + $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib # The msgtxt.inc only depends on the error?.msg file, not on msg2inc, # because that one will be new almost everytime @@ -641,7 +641,7 @@ endif $(COMPILER) version.pas endif - $(COMPILER) pp.pas + $(COMPILER) pp.pas -Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib $(EXECPPAS) $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME) Michael Am 07.10.18 um 19:38 schrieb Jonas Maebe: On 06/10/18 16:01, C Western wrote: Possibly unwisely, I updated by Mac to Mojave. I found that things (including 32 bit apps) worked, but: I had to add -Fl/Applications/Xcode.app/Con tents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib to my fpc.cfg to avoid "/usr/lib/crt1.o not found" errors. It seems as though the startup files are no longer in /usr/lib I've created an FPC 3.0.4a release for macOS yesterday that adds the appropriate directives to /etc/fpc.cfg (no changes to the compiler). Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] mips cross compiler libraries (and crti.o) problem
Hello, I built an fpc-3.0.4 mips cross compiler on kubuntu 18.04 using the prepackaged mips binutils with make all BINUTILSPREFIX=mips-linux-gnu- CPU_TARGET=mips OS_TARGET=linux sudo make crossinstall BINUTILSPREFIX=mips-linux-gnu- CPU_TARGET=mips OS_TARGET=linux When I try to compile the program I get this error: luca@seis:~/Datos/lgmounter$ ppcrossmips lgmounter.pas Free Pascal Compiler version 3.0.4 [2018/10/07] for mips Copyright (c) 1993-2017 by Florian Klaempfl and others Target OS: Linux for MIPSEB Compiling lgmounter.pas Compiling synaser.pas Compiling synafpc.pas Assembling synafpc Compiling synautil.pas synautil.pas(564,51) Warning: Symbol "TimeSeparator" is deprecated synautil.pas(1804,43) Warning: Symbol "ShortMonthNames" is deprecated synautil.pas(1805,42) Warning: Symbol "ShortMonthNames" is deprecated Assembling synautil synaser.pas(2278,41) Warning: range check error while evaluating constants (4294967295 must be between -2147483648 and 2147483647) Assembling synaser Assembling lgmounter Linking lgmounter lgmounter.pas(274) Warning: "crtbegin.o" not found, this will probably cause a linking failure lgmounter.pas(274) Warning: "crtend.o" not found, this will probably cause a linking failure mips-linux-gnu-ld: warning: link.res contains output sections; did you forget -T? mips-linux-gnu-ld: skipping incompatible /usr/lib/x86_64-linux-gnu/crti.o when searching for /usr/lib/x86_64-linux-gnu/crti.o mips-linux-gnu-ld: cannot find /usr/lib/x86_64-linux-gnu/crti.o mips-linux-gnu-ld: skipping incompatible /usr/lib/x86_64-linux-gnu//libdl.so when searching for -ldl mips-linux-gnu-ld: skipping incompatible /usr/lib/x86_64-linux-gnu//libdl.a when searching for -ldl mips-linux-gnu-ld: skipping incompatible /usr/lib/i386-linux-gnu//libdl.so when searching for -ldl mips-linux-gnu-ld: skipping incompatible /usr/lib/i386-linux-gnu//libdl.a when searching for -ldl mips-linux-gnu-ld: cannot find -ldl mips-linux-gnu-ld: skipping incompatible /usr/lib/x86_64-linux-gnu//libc.so when searching for -lc mips-linux-gnu-ld: skipping incompatible /usr/lib/x86_64-linux-gnu//libc.a when searching for -lc mips-linux-gnu-ld: skipping incompatible /usr/lib/i386-linux-gnu//libc.so when searching for -lc mips-linux-gnu-ld: skipping incompatible /usr/lib/i386-linux-gnu//libc.a when searching for -lc mips-linux-gnu-ld: cannot find -lc lgmounter.pas(274) Error: Error while linking lgmounter.pas(274) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted I copied libc.so and libdl.so from the target into the directory /home/luca/mipslibs I also had to copy crtbegin.o crtend.o crti.o crtn.o from an openwrt buildroot for the target (is that correct? I couldn't find them on the target) What I tried: 1) putting this in /etc/fpc.cfg #ifdef cpumips -Fl/home/luca/mipslibs #endif 2) adding a file in /etc/ld.so.conf.d with /home/luca/mipslibs and running ldconfig 3) putting in the PATH a custom mips-gnu-linux-ld that adds an --rpath=/home/luca/mipslibs/ before calling ld [*] but the error message is always the same. What am I doing wrong? Bye -- Luca ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] GLPT v0.1.1 released
Hi all, I just released the first complete version of GLPT. Thanks to Ryan Joseph GLPT now supports Linux, MacOSX and Windows. Anyone interested in the project is invited to test, use, discuss and code. Please submit found or proposed issues on GitHub. https://github.com/daar/GLPT/releases Rgds Darius ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using REST based Services
Hello Alex, sounds very interesting, but in this case I'm only the user of an API. Look there: http://tika.apache.org/ Tika will run as a service and my task is to stick files in an get the contents back. So nothing to debug regarding the API on my side. Thank you anyway, Marc On Mon, 2018-10-08 at 02:04 -0400, Alexander Grotewohl wrote: > A bit off topic for the list but I've used a program called "Insomnia" > which is a client for debugging REST APIs and it was incredibly handy. > Especially so you don't try everything under the sun before, for > example, realizing your API key is incorrect. > > Alex > > > On 10/7/2018 4:03 PM, Marc Santhoff wrote: > > On Sun, 2018-10-07 at 00:23 +0200, Michael Van Canneyt wrote: > > > On Sat, 6 Oct 2018, Marc Santhoff wrote: > > > > > > > Hi, > > > > > > > > being rather agnostic regarding web techniques I have to ask: > > > > > > > > What module or unit is best for being used when calling web services? > > > > > > fphttpclient is what you need. > > > > OK, fine. I have used that already. > > > > > > I want to try using Apache Tika running as a server for extracting the > > > > contents of files. Files are transferred using HTTP PUT method- > > > > > > > > See there for a quick overview: > > > > https://wiki.apache.org/tika/TikaJAXRS#Services > > > > > > Rest services are not very standardized. Each service is different, and > > > therefor the lowest common denominator is the use of the HTTP protocol. > > > > I see. It is simple enough to put a request together like when using curl > > in a > > terminal. > > > > > Which is exactly what is encapsulated in the fphttpclient unit. > > > > > > The demo programs for fphttpclient should get you going. > > > > Many thanks! > > Marc > > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal -- Marc Santhoff ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Listing the type (even as string) of the parameters and the return of a function
silvioprog schrieb am Mo., 8. Okt. 2018, 10:11: > Hi. > > First, thanks for the great work in the invoke.inc for win64! ☺ > > So, consider the following example: > > uses RTTI; > > type > TFoo = class > public > function Bar(const A: string; B: Integer): string; > end; > > function TFoo.Bar(const A: string; B: Integer): string; > begin > end; > > var > m: TRttiMethod; > p: TRttiParameter; > begin > m := TRttiContext.Create.GetType(TFoo.ClassInfo).GetMethod('Bar'); > Writeln('m: ', m.ReturnType.ToString); > for p in m.GetParameters do > Writeln(' p: ', p.ParamType.ToString); > end. > > in Delphi, it returns: > > m: string > p: string > p: Integer > > in the current stage of RTTI or TypInfo, is there any way to retrieve the > type (even as string) of the parameters and the return of a function > passing its name as string and only the vtypeinfo of the instance of showed > in the above example? > Short answer: No. Long answer: No. The extended RTTI required for that is currently only generated for interfaces with $M+ set. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Listing the type (even as string) of the parameters and the return of a function
Hi. First, thanks for the great work in the invoke.inc for win64! ☺ So, consider the following example: uses RTTI; type TFoo = class public function Bar(const A: string; B: Integer): string; end; function TFoo.Bar(const A: string; B: Integer): string; begin end; var m: TRttiMethod; p: TRttiParameter; begin m := TRttiContext.Create.GetType(TFoo.ClassInfo).GetMethod('Bar'); Writeln('m: ', m.ReturnType.ToString); for p in m.GetParameters do Writeln(' p: ', p.ParamType.ToString); end. in Delphi, it returns: m: string p: string p: Integer in the current stage of RTTI or TypInfo, is there any way to retrieve the type (even as string) of the parameters and the return of a function passing its name as string and only the vtypeinfo of the instance of showed in the above example? Thanks in advance! -- Silvio Clécio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using REST based Services
A bit off topic for the list but I've used a program called "Insomnia" which is a client for debugging REST APIs and it was incredibly handy. Especially so you don't try everything under the sun before, for example, realizing your API key is incorrect. Alex On 10/7/2018 4:03 PM, Marc Santhoff wrote: On Sun, 2018-10-07 at 00:23 +0200, Michael Van Canneyt wrote: On Sat, 6 Oct 2018, Marc Santhoff wrote: Hi, being rather agnostic regarding web techniques I have to ask: What module or unit is best for being used when calling web services? fphttpclient is what you need. OK, fine. I have used that already. I want to try using Apache Tika running as a server for extracting the contents of files. Files are transferred using HTTP PUT method- See there for a quick overview: https://wiki.apache.org/tika/TikaJAXRS#Services Rest services are not very standardized. Each service is different, and therefor the lowest common denominator is the use of the HTTP protocol. I see. It is simple enough to put a request together like when using curl in a terminal. Which is exactly what is encapsulated in the fphttpclient unit. The demo programs for fphttpclient should get you going. Many thanks! Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal