Page 1 sur 1

mauvais format string

Posté : sam. 03 juin 2017 05:02
par davinciomar
Bonjour je ne sais pas pourquoi mais j'obtiens toujours le meme message. string Badly formated,
j'ai change la chaine qui est la suivante:

Code : Tout sélectionner

Global $s  = "This is a long string that is holding more than 80 characters and thus should be split into several lines. That is if everything is working properly and nicely and all that. No misshaps no typos. No bugs. But I want the code too look good too. That's the problem!"
Pour la suivante:
Global $s = "This is "
&_
"a long s"
&_
"tring th"
&_
"at is ho"
&_
"lding mo"
&_
"re than "
&_
"80 chara"
&_
"cters an"
&_
"d thus s"
&_
"hould be"
&_
" split i"
&_
"nto seve"
&_
"ral line"
&_
"s. That "
&_
"is if ev"
&_
"erything"
&_
" is work"
&_
"ing prop"
&_
"erly and"
&_
" nicely "
&_
"and all "
&_
"that. No"
&_
" misshap"
&_
"s no typ"
&_
"os. No b"
&_
"ugs. But"
&_
" I want "
&_
"the code"
&_
" too loo"
&_
"k good t"
&_
"oo. That"
&_
"'s the p"
&_
"roblem!"
Le erreur est le suivant:
Image

qui j'ai fait mauvais?

Re: mauvais format string

Posté : sam. 03 juin 2017 09:08
par Tlem
Le &_ doit être sur la même ligne que le texte qui le précède sinon il faut rajouter le "pour _" à la fin de la chaîne...

Code : Tout sélectionner

 
Global $s = "This is" & _
" à long s" & _
"tring th"



Edit : J'avais oublié l'espace ...

Re: mauvais format string

Posté : sam. 03 juin 2017 15:21
par mimione
Et pour faire bonne mesure, rajouter un espace avant les "_" de continuation....