PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → String limitation
String limitation
Iniciado por guest, 28,may. 2015 18:12 - 9 respuestas
Publicado el 28,mayo 2015 - 18:12
Hello,

I'm using a string in a class called Trec.
Defined as string.
For some reason this string seems to be limited to 65535 characters.
I've upgraded my program from windev16 to windev18.
In version 16 this string wasn't limited to 65535 character.

Does someone have an idea what can be the reason ?

Thanks

Mark.
Publicado el 28,mayo 2015 - 19:22
Hi Mark

there is no reason, if the declaration is simply "is string"...

So,
- What IS the EXACT definition?
- What makes you think that it is limited to 65k? That may be something else than that...

Best regards
Publicado el 28,mayo 2015 - 21:14
The code is as follows :

Tfile is string
Trec is string
Tfile = Tfile+Trec // Trec has a value of over 65535 characters.

//I create an XML with the following tag :

XMLAddChild(xmlDoc,"DetailFile",Tfile)


When I look at the created XML, the tag "Detailfile" only has the first 65535 characters saved.

Thank for the help.

Mark.
Publicado el 28,mayo 2015 - 22:00
According to this thread of a few days ago XMLAddChild is responsible for that limitation of 65535 characters

http://27130.foren.mysnip.de/read.php…
Publicado el 29,mayo 2015 - 09:06
Hello Mark

I had the same problem.

As Fabrice suggested in my post, you can add a placeholder (%Attachment1%, %Attachment2%, etc etc) in your XML file as values.
After, closing the XML file, you can re-open it in read/write mode
and do a "find/replace" for the placeholders above, then save the file.

At the moment, this is the unique workaround possible, because i suppose the XMLAddChild function has some limitations to 65535 chars.

Gianni
Publicado el 29,mayo 2015 - 14:01
Hello Gianni,

Thanks for the answer, but when I do so, I still get the same result.

Below the code I use to do the changes after creating the Xml with the place holder ":Tfile".


XMLInfo = fLoadText(fCurrentDir+"Test.xml")
XmlDocument("XMLDoc",XMLInfo)
IF XMLFind("XMLDoc",":Tfile",XMLValue) THEN
XMLModify("XMLDoc",:Tfile)
END
XMLSource = XMLBuildString("XMLDoc")
fSaveText(fCurrentDir+"Test.xml,XMLSource)
XMLClose("XMLDoc")

Any suggestions ?

Mark
Publicado el 29,mayo 2015 - 14:41
If the problem is with the xmlxxx functions why not:
XMLInfo = fLoadText(fCurrentDir+"Test.xml")
XMLInfo =replace(XMLInfo ,":Tfile",:Tfile)
fsavetext(fCurrentDir+"Test.xml",XMLInfo )
Publicado el 30,mayo 2015 - 11:09
Hello Mark

I did all possible activities to solve the XMLAddChild limitations and the right solution has been what i have described before.

This is the portion of code of the XML where i use the place holder:
IF XMLFound("FatturaEleXML") THEN FOR j=1 TO 10 IF garrNomeAllegato[j] <> "" THEN nLinea+=1 IF nLinea<>1 THEN FOR x=1 TO nLinea XMLNext("FatturaEleXML") END END XMLAddChild("FatturaEleXML","NomeAttachment", garrNomeAllegato[j]) XMLAddChild("FatturaEleXML","FormatoAttachment", NoSpace(Upper(Middle(garrExtAllegati[j],2,5)))) sFilename=garrPathAllegati[j] sBuffer=fLoadText(sFilename) sEncrypt=Crypt(sBuffer,"",compressNone,encodeBASE64) XMLAddChild("FatturaEleXML","Attachment","%Allegato"+j+"%") XMLNext("FatturaEleXML") END END END
and this is the portion of code where i substitute the place holder with the file data stored in a string
nIdFile=fOpen (sSaveFile,foRead+foWrite) sBufferFile=fLoadText(sSaveFile) FOR j=1 TO 10 sFilename=garrPathAllegati[j] IF sFilename <> "" THEN sBuffer=fLoadText(sFilename) sEncrypt=Crypt(sBuffer,"",cryptNone,encodeBASE64) //Audio_Fattura.EDT_File=sEncrypt sSearch="%Allegato"+j+"%" sNuovoFile=Replace (sBufferFile,sSearch,sEncrypt) sBufferFile=sNuovoFile END END

Hope in this help

Gianni
Publicado el 30,mayo 2015 - 12:56
Hello everybody

if you have an example of limitation to 65535 in the current version that was NOT limited before, you should send it to pcsoft support so that the regression is reversed for everybody

Best regards
Publicado el 03,junio 2015 - 09:24
Thanks everyone for the reaction.

The replace instruction did the trick.

Mark