Alpha Video Training
Results 1 to 5 of 5

Thread: Passing Arguements between Xbasic functions

  1. #1
    Member
    Real Name
    Miles Nolan
    Join Date
    Jan 2008
    Posts
    263

    Default Passing Arguements between Xbasic functions

    Hi everyone

    I have an xbasic function that returns a variable which I want to pass to another Xbasic function, just struggling a little with the correct syntax if anyone call help ?

    Function 1 provides a variable called customerid, which I want to call and pass to function 2 ?

    thanks in advance

    john

  2. #2
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,253

    Default Re: Passing Arguements between Xbasic functions

    Hi John,

    You could always do something as simple as function2(function1()) .

  3. #3
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,561

    Default Re: Passing Arguements between Xbasic functions

    Gregg gave a great example.

    To make it more visible use this.

    myCustomerid=function1()

    resultoffunction2=function2(myCustomerid)
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  4. #4
    Member
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    995

    Default Re: Passing Arguements between Xbasic functions

    I vote for Alan's suggestion of using a variable (myCustomerid).

    The XBasic interpreter is not perfect; it is best to keep statements very simple and to break complex statements apart.

    For example, in the not too distant past, passing an array by reference to a procedure caused problems in the called procedure when you went to update values in the array. A special, and obscure, syntax had to be used to update values. I know what I'm saying doesn't have a "keep it simple" analogy here, but I'm just saying … I have been scared of passing parameters to functions and procedures unless I am passing a Character, Number or Pointer.

  5. #5
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,253

    Default Re: Passing Arguements between Xbasic functions

    Rich,

    There are obviously many ways to accomplish this.
    I simply provided the answer with the least amount of effort.
    If you think about this, there is absolutely no reason that you can't
    put myCustomerID = function1() inside function2() and have it do it's work from there.

    There are many things to consider when creating a custom function,
    including will it use variables used by Alpha's functions (think cn, rs, and args for a few).

Similar Threads

  1. xBasic Functions
    By njguy in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 07-21-2018, 10:10 PM
  2. Passing variables to functions (BYREF / BYVAL)
    By SNusa in forum Alpha Five Version 11 - Desktop Applications
    Replies: 4
    Last Post: 01-06-2013, 11:18 PM
  3. Passing Arrays to Functions
    By christobal in forum Alpha Five Version 8
    Replies: 6
    Last Post: 11-04-2007, 03:47 PM
  4. Parameter mapping gone and arguements don't work?
    By Pat Bremkamp in forum Application Server Version 8
    Replies: 0
    Last Post: 08-26-2007, 02:15 PM
  5. Passing pointers through functions.
    By Nathan White in forum Alpha Five Version 4
    Replies: 1
    Last Post: 09-27-2001, 11:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •