Subject Re: [IBO] "Broken" IB_Script content in saved *.dfm file
Author Geoff Worboys
Re: [IBO] "Broken" IB_Script content in saved *.dfm file Patrick,

What version of Delphi?

What makes you think it is the DFM causing you problems?

I have lots of strings broken up inside DFMs (Delphi insists the lines are very short for some reason, it's quite annoying when you spend as much time reading raw DFMs as many of us do).  But Delphi has always put them back together properly when it loads the DFM.  It's not something that IB_Script should ever actually see, it's just the way it's stored in the DFM.

Write some code that will save the script out to file after the form loads, and see what it looks like.  You should not see any of the artefacts from the DFM.


If you do see differences then...

What happens if you clean up the script to get rid of those tab characters (replace them with spaces)?  Any difference?  (They shouldn't matter either, but they're not something I usually see in my DFMs.)

The other thing to check is just how long the script is.  I've never hit any problem, but I rarely store anything huge inside the DFM if I can help it.

-- 
Geoff Worboys
Telesis Computing Pty Ltd

patrick_marten@... [IBObjects] wrote:




Hello,

a part of my IB_Script content looke like this:

        end
        else begin
            PROCESSABLE_AMOUNT_CREDITS = TempReferenceAmount - PROCESSED_AMOUNT_CREDITS;
        end

In the .dfm file it's saved like this:


      #9#9'else begin'
      
        #9#9#9'PROCESSABLE_AMOUNT_CREDITS = TempReferenceAmount - PROCESSED_' +
        'AMOUNT_CREDITS;'
      #9#9'end'

The line break at the underline is causing a problem, because AMOUNT_CREDITS is being recognized as a field name, although it should be PROCESSED_AMOUNT_CREDITS. There are some more similar examples.

In many other cases the line break happens within letters (PROCE / SSED_AMOUNT_CREDITS etc.) which works fine, but if it happens directly before of after an underline, the script can't be executed.

Using IBO 5.7.7 currently, but this behaviour existed in older versions as well.

Anything that can be done aside form the "re-formatting" the script manually until it works?

Best regards,
Patrick