Xojo Conferences
XDCMay2019MiamiUSA

Returning date (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: Cross-platform
Next thread: Window handle problems


macosx and unix paths   -   GOLD
  Returning date   -   Dan Cooper
   Re: Returning date   -   Christian Schmitz
    Re: Returning date   -   Jonathan Johnson
     Re: Returning date   -   Dan Cooper
   Re: Returning date   -   Christian Schmitz

Returning date
Date: 01.11.04 12:37 (Mon, 01 Nov 2004 11:37:24 +0000)
From: Dan Cooper
Is it possible to return a date object from a plugin?

I have finally got my control working properly and all properties
working, I just need to return a date from it if possible.

Thanks,
Dan.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Returning date
Date: 01.11.04 12:58 (Mon, 1 Nov 2004 12:58:32 +0100)
From: Christian Schmitz
Dan Cooper <<email address removed>> wrote:

> Is it possible to return a date object from a plugin?

sure. Just pass it as all other objects.

Mfg
Christian

Re: Returning date
Date: 01.11.04 14:31 (Mon, 1 Nov 2004 07:31:39 -0600)
From: Jonathan Johnson

On Nov 1, 2004, at 6:29 AM, Dan Cooper wrote:

> Not sure what you mean there, I cannot find a way to create a REALdate
> or similar, what should the return type be? Should I just return the
> SYSTEMTIME object?

There are no REALbasic objects that can be directly swapped in and out
of system types. The same goes for Strings (you must use CString()) and
arrays. You need to return a date, which can be done like:

REALobject date = REALnewInstance("Date");

if (!date) {
// You shouldn't ever get here.
return nil;
}

REALSetPropValue( date, "TotalSeconds", (double)1000.0 ); // Of course,
set it appropriately

return date;

HTH,
Jon

Re: Returning date
Date: 01.11.04 15:12 (Mon, 01 Nov 2004 14:12:34 +0000)
From: Dan Cooper
Thanks!

That worked perfectly!

Dan.


Jonathan Johnson wrote:

>
> On Nov 1, 2004, at 6:29 AM, Dan Cooper wrote:
>
>> Not sure what you mean there, I cannot find a way to create a
>> REALdate or similar, what should the return type be? Should I just
>> return the SYSTEMTIME object?
>
> There are no REALbasic objects that can be directly swapped in and out
> of system types. The same goes for Strings (you must use CString())
> and arrays. You need to return a date, which can be done like:
>
> REALobject date = REALnewInstance("Date");
>
> if (!date) {
> // You shouldn't ever get here.
> return nil;
> }
>
> REALSetPropValue( date, "TotalSeconds", (double)1000.0 ); // Of
> course, set it appropriately
>
> return date;
>
> HTH,
> Jon
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Returning date
Date: 01.11.04 14:49 (Mon, 1 Nov 2004 14:49:00 +0100)
From: Christian Schmitz
Dan Cooper <<email address removed>> wrote:

> Not sure what you mean there, I cannot find a way to create a REALdate
> or similar, what should the return type be? Should I just return the
> SYSTEMTIME object?

REALobject is the return type.

REALnewInstance("Date") should create one.

Mfg
Christian