![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
A little while ago I read a Thread that wasn't specifically about this topic, but it did mention how to go about addressing Controls as arrays (eg. Ten Text boxes on the one form - a la Box(1), Box(2), ....)
I Believe that you can't do this in B4P, but in the thread that I mentioned above (which I cannot find again), I recall (Erel?) descibing how it can be achieved. Can it be explained again or can I be pointed to the thread in question. Big thanks. Burd |
|
||||
|
As a small addition: If you want to use the control keyword in connection with "Optimized Compilation" you have to set the control type, too.
Instead of Quote:
Quote:
specci48 |
|
||||
|
The runtime controls tutorial should help you: Runtime controls manipulation
Quote:
The compiler will show a message when you try to compile if it is required. |
|
||||
|
Quote:
... haven't realized this yet.As I remeber I had to add the control type to all my used contol statments when using "optimized compilation" on my progs. By the way, it was a very stupid work... ![]() specci48 |
|
|||
|
Burd
I think that you refer to my question in a thread. I wanted to refer to many controls with the same action - like to change their color. The solution is like this: Define an array, for example : Dim boxes() then allocate each control to an item in this array using strsplit: boxes() = StrSplit("Form1,Panel2,TimeData2,MTime,Mspeed,Alt2 ,.................,Routetime",",") then the action is simple: For i = 10 To 35 Control(boxes(i)).Color = Rgb(255,255,255) Control(boxes(i)).fontColor = Rgb(0,0,0) Next i The advantage of this solution is that it keeps the specific names of the controls, which you want to refer specifically with actions or values, without having to look-up every time in a list to find the control you need. and It saves a lot of text.... ![]() edit: I just noticed that I wrote "next i " instead of just "next" (old habit from other languages), and the compiler doesn't mind !
__________________
David Erez Ramat Hasharon, Israel Last edited by derez : 01-28-2008 at 07:59 PM. |
|
|||
|
Thanks folks so much. Collectively, beautifully explained (I need that). This is a GREAT help and has saved me about 500 lines of code as well!
Not only is this info much appreciated, but also this forum in bringing out the benevolent side of "software developers" where ever we are on the scale...... oh,.... I think I;m going to cry.... = ( Burd. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Folder names in other languages | sahoopes | Questions & Help Needed | 8 | 11-08-2008 12:57 PM |
| Case and AutoComplete control names | agraham | Beta Versions | 1 | 09-18-2008 06:06 PM |
| Column names in a table | pmu5757 | Questions & Help Needed | 2 | 05-07-2008 03:50 PM |
| Getting names of controls | BjornF | Questions & Help Needed | 2 | 01-09-2008 03:05 PM |
| Setting multiple properties whilst only referring to the control once | RandomCoder | Basic4ppc Wishlist | 1 | 10-13-2007 01:51 PM |