Quotes in constants - tell me I'm wrong …
Posted: Sat Dec 31, 2022 1:02 pm
Hi,
I'm parsing HTML and I've got several strings that act as patterns, like
of course this could be a constant; actually, it should be a constant:
But I have also
and this can't be a constant because it embeds quotes. I couldn't find a way to embed a quote within a string without using the & operator. And constants can't embed any operator.
Did I get it correctly? or is there a way to write a string constant containing quotes?
BTW, some languages allow you to write constants like:
a constant being just something that is evaluated only once, probably by the compiler, or at the beginning of the handler or sub.
I'm parsing HTML and I've got several strings that act as patterns, like
Code: Select all
put "</table" into laCleFinTable
Code: Select all
constant laCleFinTable = "</table"
Code: Select all
put "<table class=""e&"table table2""e&" id=""e&"partants_table_" into laCleDebutTable
Did I get it correctly? or is there a way to write a string constant containing quotes?
BTW, some languages allow you to write constants like:
Code: Select all
constant laCleDebutTable = "<table class=\"table table2\" id=\"partants_table_" -- see example above
constant ten = 2*5 -- kind of silly, of course
constant pi = arcCos(-1) -- not as silly as it seems