Keep the text without changing


#1

There is a way to keep the text without changing it NS Basic?

Let me explain, I have this line of code:

datos = JSON.stringify({image1: foto1,image2: foto2}) <— ok

that I later use to call a web service, but I need the first parameter, “image1”, always start with “i” not “I” and that is that when I save it, Ns Basic converts it to me a capital letter, which sends an error since the web service expects “image1” and not “Image1”:

datos = JSON.stringify({Image1: foto1,image2: foto2}) <-- wrong


#2

Better change the variable name to something else.

The AppStudio BASIC translator tries to normalize variable names so the case does not matter. In this case, it has ‘Image1’ already as a variable name, so it thinks you meant to type that. (Do you have an Image1 control?)


#3

The problem is that the web service that I call is waiting for a variable with that name “image1” and not “Image1”, otherwise it sends you an error that the variable does not come in the request, the name of the variable unfortunately does not I control it, it’s from a third party.


#4

Do you have an Image1 control?

Here’s another workaround:

JavaScript
datos = JSON.stringify({image1: foto1,image2: foto2}) 
End JaveScript

This turns off Translation for that statement.


#5

Yea, great solution, then final code was:

 JavaScript
        datos = JSON.stringify({
        image1: foto1,image2: foto2});
 End JavaScript

Thank you