Re: Getting the jBase DP (data pointer) of the current session when using pure C

2020-03-06 Thread Peter Falson
Whichever method you use to get a dp, it is up to you to store it in a 
persistent object. 

Sent from my iPhone

> On Mar 6, 2020, at 2:56 PM, Igor Osmolovskiy  wrote:
> 
> 
> Peter, we are using jBase 5.1
> 
> I've now tried  to use
>  static DPSTRUCT *dp = jbase_getdp_nocreate(NULL,NULL,1,NULL);
> but it still creates a new session...
> 
> Would that be possible maybe to give an example of how jbase_getdp_nocreate() 
> could be used please?
> Its name sounds like intending not to create a new dp :)
> thanks
> 
> среда, 4 марта 2020 г., 21:08:25 UTC+1 пользователь pfalson написал:
>> 
>> What version of jBASE do you have?
>> 
>> Sent from my iPhone
>> 
 On Mar 4, 2020, at 10:55 AM, Igor Osmolovskiy  wrote:
 
>>> 
>>> Thanks Peter, would be really helpful!
>>> 
>>> I've tried two ways
>>> 1. ctypes library. I managed to call a JBC function but it requires quite a 
>>> lot work as the explicit variable types are required in this case. So all 
>>> the transformations from PythonObj to a C type is required for each 
>>> argument. Also in many cases polymorphismе would be required as JBC 
>>> arguments often assume different types.
>>> 2. building a python library via distutils and working with PythonObj only. 
>>> As I've mentioned already this works but was not able to get rid of the 
>>> additional session being created at the step of "import lib" in python code.
>>> 
>>> среда, 4 марта 2020 г., 16:11:12 UTC+1 пользователь pfalson написал:
 
 We have some examples of python calling a subroutine and vice versa. I 
 will dig around. 
 
 Sent from my iPhone
 
>> On Mar 4, 2020, at 7:05 AM, Igor Osmolovskiy  wrote:
>> 
> 
> Hello
> pls see my response to Jim with the code sample
> 
> вторник, 3 марта 2020 г., 21:06:27 UTC+1 пользователь pfalson написал:
>> 
>> Can you post some code?
>> 
>> Sent from my iPhone
>> 
 On Mar 3, 2020, at 11:19 AM, Igor Osmolovskiy  wrote:
 
>>> 
>>> Dear all
>>> 
>>> I need the jBase DP (data pointer) to be initialized. I've actually 
>>> managed to initialize it by calling the jbase_getdp(). But in both 
>>> cases the new child session is created in jshell (and gets removed 
>>> automatically after the code has been executed).
>>> 
>>> So I am wondering: is there a possibility to retrieve and use the 
>>> current session DP somehow? So that no child session would get created
>>> 
>>> Any advice would be highly appreciated
>>> 
>>> Thanks in advance
>>> 
>>> 
>>> PS: to the admin, it is actually a jBase related question rather than 
>>> TAFC. Thanks
>>> 
>>> 
>>> Kind regards,
>>> Igor
>>> -- 
>>> -- 
>>> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>>>  
>>> To post, send email to jb...@googlegroups.com
>>> To unsubscribe, send email to jbase-un...@googlegroups.com
>>> For more options, visit this group at 
>>> http://groups.google.com/group/jBASE?hl=en
>>> 
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "jBASE" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to jb...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jbase/73153581-25ae-493a-95f6-8afc5cdf7813%40googlegroups.com.
> 
> -- 
> -- 
> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>  
> To post, send email to jb...@googlegroups.com
> To unsubscribe, send email to jbase-un...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/jBASE?hl=en
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "jBASE" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jb...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jbase/5c46377f-4c68-4f50-a5fb-9d1d8164232b%40googlegroups.com.
>>> 
>>> -- 
>>> -- 
>>> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>>>  
>>> To post, send email to jb...@googlegroups.com
>>> To unsubscribe, send email to jbase-un...@googlegroups.com
>>> For more options, visit this group at 
>>> http://groups.google.com/group/jBASE?hl=en
>>> 
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "jBASE" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to jb...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jbase/8ed5e66b-8076-495b-8b66-c7db7d4e8629%40googlegroups.com.
> 
> -- 
> -- 
> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>  
> To post, send email to jBASE@googlegroups.com
>

Re: Getting the jBase DP (data pointer) of the current session when using pure C

2020-03-06 Thread Peter Falson
That creates a regular jBASE session dp. The null args are more for internal 
use. 

Sent from my iPhone

> On Mar 6, 2020, at 2:56 PM, Igor Osmolovskiy  wrote:
> 
> Peter, thanks for the code sample
> 
> Could you please elaborate on what exactly the next line means
> jbase_getdpEX(NULL,NULL,1,NULL)
> 
> Thanks
> Igor
> 
> -- 
> -- 
> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
> 
> To post, send email to jBASE@googlegroups.com
> To unsubscribe, send email to jbase-unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/jBASE?hl=en
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "jBASE" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jbase+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jbase/050fac31-e1aa-46e0-99bd-59d6f8dcdea7%40googlegroups.com.

-- 
-- 
IMPORTANT: T24/Globus posts are no longer accepted on this forum.

To post, send email to jBASE@googlegroups.com
To unsubscribe, send email to jbase-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jbase/28A9D49D-1995-4B04-9964-67D449E0D708%40gmail.com.


Re: Getting the jBase DP (data pointer) of the current session when using pure C

2020-03-06 Thread Igor Osmolovskiy
Peter, we are using jBase 5.1

I've now tried  to use
 static DPSTRUCT *dp = jbase_getdp_nocreate(NULL,NULL,1,NULL);
but it still creates a new session...

Would that be possible maybe to give an example of how 
jbase_getdp_nocreate() could be used please?
Its name sounds like intending not to create a new dp :)
thanks

среда, 4 марта 2020 г., 21:08:25 UTC+1 пользователь pfalson написал:
>
> What version of jBASE do you have?
>
> Sent from my iPhone
>
> On Mar 4, 2020, at 10:55 AM, Igor Osmolovskiy  > wrote:
>
> 
> Thanks Peter, would be really helpful!
>
> I've tried two ways
> 1. ctypes library. I managed to call a JBC function but it requires quite 
> a lot work as the explicit variable types are required in this case. So all 
> the transformations from PythonObj to a C type is required for each 
> argument. Also in many cases polymorphismе would be required as JBC 
> arguments often assume different types.
> 2. building a python library via distutils and working with PythonObj 
> only. As I've mentioned already this works but was not able to get rid of 
> the additional session being created at the step of "import lib" in python 
> code.
>
> среда, 4 марта 2020 г., 16:11:12 UTC+1 пользователь pfalson написал:
>>
>> We have some examples of python calling a subroutine and vice versa. I 
>> will dig around. 
>>
>> Sent from my iPhone
>>
>> On Mar 4, 2020, at 7:05 AM, Igor Osmolovskiy  wrote:
>>
>> 
>> Hello
>> pls see my response to Jim with the code sample
>>
>> вторник, 3 марта 2020 г., 21:06:27 UTC+1 пользователь pfalson написал:
>>>
>>> Can you post some code?
>>>
>>> Sent from my iPhone
>>>
>>> On Mar 3, 2020, at 11:19 AM, Igor Osmolovskiy  wrote:
>>>
>>> 
>>> Dear all
>>>
>>> I need the jBase DP (data pointer) to be initialized. I've actually 
>>> managed to initialize it by calling the jbase_getdp(). But in both cases 
>>> the new child session is created in jshell (and gets removed automatically 
>>> after the code has been executed).
>>>
>>> So I am wondering: is there a possibility to retrieve and use the 
>>> current session DP somehow? So that no child session would get created
>>>
>>> Any advice would be highly appreciated
>>>
>>> Thanks in advance
>>>
>>>
>>> PS: to the admin, it is actually a jBase related question rather than 
>>> TAFC. Thanks
>>>
>>>
>>> Kind regards,
>>> Igor
>>>
>>> -- 
>>> -- 
>>> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>>>  
>>> To post, send email to jb...@googlegroups.com
>>> To unsubscribe, send email to jbase-un...@googlegroups.com
>>> For more options, visit this group at 
>>> http://groups.google.com/group/jBASE?hl=en
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "jBASE" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to jb...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jbase/73153581-25ae-493a-95f6-8afc5cdf7813%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>> -- 
>> -- 
>> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>>  
>> To post, send email to jb...@googlegroups.com
>> To unsubscribe, send email to jbase-un...@googlegroups.com
>> For more options, visit this group at 
>> http://groups.google.com/group/jBASE?hl=en
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "jBASE" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jb...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jbase/5c46377f-4c68-4f50-a5fb-9d1d8164232b%40googlegroups.com
>>  
>> 
>> .
>>
>> -- 
> -- 
> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>  
> To post, send email to jb...@googlegroups.com 
> To unsubscribe, send email to jbase-un...@googlegroups.com 
> For more options, visit this group at 
> http://groups.google.com/group/jBASE?hl=en
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "jBASE" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jb...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jbase/8ed5e66b-8076-495b-8b66-c7db7d4e8629%40googlegroups.com
>  
> 
> .
>
>

-- 
-- 
IMPORTANT: T24/Globus posts are no longer accepted on this forum.

To post, send email to jBASE@googlegroups.com
To unsubscribe, send email to jbase-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google

Re: Getting the jBase DP (data pointer) of the current session when using pure C

2020-03-06 Thread Igor Osmolovskiy
Marco, thank you for your shared experience

Regarding dp initialization the next was observed: if your starting point is 
JBC code that will in turn call the C extension, then dp is really initialized 
automatically. Whereas if you launch C/Python directly then dp is NULL and smth 
has to be done manually

-- 
-- 
IMPORTANT: T24/Globus posts are no longer accepted on this forum.

To post, send email to jBASE@googlegroups.com
To unsubscribe, send email to jbase-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jbase/1826d6f5-b4f5-4165-b9b4-d2b4d444ccbb%40googlegroups.com.


Re: Getting the jBase DP (data pointer) of the current session when using pure C

2020-03-06 Thread Igor Osmolovskiy
Peter, thanks for the code sample

Could you please elaborate on what exactly the next line means
jbase_getdpEX(NULL,NULL,1,NULL)

Thanks
Igor

-- 
-- 
IMPORTANT: T24/Globus posts are no longer accepted on this forum.

To post, send email to jBASE@googlegroups.com
To unsubscribe, send email to jbase-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jbase/050fac31-e1aa-46e0-99bd-59d6f8dcdea7%40googlegroups.com.