Link to home
Start Free TrialLog in
Avatar of navgup
navgup

asked on

modifying .lss file and execute the code via LS agent

Is it possible to modify the .lss file in the background(on server) and then call functions/subs from any agent (one or multiple dbs) ?

meaning:

1. keep modifying the content of codeexecution.lss file using AgentA that will write code from a notesdocument to the lss file.
2. AgentB will call the functions from codeexecution.lss

Note: i ve kept the function names (calling & called) the same in AgentB so that i don;t have to modify or resave AgentB.

Does it work this way ?

Avatar of HemanthaKumar
HemanthaKumar

No..You have to recompile with the new .lss file again

~Hemanth
Avatar of navgup

ASKER

Can LSO file work instead ? How do you actually compile source to get a .LSO file?
Avatar of navgup

ASKER

Or is there a way via API to recompile .LSS file ?

You can always save and sign the design objects using c/c++ api.

Do a search and you can find some interesting topics/solns here
Avatar of CRAK
This bit might help you....

Lets say we have an lss file "c:\temp\extls.lss".
I created one that contained following code:

Sub LssCode(Text as String)
   Messagebox Text
End Sub


I call the file from this agent (manually, run once):

Sub Initialize
      Dim code As String
      Dim my_code As String
      Dim code_ret As Integer
      Dim cd As String
      
      cr = Chr$(10) + Chr$(13)
      
      my_code = Inputbox$("Please enter code to execute:", "Run-time compilation?")
      
      code = _
      "Option Declare" + cr + _
      "%include " + Chr$(34) + "c:\temp\extls.lss" + Chr$(34) + cr + _
      "Sub Initialize" + cr + _
      my_code + cr + _
      "End Sub"
      
      code_ret = Execute ( code )
End Sub


First thing is does is ask me to enter a line of code. This required compilation, doesn't it?
I entered:

      Call LssCode("Hello world")

The code is then fed into a sub, executed: a messagebox appears: "Hello world".

In short: it should be possible.....!
Enjoy!
Avatar of navgup

ASKER


Thanks, What if i pass the file name as a static parameter and keep changing the code in the file and then want to run the agent on scheduled basis ?
ASKER CERTIFIED SOLUTION
Avatar of CRAK
CRAK
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
CRAK.. the scope doesn't extend beyond the execute module.. execute module loads , compiles, runs and destroy and nothing is available out of this scope...

So navgup has to include all of his code inside a string and pass it to execute method. And I am sure there is a limit of how much data you can send to this method.
;-(
It looked promising though! But with that info, perhaps navgup can still find a way to archieve whatever he/she's trying to do....

From R5 designer help:

Number of lines per script or source file, not including the contents of %Include files: 64K
Depth of nested %Include directives: 16
Size of executable module code: limited by available memory