On 24-apr-07, at 16:28, Sven E Olsson wrote:

>
>
>>>
>>> I can't create a global array using code, I wanted to do something
>>> like this, instead it looks like that i need properties and code for
>>> every window.
>>>
>>>    if prefs.WordWrap = true then
>>>      dim Global OpnW() as TextWNoscroll
>>>    else
>>>      dim Global OpnW() as TextWHscroll
>>>    end if
>>
>> Is that some new kind of syntax for RB 200x?
> I never said that, I write "wanted to do"
>
>> I've never declared a
>> global variable that way in RB.
>
> That do not work.
>> If I understand what you're looking
>> for, you should be able to get the same effect by declaring a  
>> property
>> that's an array of your window in a module, and making sure to set  
>> its
>> scope as Global.
>
>
> Yes I can declare a property in a module that is an array (of one
> window type) of an window
>
> But the problem is to declare an array, depending on some preferences
> settings.
>
> How do I declare the Array "OpenW" to be an array of TextWnoscroll or
> TextWHscroll, depending on a preference variable?
> As I can se it is impossible.
>
> The same is with windows, I cant declare a global variable "w" as
> TextWndNoscroll or TextWHscroll, depending on a prefs variable.

I have been able to resolve this kind of problem ( if I understand  
your problem correctly) by using arrays of type dictionary

  Dim myEditFields() as Dictionary
Dim aDict as new Dictionary

if prefs.WordWrap then
        aDict.Value("TextWNoScroll") = ThisEditfield
        
else
        aDict.Value("TextWHScroll") = ThisEditfield
end if

myEditFields.Append(aDict)

of course you can add all sorts of properties to the dictionaries if  
you need more control

just my 2 eurocents

HTH

Bart



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to