David:

I guess that's my question...it was supposed to be initialized by "UDT.OPTIONS 15 ON" to null (an empty string), not zero (0).

Thanks,

Bill

------------------------------------------------------------------------
David A. Green said the following on 11/17/2010 5:57 AM:
Looks like your first element was already assigned a value so it is skipping
the null assignment.

David A. Green
(480) 813-1725
DAG Consulting

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett
Sent: Tuesday, November 16, 2010 6:05 PM
To: U2 Users List
Subject: Re: [U2] [UD] Initialize COMMON Variables to Null (Empty String)

I notice that I've already set this UDT.OPTIONS value to ON.

Today, while investigating why one thing wasn't working I noticed that
several named COMMON variables had a value of zero.  I don't set these
values except as a "pass variable" between UO, phantoms, and executes,
so I assumed they were being initialized by UD as zero.

I have some code that does this:

*
COMMON /G_files/ DTA.GLOBALS(20)

...and then in an initialization include, to try to get it initialized
with empty strings, I do:

*
** Initialize DTA globals array once (if not already done)
IF UNASSIGNED(DTA.GLOBALS(1)) OR DTA.GLOBALS(1) = 0 THEN   ; ** UD version
*IF NOT(ASSIGNED(DTA.GLOBALS(1))) THEN                      ; ** D3/UV
version
     MAT DTA.GLOBALS = NULL$
END

...yet when I look at the contents of this named COMMON variable all the
/*unused*/ locations are zero (0).  Why would that be?

6 Intel (0)->  ***DEBUGGER called at line 742 of program
E:\AboEnterprise\Abo\BP\BP\_TCL.SHELL
!\DTA.GLOBALS
DTA.GLOBALS(1)=6
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(2)=2092
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(3)=INTEL
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(4)=MYUSERNAME
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(5)=E:\MYPATH\MYACCT
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(6)=MYUSERNAME
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(7)=\
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(8)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(9)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(10)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(11)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(12)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(13)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(14)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(15)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(16)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(17)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(18)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(19)=0
Enter new value (hit<CR>  for no change)=
Continue ? (hit<CR>  to continue)
DTA.GLOBALS(20)=0
Enter new value (hit<CR>  for no change)=

Thanks,

Bill

------------------------------------------------------------------------
Bill Haskett said the following on 11/16/2010 4:46 PM:
Many thanks, Wally.

Bill

------------------------------------------------------------------------
Wally Terhune said the following on 11/16/2010 2:00 PM:
UDT.OPTIONS 15 U_DYNAMICNUL

Allows you to determine how UniBasic sets an uninitialized variable.
ON UniBasic sets an uninitialized variable to ' '.
OFF UniBasic sets an uninitialized variable to zero (the equivalent
of x=0).


Wally Terhune
U2 Support Architect
Rocket Software
4600 South Ulster Street, Suite 1100 **Denver, CO 80237 **USA
Tel: +1.720.475.8055
Email: wterh...@rs.com
Web: www.rocketsoftware.com/u2


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett
Sent: Tuesday, November 16, 2010 1:34 PM
To: U2 Mail List
Subject: [U2] [UD] Initialize COMMON Variables to Null (Empty String)

I can't remember if I can set up UniData to initialize common variables
to null (an empty string) rather than to zero (0).  Can this be done?

Thanks,

--
Bill Haskett
*/Advantos Systems, Inc./*
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to