• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Forms ??: Global Variables vs. Parameters

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I'm just doing some reading and was wondering about using global variables vs. parameters
Is there any differences or advantages of using one or the other? or a scenario where you would have to use either parameters over global variables, etc.?
Thank you,
Jennifer
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jennifer,
I got this from Forms6i online-help:
==================================================
Parameter values are not visible across multiple forms. Thus, even if there is a parameter named p1 defined in both Form A and Form B, each form has a separate context, and setting the value of p1 in Form B has no effect on the value of p1 in Form A. For this reason, parameters are useful in multiple-form applications primarily as inputs to a form when it is first invoked.
If your application requires variables whose values are visible across called forms, you should use global variables. Global variables are visible across called forms, and remain active until they are explicitly deleted with the ERASE built-in procedure, or until the session ends.
==================================================
Just make sure to erase global variables when no longer needed to release its associated memory.
HTH,
Remar
 
Jennifer Bhamoo
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a bunch! That helps clear things up!
-Jennifer
 
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic