Field syntax append issue

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Field syntax append issue

Post by reelstuff » Wed Mar 26, 2014 11:02 pm

I noticed an odd issue using fields to manage HTML syntax, where a (?) is appended to the contents of the field.

contents of field
style="font-size:x-small;color:#aaa​;
However when I put the content of the fields, it inserts a "?"

like so,
style="font-size:x-small;color:#aaa?;
I saw this same issue in a different field, where using a semi-colon in the field, appended a question mark as well, after looking through the properties, of the field in question, the anomaly ceased, I have no idea what caused it, however I cannot seem to find a way to put a semi-colon, as there appears to be no such language for that.

I thought at one time there was some reference to using put with words, such as quote, space, ect.

quote seems to still work in 6.6 but not space, colon is recognized but not semi colon or semi-colon

Any thoughts or suggestions are much appreciated.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9662
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Field syntax append issue

Post by dunbarx » Wed Mar 26, 2014 11:33 pm

Hi.

Not sure how you are "putting" stuff into these fields.

The constants you refer to, like "colon" or "quote" are often required, not for readability, but to end-run around the native syntax. For example, if you wanted to put the following string into a variable including the quotes:

put "ABC" into myVariable

You could not do this without the quote constant:

put quote & "ABC" & quote into myVariable.

It is just a collision between the language elements and their usage. I am not sure why "? should matter, or ";", since these are ordinary characters, and have no other syntactical meaning. Why cannot you append a semi-colon?

put yourHTMLText & ";" after fld 1

Craig Newman

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: Field syntax append issue

Post by reelstuff » Thu Mar 27, 2014 12:28 am

Hi, thanks for your reply, I am pulling the HTML from the fields to build a template, with many variables, this allows the end user to select many different options, these users are not able to understand html or PHP or any kind of scripting, so I created a very simple utility to configure scripts and HTML pages and templates.

(Saves me tons of support time) (instead of spending 10 emails explaining how to edit the database variables of a PHP script, I hand them a simple utility and its one email instead of 10 or more emails.

In the past I have stored entire multi line complex scripts in a field and was able to use that method without an issue, but apparently some change has been made.

Also noticed a change with putting the contents of a field, into a variable, used to have to use "fieldName" into myVariable

But that failed in 6.6 so dropped the quotes and it worked.

Code: Select all

put fld appconfig_URL2 into myVar
used to be like this

Code: Select all

put fld "appconfig_URL2" into myVar
If I can no longer store complex characters in a field without a syntax collision, I may have to look at another solution

Thanks for taking time to reply, )

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9662
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Field syntax append issue

Post by dunbarx » Thu Mar 27, 2014 1:13 am

Hi.

I have not gone to 6.6, but are you saying that:

put soAndSo into fld "yourField"

fails if you put the field name in quotes? Can't be.

Anyone else see this???

Craig

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: Field syntax append issue

Post by reelstuff » Thu Mar 27, 2014 1:26 am

Quick Edit, generated a sample stack and no issues, LOL,

So I moved all the button code to functions, still no issue,

The original stack still has the issue, sort of a mystery, spent four hours trying to solve the added characters in the export container

If I can reproduce this issue will post a sample stack, for now its time to watch the Tube
Last edited by reelstuff on Thu Mar 27, 2014 2:41 am, edited 1 time in total.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4001
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Field syntax append issue

Post by bn » Thu Mar 27, 2014 2:40 am

Hi reelstuff, Craig,

this is mysterious. I do the things reel does all the time in 6.6 and don't see what reel describes. I also tried to copy reel's example from one field to the other, nothing special except for an invisible charToNum 63 in the first example which probably does not belong there. It is after aaa and before ; And numtochar(63) is a quotation mark. Try to place the cursor there and move it from ; to aaa with the arrowkey. If for example I copy reel's first example into a reply field all within the browser (no livecode involved) and I move the cursor with arrowkey left/right from ; to aaa then the cursor hangs for the invisible character.
style="font-size:x-small;color:#aaa​;
It looks that you picked up some stray characters. I wonder where they come from. I have not seen this in livecode. Could it be that you copied from a unicode source? UTF8? But here I am guessing.
It sure would help if you could post a little stack.

Actually I just copied the string you posted to BBEdit, a word processing program and it showed for the selected text (your invisible character) the following
stray character 2014-03-27 um 02.36.24.png
So here I enter unknown territory... maybe someone with unicode knowledge has an idea.

Kind regards
Bernd

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: Field syntax append issue

Post by reelstuff » Thu Mar 27, 2014 2:49 am

Yes, that is what is tripping me up,

correction yes the original post contains the actual products of the executed stack,
Last edited by reelstuff on Thu Mar 27, 2014 1:43 pm, edited 1 time in total.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4001
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Field syntax append issue

Post by bn » Thu Mar 27, 2014 8:31 am

Hi,

for anybody looking into this. The "stray" character is not in aboves post of
font-size:x-small;color:#aaa;">
but in the first post in the quoted part.

Kind regards
Bernd

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”