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

event_precomp and SRP_PreCompiler

Do you know if event_precomp and SRP_PreCompiler are compatible with each other without any conflicts? IOW, can one use both the following statements in an Event Module without any issues?

#pragma precomp event_precomp
#pragma precomp SRP_PreCompiler

This allows Set/Get_Property shorthand in an Event hook. Eg
Event WEBVIEW.WebNavigated( NavID, URI, Redirected, UserInstantiated, StatusInfo, FrameID)
.view_format_label->text = .view_format_label->origtext
End Event


I haven't seen any problems, but I don't know the full extent of what event_precomp does. Specifically, whether event_precomp assumes RTI's commuter module framework.

Cheers, M@

Comments

  • M@ - I don't know with any amount of certainty as I've never used that precompiler.
  • Ok, thanks - I'll use with caution ;)
  • Maybe Kevin will gift us with an update to the SRP PreCompiler to support that shorthand. :)

    If you do run into problems, I would be curious if swapping the order of the #pragma precompilers might help. This would allow the SRP PreCompiler to convert its code to normal Basic+ first. This assumes that the precompiled code from one precompiler gets passed into the next precompiler. I haven't tested this so I could be off base.
  • Ok, that would be an interesting test, should it behaves unexpectedly. Looking at the precompiled output, it does seem that this gets passed through.
  • Maybe Kevin will gift us with an update to the SRP PreCompiler to support that shorthand. :)

    That would be nice ;). Even if there are no issues at the moment, there's always the risk of an incompatibility in later versions.
  • I don't foresee issues since it's looking for a specific pattern that SRP_PreCompiler doesn't look for. And since it converts that syntax into standard calls, SRP_PreCompiler won't know the difference.

    I'll consider adding a similar feature, but the SRP way. If I were to do it, I'd actually want a more versatile syntax that allows the setting of multiple properties that are secretly converted into a single Set call.
  • There may possibly be future issues though if RTI extend event_precomp to better handle the CtrlName Case statement in their generated commuter modules, in a way similar to what you've done with Event Modules? I guess that depends on how the parsers work.

    Interesting! Are you thinking of something like this?
    .HTTPserver->( PreserveQueryNameCase, PreserveCookieNameCase, PreserveHeaderNameCase ) = (TRUE$, TRUE$, TRUE$ )

  • Or maybe like the VB.NET 'with' statement:

    With .HTTPserver PreserveQueryNameCase = TRUE$ PreserveCookieNameCase = TRUE$ PreserveHeaderNameCase = TRUE$ End With

  • Yeah, this is better :) . It's good to have property and values alongside each other.
Sign In or Register to comment.