Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting Database Property for form level?
Message
From
13/07/2006 02:29:30
 
 
To
12/07/2006 12:33:04
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01135422
Message ID:
01135934
Views:
29
>You can avoid the macro substitution here:

This is cool !!!
That getpem trick actually hands me back object reference :))

BTW this was million years old code, dating way back to my
VFP exploration time. Never gave me any problem so I never
tought of /looked trough it again.

Now since you came up with this cool trick (by Fabio) here comes
'ironed' version :)
.
.
   procedure form_de
        lparameters oDataEnvironment
        local i,arr_obj(1),oDEO
        =amembers(arr_obj,oDataEnvironment,2)
        for i = 1 to alen(arr_obj)
            oDEO=getpem(oDataEnvironment, arr_obj(i))   
            if oDEO.BaseClass = 'Cursor'
               oDEO.database = this.get_database(upper(justfname(oDEO.database)))
            endif
        endfor

.
.
Thks++++++ :))




>
>        for i = 1 to alen(arr_obj)
>                 oCursor=getpem(oDataEnvironment, arr_obj(i))
>>            j = oCursor.baseclass
>>            if upper(alltrim(j)) = 'CURSOR'
>>                db_name=upper(justfname(oCursor.database )))
>>                oCursor.database=this.get_database(allt(db_name))
>>                if !file(oCursor.database)
>>                    messagebox('['oCursor.database+']'+chr(13)+;
>>                        'Not found - Check Your blah..blah')
>>                endif
>>
>
>That's Fabio's "GetPem returns object" trick, and I love it. I've found that it made my code cleaner and leaner in many places.
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform