Author Topic: User defined functions?  (Read 3088 times)

Chandra

  • Newbie
  • *
  • Posts: 4
User defined functions?
« on: December 19, 2012, 03:24:35 PM »
Hello
How can I make a user defined function? There doesn't seem to be any information on this.
Chandra

Malkom

  • Administrator
  • Sr. Member
  • *****
  • Posts: 287
Re: User defined functions?
« Reply #1 on: December 19, 2012, 05:23:03 PM »
Hi Chandra

You can make your own user defined functions in HAC. However, they are two line calls and not the one line calls as is typical in most programming languages. The second line takes the return value via a global variable

The example below just adds the two number passed to it and places their sum in a global variable.

The function is defined in the Main Code section as AddUpFN     n1,n2

Code: [Select]
Global resAddUp

Put n1 into resAddUp

Add n2 to resAddUp


This calls the function:-

Code: [Select]
Global resAddUp

Call AddUpFN(10,35)
Put resAddUp into field 1


I hope this helps

Malkom

I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

Chandra

  • Newbie
  • *
  • Posts: 4
Re: User defined functions?
« Reply #2 on: December 23, 2012, 10:33:18 AM »
Its not what I expected but it works well, thank you

 

anything