Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code References... Can it search FRX Dataenvironments?

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,333
FR
Just been modifying two apps to make them RDP compliant so customers people can work from home.

Neither app was designed with multi-user on the same PC in mind, so the temporary files path needed to become
unique. i.e. can't be C:\TEMP any longer which has been fine for a couple of decades...

For the forms, I used Code References to look for hard coded drive references and that seems to have worked well, but I did not realise that reports may have been missed, because the temp tables are sometimes opened in the dataenvironments.

I didn't know, even after this amount of time!, that the dataenvironments were not being searched, can that be changed? is there a setting?



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
You can see FRX files are in the file type code references searches.

To what extend does code references search? I simply set up a test report with code in its DE using C:\TEMP, stored a dbf in C:\TEMP and add it to the DE as table object, so the path is in there as property.
Code References only found the path used in the DE methods code, not in the objects.

So you'll need to care for that separately or look if Thors GoFish does that.

Besides that, GETENV("TEMP") will differ per user session.

I had to change a project for remote desktop compatibility once, too. and there were a lot of reports tables that way, which I changed from two sides: dbfs created for reports via code INTO TABLE ... was changed from a hardcoded path to use of GETENV("TEMP"). Then the hardcoded path was removed from the drive. And beforeopentable code was added to go through all objects and change paths, as you likely also know from the hackers guide solution to change database path references in DE objects.

As you can't write a base rerport and inherit DE code, I added this to all FRXes manually, there weren't that many. You might automate that hacking the FRX files, too.

Bye, Olaf.





Olaf Doschke Software Engineering
 
Hi

The C:\TEMP is in the DE of the report - in the Expr field, but Code References isn't picking it up on my machine...

What I am doing is removing it from the DE altogether, having looked for every call to REPORT FORM xxxx first and making sure the table is open, in the right order and closed after the report runs.

I'm using (or was for forms) Code References to double check I haven't missed any references afterwards.



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Griff,

This is completely off the top of my head, but you might be able to achieve this by writing a program that opens each of the FRXs in turn. Open them as if they were a DBF (with USE). For each one, look for records where the Objtype is 25. For each such record, look in the Name field for the string that you want to search for.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Quite right Mike!

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Griff
Use cursors instead, maybe too late now.



If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Slightly too late Mike,

Two things though, firstly thank you for the prev. idea, I wrote a widget to look in Expr in the R entries for the whole project...

Secondly, I quite like having a temp file sometimes, because I can enquire as to its contents after the report has been run - if needs be -
When a cursor is gone, it's gone for good.





Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Slightly too late Mike,
... thank you for the prev. idea, I wrote a widget to look in Expr in the R entries for the whole project...

Was that my idea? Or the other Mike's? The only reason I am asking is for own satisfaction: to know if it worked. I thought that the filename would be in the Name field rather than the Expr, but that was really just a guess on my part.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Defo your idea, it's a second best to code references finding it, but it was certainly quick and conclusive - yeah, you could argue Expr or Name... Tomato / Potato to me.
Job done.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
For future reference, I think GoFish does a better job of this than Code References.

Tamar
 
I looked into my test FRX as a table. Yes, the path is stored in the Expr of a record about a DE table. Properties are stored there in the form of several lines of [pre]property name = value[/pre].

I wonder why code coverage can't do that, as it can search properties of forms and classes and they are stored the same way.

Anyway, that makes (made) it easy to handle yourself.

Bye, Olaf.

Olaf Doschke Software Engineering
 
No idea why Olaf, but it does not seem to.

That said, a little simple code resolved the issue.

GoFish might do better, but I have never really gotten into it...



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top