Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help with basic OO question

Former Member
0 Likes
380

Right!

I know that '->' is for calling a method from a class.

I also know that '=>' is used calling a static method (whatever that is?).

But what on earth is '?=' used for???

Anyone got any ideas...

Thanking you kindly

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
358

?= is use for casting. Narrowing and widening.

You will usually see this inside of a catch/endcatch.

    catch system-exceptions move_cast_error = 1.
      r_checking ?= r_account.
    call method r_account->show_balance.
    endcatch.

Check out this post.

Regards,

Rich Heilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
359

?= is use for casting. Narrowing and widening.

You will usually see this inside of a catch/endcatch.

    catch system-exceptions move_cast_error = 1.
      r_checking ?= r_account.
    call method r_account->show_balance.
    endcatch.

Check out this post.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
358

oh right that's it, casting...

That something to do with what is inherited from superclasses...

Thansk for the memory jog!