NetTalk Central

Author Topic: Parent Caller  (Read 3207 times)

billbarker

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Parent Caller
« on: March 17, 2015, 03:23:42 AM »
I think I'm missing some very fundamental understanding here... how do I tell a procedure the parent caller... I assumed this was done automatically, but this code NEVER shows a parent:-
(taken from a standard server browse) - if I call the browse from a button on the 'update club' form, would I need to set the parent id somewhere?

  If False ! add range fields to sort order
  ElsIf (loc:Parent = 'UpdateClub')
    If Instring('PLA:CLUBURN',upper(loc:vOrder),1,1) = 0
      loc:vOrder = 'pla:ClubURN,' & loc:vorder
    End
  ElsIf (loc:Parent = 'UpdateTeamPlayer')
    If Instring('PLA:CLUBURN',upper(loc:vOrder),1,1) = 0
      loc:vOrder = 'pla:ClubURN,' & loc:vorder
    End
  End

! Start of "End of SetVorder routine"
! [Priority 5000]
  stop(loc:parent)
! End of "End of SetVorder routine"

and while on the subject.. what is the point of the condition 'If False' ... I'm not really sure what this is testing... 'If 0', and does this return true or false?


Thanks

Bill



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Parent Caller
« Reply #1 on: March 18, 2015, 04:58:51 AM »
Hi Bill,

Two quick answers;

I guess I'm not really understanding your first question - and possibly that's because what you see as a parent maybe the procedure does not see as a parent. I think your best bet is to tweak one of the shipping examples to demonstrate what you mean, so then I can see it in the context that you mean it.

>> what is the point of the condition 'If False' ... I'm not really sure what this is testing... 'If 0', and does this return true or false?

If False

basically is never true. The expression "false" evaluates to false (ie 0) and so the IF fails.

This construction is used because it's about to test a whole bunch of comparisons. So you can think of the underlying template as looking something like this;

If False
  -- template loop through conditions, do an ElsIf and code for each condition.
End

sometimes called "boiler plate" this code is basically just a syntax trick so the template code is simpler.

cheers
Bruce


billbarker

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: Parent Caller
« Reply #2 on: March 19, 2015, 06:50:57 AM »
yup, couldn't really get my head around that one.. It looks like you are comparing nothing to false, which I would have thought returned true  :)