PowerBASIC Peer Support Forums
 

Go Back   PowerBASIC Peer Support Forums > User to user Discussions > Programming with Objects

Programming with Objects User to user discussions about programming with objects, including COM objects.

Reply
 
Thread Tools Display Modes
  #16  
Old Apr 18th, 2012, 08:46 AM
Scott Slater Scott Slater is offline
Member
 
Join Date: Aug 1999
Posts: 1,144
It has always worked this way. If you are unsure you can always add;

#UNIQUE VAR ON

to your source file.
__________________
Scott Slater
Summit Computer Networks, Inc.
www.summitcn.com
Reply With Quote
  #17  
Old Apr 18th, 2012, 09:11 AM
Michael Mattias Michael Mattias is offline
Member
 
Join Date: Aug 1998
Location: Racine WI USA
Posts: 36,919
Quote:
The problem is that if you change it to "REDIM ArrayName(number) AS type", it does create a new array with scope LOCAL.
This is undocumented (Help just says that "as type" is optional).
ISTR this "phenomenon" being reported by others in the context of "procedures, " not just in the context of "Interfaces" ... anything other than simple 'REDIM arrayname(new_bounds) [ end of statement]' will create a 'new' array using the type and scope specified.

I just, out of force of habit now that everything works, always do this:
Code:
 Procedure Foo (params) 

  LOCAL   arrayname() AS type      ' define the symbol 

 ..... 
  REDIM arrayname (number)        '  create the array so it exists and may be used 
                                  ' datatype and scope already defined above
Apparently I won't have to change anything should I desire to create my own INTERFACEs with METHODs.

MCM
Reply With Quote
Reply

Tags
10.03, bug, oop

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:32 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1999-2011 PowerBASIC, Inc. All Rights Reserved.
Error in my_thread_global_end(): 1 threads didn't exit