Appreciate everyone's help on my earlier problem. I think I have learned a few things. Still cannot figure out how to solve my problem. I need to use a field which is accessed from a subroutine as @record I can't get into the subroutine so if I change the field to a symbolic field the subroutine still looks at the original data in the field when it was a data field. My question is how do I use the original field and make it so that the data in that field is from a formula and the subroutine will access the new data not the original data for that field. My knowledge with AREV is limited I have the RBASIC Book and guess alot. Any help would be appreciated. I am working on this field from a template.
OK - if you are SURE that the subroutine looks at "@Record" rather than {DICTNAME} then you can't achieve what you are trying to achieve the way you are trying to achieve it. Essentially if someone references {DICTNAME} this is treated by the program loader (RTP27) as a function call and the code for {DICTNAME} is loaded onto the program stack and called, resolving it's answer and returning a result.
If they reference @Record they are just referencing a.n.other variable and it is resolved directly in string space with no external function calls.
What you are trying to achieve could be made possible conceiveably by shelling but to explain further I'd prefer some details of what you are trying to achieve and perhaps more importantly why. As in you don't have the source code so are you allowed to do what you're trying to by your license?
Regards
World Leaders in all things RevSoft
We are a retail store selling boating equipment. This system was put
together about 10 years ago. I have been given the responsibility of managing it for the last 5 years. My understsnding is that we were
given the location of the source code and could have changes made.
The system has stayed intact with very few changes up until a year
ago. Contacted the original programmer a few months ago to have changes made. He got into the system and discovered the source code for about 90% of the programs was no longer there. Why it was not there is anyone's guess, we had a crash a few years ago maybe that was the cause. He was not interested in rewriting the source code and did not have a copy of it. So I have been left out in the cold. I am guessing that that the program is looking at @record not the dictname. I don't want to change the program, just have it return
the new data from a formula. Thanks if you can be of any help.
OK this assumes (a very BIG assumption) that @Record is not loaded in the subroutine in question, but rather outside.
Copy OBJECT $MySub to: $MySubOrig
and catalog mysubOrig
(or whereever the code is)
then write a program called MySub (i.e. the original name) that accepts as many parameters as the original (check out byte 4 in the object code, seq it for the number of parameters). In the program simply say
Subroutine MySub(A, B, C…)
SaveDict=@Dict
SaveRecord=@Record
Open "DICT.MYFILE" To @Dict Then
/* Assume @Record and @Id already loaded */@Record={MYCALC}Call MySubOrig(A, B, c...)End
@Dict=SaveDict
@Record=SaveRecord
Return
Backup first!! This is something I would NOT recommend for the faint hearted.
World Leaders in all things RevSoft
Mark
Andrews suggestion is excellent. If, as Andrew indicates, it proves that @RECORD is referenced directly in the subroutine then the only way I can see around this is to put an MFS (Modified Filing System) on the file. You would probably need some help with this but in short the following would occur.
The MFS could pick up any request to read (or write etc) field position 6 and intercept it. Then your new routine could redirect to symbolic or simply modify on the fly and send the results back.
The advantage of this is that the MFS would automatically be called regardless of how the file was accessed.
The is not a simple solution but if you must have this then it is an option.
Tony
Depending on the function of the symbolic this might not work. If the symbolic is relying on current data fields that could be changed in the record, it will return invalid or old information. If so, only way to do it is live time. Also, would hate to have the overhead of an MFS for one template when a read shell there could do the trick.
Aaron
]
Good point but I think you will find that Mark is actually creating a new symbolic field so he will be able to ensure that the symbolic itself is correct.
Tony
Looks perfectly safe to me. That's the way I would've done it.
![]()