Single quote (e.g. an apostrophe) in comment breaks code

This is a big issue for creating comments in languages, like Italian, where apostrophes are common.

The following comment in an internal SC project library contains a single quote (’):


<?php

/**
* test [B]' [/B]test  
*/
function import_start($param)
{
....

And will result in this error when an app tries to use the function inside the library.

Fatal error: Call to undefined function import_start() in…

The error disappear by just removing the single quote or by ‘closing’ it:
E.g. of a comment not causing a fatal error:


<?php

/**
* test [B]'[/B]test[B]'[/B]  
*/
function import_start($param)
{
....

Furthermore, the effect of a single quote in a comment created inside the function like this


function import_start($param)
{ 
/**
* test [B]'[/B] test
*/
....

is not as easily detectable, as it won’t result in a fatal error, but will still break the code

Are you sure? This is working for me like a charm.

<?php

/**
* This is a 'test'
*
*/
function genera_refencia($tipo){

Giuseppe,
did you try with just one single quote?, i.e.:
This is a 'test

Anyway, after my previous post I did find out that I was also having other problems: PHP code files updated externally from SC were not correctly detected by SC.
So when the app was regenerated, it seems that SC was not including the latest versions of the files I edited using an external PHP editor.
So now I’am not 100% sure of what I wrote in my previous posts.

If you edit an external lib in your project with an external tool, you have to delete the lib folder inside your app/project, if not, will be not updated

I’m trying to work with an external PHP editor since just a few days.

It seems that when library files are updated externally from SC:

  • internal libraries get correctly embedded in the app when it is regenerated by SC. What is missing is that there’s no visual feedback in SC that an app using the edited lib file need to be regenerated; so it’s up to you knowing which SC apps you have to regenerate.

  • with external libraries, SC is not aware of the changes, so they are not copied to /scriptcase/app/[project_name]/_lib/libraries/ when an app is regenerated. I didn’t know about your workaround (deleting the libraries folder) and I found out another one that is easy to perform manually within the SC IDE. But yours should be simpler to automate.

But this happens too if you modify an internal lib withing SC IDE. It’s your responsability to know wich apps include this internal and regenerate (because internal is included as code inside each app, not linked…yes, I know makes no sense, but it is how it works right now).

You sure?
My experience is that all apps that are set to use an internal library (via Programming > Internal libraries) get their status automatically changed to ‘outdated’ by SC.
At least this is what happens in the currently open project, when internal project libraries are edited via the SC IDE. I didn’t check all other internal libraries: scriptcase, public and user.

No, not sure at all, if it is like you say, cool. Anyway, the best is to link/include this files, this way one can decide if wanna change this file outside IDE, and regeneration of the apps is not needed, but sadly is not possible right now. Maybe in v9.1.256? :rolleyes: