Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

CTO/ Arev32 functions

Hello all,

My client has a hybrid OI/Arev32 system that I converted from RevG (!) I am calling OI functions and subroutines extensively from within Arev32, and it's working very well. I now need to go the other way, and invoke Arev-based routines from within OI.

One of the functions referenced in the documentation is RUN_CHARACTER; but I don't think that is what I need. How can I call an Arev subroutine (say, FILE_SAVE in the Arev32 file DEMO_BP) from an OI form?

This may be a simple matter; but if I can't make this work, I'll have to duplicate a Lot of code.

Thanks!

Michael

Comments

  • This appears to be the exact issue we discussed in this thread:

    https://forum.srpcs.com/discussion/723/arev-form-command
  • I think it's a different issue. I got the Rev Forms working from within Arev32.

    In this case, I have an OI promoted event process associated with an OI form from which I need to call an Arev routine. The calling process is in Sysprocs, of course; the Arev routine is in an Arev BP file.

    Outside of things like Arev Common and such, which Have to be called within Arev, can an Arev routine be called from within the OI process if it's just code? If OI recognized the Arev VOC file, and the cataloged entries, I could call the routine directly.
  • We did discuss both forms and code. Here is the relevant answer I provided that applies to this current question:

    I think it is important to remember that ARev32 is an emulator. The R/BASIC code is precompiled so that it will run within OI, but it still requires an AREV environment to run. This is why you can't expect AREV stuff to simply run within OI. The best you can do is get OI to call AREV so that it will launch specific forms, reports, etc., immediately...which was the original suggestion I provided you.
  • I don't think I'm explaining this well..

    Arev32 is already running, and it has launched an OI form. I need to call an Arev-based routine from the Save event on the OI form. There are no Arev-specific things that run in the routine; it's just code.

    If I could RUN DEMO_BP FILE_SAVE, I would. Is there any way to do just that, or do I have to duplicate the code in an OI stored procedure?

    Sorry to be dense..
  • No, you explained things rather well. You want OI to call a routine that is compiled within AREV32. Simple answer: no can do. It doesn't matter how simple the code is, OI simply cannot call AREV32 compiled code directly this way.

    Better answer: if the code is plain vanilla R/BASIC and 100% BASIC+ compatible, move it into OI. Then both AREV32 and OI can call it without any conflicts. I realize there might be a lot of routines that fall into this category, but that is the nature of the beast.
  • So I would need to move the routine into OI and call from Arev using CTO_GUI_SUBROUTINE? I'm doing that already extensively; it would be nice to not have to do it Everywhere.

    Thanks for your time and attention, sir..
  • It's not quite that onerous. If you have purely compatible code (i.e., no UI), you can move into OI and call directly from AREV32. The only reason CTO_GUI_SUBROUTINE and CTO_GUI_FUNCTION exist is to handle code that has GUI (or presentation server) requirements.
  • So if I put the code in OI and there is an error condition, I need to put up an error msg. If I call from Arev32 I would use the Arev MSG function or the CTO_MSG function (I would prefer CTO_MSG). If it's called from OI, I'd need the OI MSG function. Or does CTO_MSG work from within OI? It needs to work from either OI or Arev32.

    I doubt I can use the OI MSG if it gets called within Arev32. Or can I?
  • Do functions like CopyOSFile and RTI_OS_Directory work if the calling code is evoked within Arev32?
  • I'm pretty certain that the CTO prefixed routines will only run within AREV32 and are not compatible with OI. In an ideal world, you would decouple your logic from your UI. Thus, error conditions are returned in the function call or via global/system/hashtable variable and the calling routine would then display/handle the error as best fits the environment.

    I expect CopyOSFile and RTI_OS_Directory to work if called directly from ARev32. I don't see any mention of them requiring event context (i.e., presentation server).
  • P.S. It's a shame that DO_CTO only works from the System Monitor. I think this is pretty much what you are looking for.
  • Do you think it would be reliable to check @Window? If I check it from Arev32, it's null. From OI it should always have a value. True?
  • Give it a shot. I suggest creating a test routine and check for @Window. If @Window is populated, call Msg(), if @Window is empty, call CTO_Msg(). Should be quick and easy for you to try it out.
  • Thank you sir!
Sign In or Register to comment.