Internal library partial inclusion results in call to undefined function

Hi.

I am getting a ‘Uncaught Error: Call to undefined function’ for a function that is included in an internal library. This is not a new library, but I have been editing it. Same with the Form that calls it. I have been making changes, generating the form and testing the included library function all day. Now all of a sudden, it cannot find the function.

The internal library contains several functions. The ‘missing’ one (that is not missing at all) is the second function defined in the library.

When I look at the generated form_apl.php file, I can see the first function in the library in the php source, but the remainder of the library is not there. Instead, it continues with the first function of a second library I have included. For some reason it just fails to include the remainder of the code after the first function.

I have checked things like ensuring all braces are closed etc. I have tried removing recently added lines of code. I just can’t pick up anything obvious. I am not getting any errors. Why is SC not including the remainder of the library?

Very frustrating. I am stuck. Are there any tips for resolving this issue?

Currently running V9.10.012 on MacOS.

Cheers, R.

Quick update - I just tried cutting and pasting the code text to a different location in the library (one function further down) and the I saved the file I received this error…

A non-numeric value encountered | Script: /Applications/Scriptcase/v9-php73/wwwroot/scriptcase/devel/generator/nm_gp_verifica_php.php linha: 132

So other than, ‘its a bug’ what does this mean for my ongoing efforts?

I had the same problems before some months… and at least ChatGPT found the error in my library code.
Perhaps you copy your code to ChatGpt… say CHATGPT that you are working with scriptcase (he knows this framework very well) and let check the code.

Hope it hepls …
Cheers Uwe

Thank you for the suggestion. I tried this. It did not come up with anything (other than generic suggestions, which I have already tried).

I suspect that a non-visible character has become embedded in the text somewhere - for example, possibly by accidentally hitting Control instead of Shift. I have had a previous experience of the same issue and found I had to isolate the offending text (by systematically removing and inserting code). I eventually found it - visually there was nothing wrong with the text, but clearly there was something embedded in there.

My point, assuming I find the issue is the same, is that the Editor should only allow visible characters to appear in the code text. It should be removing all non-visible characters. I cannot think of any reason why non-visible characters should be in code.. I think this is a serious, time wasting bug.

I don’t know whether ChatGPT will accept invisible characters when using windows pasting. But I’m sure that notepad.exe will not allow this. Sometimes I copied the text to notepad and then back and the problem was solved because invisible characters were ignored. Hope this might help you. But it may be that the problem has another reason at all. Perhaps SC has made an error.log in the path of your application. This may help too.

If you like I can suggest to make a zoom session with you. Sometimes 4 eyes see more than 2 eyes.

Cheers uwe

1 Like

After much cutting and pasting, I resolved the issue. There is no longer a need to respond to this item.

That said, my observation above stands (need to ensure only visible text is saved in editor).

I’d like to add another observation from past issues. It would be very useful if (when saving) the editor provided a feature that scanned the text, counting left parenthesis, braces, brackets etc., and ensuring there is a corresponding number of right characters to match - a message could be displayed warning the user of possible issues. I’ve written text editors in my past that have provided this feature - it is not hard to do, and it saves a lot of time. Unless you use 3P editors or LINT-like tools in conjunction with the SC editor, it’s just too easy to miss things with using indenting and checking by eye only. Just saying, it’s not that hard - and it’s kind of basic stuff.

I think you are right. The editor is useless. I edit my php outside SC and upload the changed code. That wil work.