Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 8 Jahren, 1 Monat
Letzter Beitrag:
vor 8 Jahren
Beteiligte Autoren:
Sjoerd Kessels.pcs.crosspost, Malc

Databinding does not work for Unicode strings

Startbeitrag von Sjoerd Kessels.pcs.crosspost am 21.07.2010 11:14

Hi all,

I seem to have an issue with databinding and Unicode string. Hope somebody can help.
I use Windev 14, latest version.

I have a file State that has f.e. a property 'name' which is of type Unicode.
I also have a class with a property 'name' that is of type String Unicode.
Now when I use databinding FileToMemory(object,State) the property name is not filled in my object. When both are just regular strings, it does work.

Is this a bug? Or am I doing something wrong?

Thanks,

Sjoerd

Message forwarded from pcsoft.us.windev

Antworten:

Re: databinding does not work for Unicode strings

I nobody using databinding in combination with Unicode?

Message forwarded from pcsoft.us.windev

von Sjoerd Kessels.pcs.crosspost - am 23.07.2010 05:55

Re: databinding does not work for Unicode strings

Hi Sjoerd

I had/have this problem myself.

Tried using variant instead which sort of solved some of the issues but am now using a custom function to implicitly load/save the values
i.e.

object.property = datasource.field

and

datasource.field = object.property

via indirection e.g.


PROCEDURE LoadRecordObjectFromDataSource(poRecord, pdsDataSource)
LOCAL
lsItemInfo is string=""
laItemInfo is dynamic array of 0 by 8 string
liItems is int = 0
liItem is int = 0
lsItem is string = ""
lsValue is string = ""
lsHFType is string = ""

// do the default
FileToMemory(poRecord, pdsDataSource)

lsItemInfo = HListItem(pdsDataSource, hLstDetailPlus)

StringToArray(lsItemInfo,laItemInfo,CR,TAB)
liItems = ArrayInfo(laItemInfo,tiNumberRows )

FOR liItem = 1 TO liItems
lsItem = laItemInfo[liItem, 1]
lsHFType = laItemInfo[liItem, 3] // Hyperfile data type
SWITCH lsHFType
CASE "24" // date+time item
// do something with null?????
CASE "30" // unicode
{"poRecord." + lsItem, indVariable} = {pdsDataSource + "." + lsItem, indItem}
OTHER CASE
END
END
RETURN






Cheers

Malc

von Malc - am 23.07.2010 09:45
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.