Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
9
Erster Beitrag:
vor 1 Jahr, 1 Monat
Letzter Beitrag:
vor 10 Monaten, 1 Woche
Beteiligte Autoren:
Sammy Broeders, Luis Antonio Gutiérrez Flores, Fabrice Harari, Ola, Paulo Oliveira

Text from multi-line edit box to database

Startbeitrag von Sammy Broeders am 10.10.2016 12:30

Hello all,

Has anyone a (simple) solution to set each text line from a Multi-line edit box set seperate to a data file? So each text line is a new record in the database.

Thanks,
Sammy
[attachment 2192 00.png]

Antworten:

what about:
FOR EACH STRING your_string OF muti_line_control SEPARATED BY CR
your_file.your_field=your_string
hadd(your_file)
END

von Paulo Oliveira - am 10.10.2016 14:09
You can try this

FOR EACH STRING sSubstring OF EDT_Name SEPARATED BY CR
FILE.FIELD = sSubstring
Hadd(FILE)
END

von Luis Antonio Gutiérrez Flores - am 10.10.2016 14:25
Great Luis!
This works fine.

von Sammy Broeders - am 10.10.2016 14:42
Glad it helped you! :)

von Luis Antonio Gutiérrez Flores - am 11.10.2016 15:25
The solution above works great when you use after typing a line in the Multi-line edit controle your enter key. But when the user don`t than in your edit controle you go automatic to the next line. How is it possible to receive this lines seperate to get them for each line a separate data line so as shown in the edit controle?

Sammy

von Sammy Broeders - am 18.01.2017 16:03
Hi Sammy,

I'm not sure, but you could try using

FOR EACH STRING sSubstring OF EDT_Name SEPARATED BY [Charact(10),CR]

...where Charact(10) is "line feed" and CR is "carriage return".

Best regards
Ola

von Ola - am 19.01.2017 12:13
Ola,

Thanks for you reply, i tried but this is not working.

Sammy

von Sammy Broeders - am 19.01.2017 12:26
Hi Sammy,

there is no simple solution, just because there is no special character in your string at that place. It is just displayed that way.

So you have to decide if each line is a definite number of chars (50 chars per line, with a fixed size char font by example), or if you want to use a more complex system. In that last case, you can use the textwith function and loop on words in your text to find the width of each part. When you go over the width of the control, it's a new line and you can write in your file.

Best regards

von Fabrice Harari - am 19.01.2017 18:35
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.