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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with [ illegal data type ] Compile Error

Status
Not open for further replies.

Statey603

Programmer
Nov 10, 2009
196
US
I am working in PB 11. I inherited this project and I believe that this has been around for over a decade.
I recently created a new screen that needs to launch a window that uses an object named ws_srvc_rate_info.

The object [ ws_srvc_rate_info ] is a mystery. I cannot locate the definition for this via PB Search. I am not sure what type it is, but I am guessing that it is some sort of structure. It gets passed to a window and holds parameters that get used by the window.

I am getting the following compile error
[ illegal data type: ws_srvc_rate_info ]
on the line of code in my new window's Instance Variable's section where I declare an instance of this object as follows: private ws_srvc_rate_info istr_srvc_rate_info

My code was copied/pasted from another window that is similar.

I am trying to find the definition / original declaration of this object.

I have tried a Search of the entire project and the only results that are returened are 2 other declarations like the one that I describe above.

caregiver.pbl(w_sh_fc_srvc_auth).w_sh_fc_srvc_auth: private ws_srvc_rate_info istr_srvc_rate_info
track1_common.pbl(w_sh_srvc_auth).w_sh_srvc_auth: private ws_srvc_rate_info istr_srvc_rate_info


I appreciate any assistance with how to
1) find the definition for this object
2) fix the compile error
 
hello,

seems like the ws_srvc_rate_info as you already stated, must be some window-structure. It might have existed in an ancestor window and for some reason that window doesn't have the structure anymore or has been renamed maybe. Could it have happened while migrating an old version? Then I'd suggest you search in the old source code (before migration), if possible with the previous version of powerbuilder. On the other hand if someone has deleted or renamed the structure or even overridden the ancestor then the easiest/fastest way might be to create a window structure (with the same name and with any initial member with any name and any type) in your (ancestor) window and simply do recompiles/rebuilds. It'll give you all errors for missing members of the structure. You'd start adding all missing members and recompile untill you've added all of them. The only information you can't recover is possible initial values for the members.

regards,
Miguel L.
 
Hi Miguel,

I am pretty sure that the object is still there, I just cannot find it via PB Search. The other screens that reference it work fine.

I am guessing that not finding the object might be related to PBL corruption like I have seen before. I have little confidence in PB searching based on previous difficulties and posts concerning crashes, etc.

I will try to re-create my new window using one of the working windows that references this object as my baseline template. I had originally used a different window as my template - before encountering this object.

Oh how I miss Visual Studio.




 
haha (about missing VS).

You really are having some funny problems doing searches in pb. Normally I've never had any, except for doing search in code and having used funny spanish characters like 'é', 'ñ', etc. that search doesn't work well.

Couldn't it be you have some sort of disk problem or maybe file-access problem (read/write)?
I've hardly used version 11, so it could be 11-related.

In the early versions of pb I always wrote my own little programme to do searches since you had to select all objects manually before doing a search and that was quite a drag. (using the library functions you can export all objects, save them to disk or in a database blob field, etc.), but in the later versions a search on the target should just work fine.

Did you try to use pbl-peeper from tekno-kitten?

there are also some 'advanced utilities' that previously shipped with pb but now not any more. You can still download them from sybase, migrate and compile them and use it for example to do searches:

It might just give you better results, but to be honest, I'd start to try your search on a diferent computer if that would be possible, to eliminate the possibility that it might be some kind of disk problem you have.


regards,
Miguel L.
 
Miguel,

I have tried searching on another PC with the same results. This is very strange and some of this code has been around for over a decade. Based on past experience, I am inclined to believe it is corruption in the PBLs which is causing the searching to miss items but then again, the illegal data type compile error (which also occurs on the other PC) is probably indicating exactly what my search is telling me - the object is not found therefore the declaration is illegal.
HOWEVER....
This does not explain why the other windows that reference the object compile and work fine. I don't dare edit either of these in fear of breaking something.

Could there be something else that I am missing in my new window that would like a directive in visual studio that might resolve this?

I am thinking about giving up.
lol


Thanks for all of your help.
 
breaking news..........

It looks like this is a structure object.

I think I need to add it to my window.

 
SOLVED

Here is what I did to resolve this.

I opened a window that already uses the object [ ws_srvc_rate_info ] and went to View - Structure List. The object was listed. I selected it and right-clicked and chose Copy.
Next, I opened my new window and went to View - Structure List. The list was empty. I right-clicked and chose Paste and the structure object was pasted into the list.
I uncommented the declaration private ws_srvc_rate_info istr_srvc_rate_info in my new window's Instance Variables and compiled and no longer get the illegal data type error.

TGIF

 
This is a common issue when you copy or 'saveas' an existing window into a new one. NVOs will often get 'dropped' as well.

Matt

"Nature forges everything on the anvil of time
 
sorry I wasn't around to reply:

happy you found the solution. I wanted to tell you to do a SaveAs of the window that works (since the structure is defined at window level), but thought you already were going to do this when you said "I will try to re-create my new window using one of the working windows ", sorry maybe should have been more explicit. Anyway, since you told me that on another pc your search doesn't work well, maybe there's a new bug of doing searches in pb 11 ....

phew ... mbalent your statement worries me .... one of the first things we all have to learn is that pb has lots of mistakes and that it's not always our own fault ..

yes TGIF (though for me it's sunday every day) ...
enjoy the weekend

regards,
Miguel L.
 
RE: maybe there's a new bug of doing searches in pb 11

Perhaps not a bug after all........

References to the structure object were found by the search. I was getting hung up on not finding the object itself (instead of just the declarations that I saw). I was expecting it to show up like any other pb object - for example a window, datawindow or non-visual object.

My new-found understanding of what I see with this structure object is that it is a component on a window - like a button. It does not need to be defined elsewhere in the project (like a non-visual object).

I hope I am making sense and of course, I could be completely wrong (yet again).


 
no no ... you are right. Window structures are something like instance variables, declared along with and within the window.



regards,
Miguel L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top