The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Global vs Local behaviour
05-02-2015, 03:24 PM
Post: #1
Global vs Local behaviour
The use of a command line entry "global" variable would make the contents available for other activities when a program concludes. As implemented, there is a problem with this reasoning, because a program that passes a value in via the command line, automatically makes that input variable "local" in context. Here is an example:

Code:

EXPORT stg:="DRD";
EXPORT str()
BEGIN      
  return stg;
END;

The global variable retains its programmed contents, remaining available at the end of run time. Suppose its desired to pass parameters via the command line:

Code:

EXPORT stg;
EXPORT str(stg)
BEGIN      
  return stg;
END;

In this example, the global variable, stg, gets displaced by a local (same name) variable during input. Any programmatic effect on stg vanishes once the program terminates. If the "command line input" were to initially check for the 'global' existence of its variable, I think it would enhance the process of parameter passing via the command line.

What do other users think about this?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Global vs Local behaviour - DrD - 05-02-2015 03:24 PM
RE: Global vs Local behaviour - kharpster - 05-02-2015, 08:38 PM
RE: Global vs Local behaviour - DrD - 05-02-2015, 09:56 PM
RE: Global vs Local behaviour - kharpster - 05-02-2015, 10:29 PM
RE: Global vs Local behaviour - DrD - 05-03-2015, 02:18 AM
RE: Global vs Local behaviour - kharpster - 05-03-2015, 08:33 PM
RE: Global vs Local behaviour - DrD - 05-04-2015, 11:34 AM
RE: Global vs Local behaviour - DrD - 05-04-2015, 01:47 PM
RE: Global vs Local behaviour - leprechaun - 05-04-2015, 05:47 PM



User(s) browsing this thread: 1 Guest(s)