Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Android / Re: dwindows for Android
« Last post by PierceNg on Today at 10:54:44 am »
Coming back to this after a (long) break, I've now built a demo/exercise app using a webview widget for the user interface, with bidirectional Javascript-Pascal in-process RPC.

The main body of the code loads in-app static content, then binds the names 'HostSayHello' and 'HostExit' for callback to Pascal code from Javascript. Said Pascal code in turns invokes Javascript to manipulate the DOM.

Code: Pascal  [Select][+][-]
  1.   webwidget := dw_html_new(1001); // 1001 is an identifier
  2.   if webwidget <> nil then
  3.     begin
  4.       dw_box_pack_start(mainwindow, webwidget, 0, 0, DW_TRUE, DW_TRUE, 0);
  5.       dw_html_url(webwidget, 'file:///android_asset/index.html');
  6.       dw_html_javascript_add(webwidget, 'HostSayHello');
  7.       dw_html_javascript_add(webwidget, 'HostExit');
  8.       dw_signal_connect(webwidget, DW_SIGNAL_HTML_MESSAGE, @html_message_callback, nil);
  9.     end;

Screenshot of the app running in Android emulator attached.
2
FPC development / Re: create system unit from scratch
« Last post by Laksen on Today at 10:53:57 am »
jmp_buf is a record used to store the state of the CPU for the setjmp and longjmp procedures. This functionality is used for exception handling. They are already implemented for MIPS in rtl/mips/setjump*.inc which is included by systemh.inc

TExceptAddr is as the name hints also used for exception handling and implemented in a generic way shared by all the targets in excepth.inc included by systemh.inc
TGuid stores a GUID. The compiler needs to point to it during compilation when GUIDs are needed. Also implemented in a generic manner in objpash.inc included by systemh.inc


The key to implementing a systems unit is to get the proper defines, paths and system specific dummy functionality (usually residese in sys*/tthread/check.inc files) implemented. There's no documentation but you should see how other system units are structured
3
Beginners / Re: how to get class and method name from inside the method
« Last post by cdbc on Today at 10:52:22 am »
Hi
Try playing with:
Code: Pascal  [Select][+][-]
  1. lptr:= MethodAddress(Classname+.+{$I %CURRENTROUTINE%});
  2.  
Note: When you have this pointer, you can also use 'MethodName();' with it...
edit: I dunno if the 'ClassName'-part is necessary   %)
Regards Benny
4
Beginners / Re: how to get class and method name from inside the method
« Last post by Joanna on Today at 10:41:48 am »
Thanks blueicaro
That works great once I add classname +’.’

I also wonder if there is a way to get a pointer to procedure I’m in and then send the pointer to another error message procedure which would be able to extract procedure name and make error message
5
Databases / Re: Database standards OR Am I doing this right?
« Last post by paweld on Today at 10:38:35 am »
@egsuh: Generally, it should be the case that a record should have a semaphore set to inform other users that it is being edited.
But without information about the specific case, it is difficult to say anything.
6
FPC development / Re: create system unit from scratch
« Last post by Key-Real on Today at 10:34:10 am »
I gonna implement only the minimal requered code in the system unit

pls explain what  type

1)  jmp_buf
2) TExceptAddr
3) TGuid

do and what is minimal implementation of thouse.

I found https://wiki.lazarus.freepascal.org/System_unit

but there is no detailed explanation
7
Networking and Web Programming / Re: Who is Indy mattias?
« Last post by JuhaManninen on Today at 10:25:55 am »
What is the exact error message?
Mattias Gärtner has built the release packages of Lazarus for Linux and MacOS. His home path must be left somewhere although I don't know how it can affect the compilation of your project.
8
Hello,  you can use {$I %CURRENTROUTINE%}, more info: https://www.freepascal.org/docs-html/prog/progsu41.html#x48-470001.2.41

Here there is a example: https://forum.lazarus.freepascal.org/index.php?topic=49837.0

/BlueIcaro
9
Beginners / how to get class and method name from inside the method
« Last post by Joanna on Today at 10:04:21 am »
hello i want to get information about where in program an error occurs for instance
Code: Pascal  [Select][+][-]
  1. PROCEDURE TWINCONTROL_HELPER.CREATE_THIS_CONTROL(CONST TYPE_TO_CREATE:TGUI_CONTROL_CLASS;
  2.             VAR THIS_CONTROL: TCONTROL; CONST THE_NAME: SHORTSTRING);
  3. BEGIN
  4. IF (THIS_CONTROL <> NIL) OR (TYPE_TO_CREATE = TCONTROL)
  5.    THEN begin
  6.         ShowMessage('error in -> '+'PROCEDURE TWINCONTROL_HELPER.CREATE_THIS_CONTROL');
  7.         EXIT;
  8.         END;
  9.  END;
is there any way to get the "PROCEDURE TWINCONTROL_HELPER.CREATE_THIS_CONTROL" string by some other means so i can sent it to an external error showing procedure such as

PROCEDURE SHOW_ERROR (CONST ERROR_MESSAGE);
BEGIN
showmessage(error_message);
halt;
END;
10
Beginners / Re: [Solved] Find child controls by name
« Last post by Joanna on Today at 09:53:43 am »
i remember a long time ago i was creating many copies of the same control and it gave me a duplicate name error and i had to add code to give each one a unique name. maybe something has changed since then.In any case i always name my variables now.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018