SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Apprentice
    Join Date
    Apr 2005
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing a value between 2 functions

    Try to debug your code and see what happens. That is the best way to figure out what is wrong. You can also use print statements to find out if your function actually returned a valid value.

  2. #2
    Member
    Join Date
    Jun 2005
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing a value between 2 functions

    nahimov
    I tried to use "Print" statements and that is how I figured out that I was not getting the value passed that I need.
    Thanks
    Scott
    Scott Calo

  3. #3
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing a value between 2 functions

    Looks fine to me. Except that the Build_Master_Port_List() function doesn't seem to have a return statement. But that should cause a compile error. Was that line cut off?

    What happens when you step through it in debug mode as nahimov suggested?
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  4. #4
    Member
    Join Date
    Jun 2005
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Passing a value between 2 functions

    I am in need of a little help, I can not figure out why the (2) functions below are not working together. The first function INTEGER Bcast_Port_Function() works correctly but I can not get the value of this function passed to the second function Build_Master_Port_List(), I run my testcase and nothing is returned, so I am gueesing that nothing is being passed between functions.
    Any help would be greatly appreciated.
    Scott


    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
    [-] INTEGER Bcast_Port_Function()
    [ ] PortTabClick()
    [ ] Sleep (2)
    [ ] AsyncTabClick()
    [ ] Sleep (2)
    [ ] LXConsoleLX.Async.Maximize()
    [ ] INTEGER iPage = LXConsoleLX.Async.JavaxSwingJTabbedPane.GetPageCou nt ()
    [-] if (((iPage - 1) % 2) == 1)
    [ ] Print (&quot;Unit is a {iPage - 2} Port with Modem&quot
    [ ] return iPage-2
    [-] else
    [ ] Print (&quot;Unit is a {iPage - 1} Port without Modem&quot
    [ ] return iPage-1
    [ ] Sleep (2)
    [ ]
    [ ]
    [ ]
    [-] STRING Build_Master_Port_List()
    [ ] STRING sMaster = Str(Bcast_Port_Function() )
    [ ] Sleep (2)
    [ ] Print (&quot;sMaster is set to {sMaster}&quot
    [ ] sleep (3)
    [-] switch sMaster
    [+] case &quot;1&quot; //1 Port With Modem (Exit Script)
    [ ] break
    [ ]
    [+] case &quot;2&quot;//2 Port No Modem
    [ ] AddNewMaster.PortS.SetText( &quot;1&quot; )
    [ ] Sleep (1)
    [ ] AddNewMaster.Timestamp.Check()
    [ ] Sleep (1)
    [ ] AddNewMaster.Ok.Click()
    [ ] Sleep (1)
    [ ]
    [ ]
    [+] case &quot;4&quot; //4 Port No Modem
    [ ] AddNewMaster.PortS.SetText( &quot;1&quot; )
    [ ] Sleep (1)
    [ ] AddNewMaster.Timestamp.Check()
    [ ] Sleep (1)
    [ ] AddNewMaster.Ok.Click()
    [ ] Sleep (1)
    [ ]
    [ ]
    [-] case &quot;8&quot; //8 Port No Modem
    [ ] BroadcastGroupPorts.JavaxSwingJTabbedPane.New1.Cli ck()
    [ ] Print (&quot;Adding Master Port {sMaster}&quot
    [ ] AddNewMaster.SetActive( )
    [ ] AddNewMaster.PortS.SetPosition( 1, 1 )
    [ ] AddNewMaster.PortS.SetText( &quot;1 2&quot; )
    [ ] Sleep (1)
    [ ] AddNewMaster.Timestamp.Check()
    [ ] Sleep (1)
    [ ] AddNewMaster.Ok.Click()
    [ ] Sleep (1)
    [ ]
    [ ]

    </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    Scott Calo

  5. #5
    Advanced Member
    Join Date
    Oct 1999
    Location
    Chicago, IL
    Posts
    652
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing a value between 2 functions

    I agree with the others that the code looks like it should return something. Can you post the output of your run (the prints statements) here too.

  6. #6
    Member
    Join Date
    Jun 2005
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing a value between 2 functions

    Hi and thanks for the responses, The first function returns a value correctly, and the second function print statements do not return anything at all which is the main problem that I am having because I can not figure out why nothing is being returned. And yes the "return" did get cutoff.
    Scott Calo

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:14 AM.

Copyright BetaSoft Inc.